Panda3D
dcKeyword.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file dcKeyword.h
10  * @author drose
11  * @date 2005-07-22
12  */
13 
14 #ifndef DCKEYWORD_H
15 #define DCKEYWORD_H
16 
17 #include "dcbase.h"
18 #include "dcDeclaration.h"
19 
20 class DCParameter;
21 class HashGenerator;
22 
23 /**
24  * This represents a single keyword declaration in the dc file. It is used to
25  * define a communication property associated with a field, for instance
26  * "broadcast" or "airecv".
27  */
28 class EXPCL_DIRECT_DCPARSER DCKeyword : public DCDeclaration {
29 public:
30  DCKeyword(const std::string &name, int historical_flag = ~0);
31  virtual ~DCKeyword();
32 
33 PUBLISHED:
34  const std::string &get_name() const;
35 
36 public:
37  int get_historical_flag() const;
38  void clear_historical_flag();
39 
40  virtual void output(std::ostream &out, bool brief) const;
41  virtual void write(std::ostream &out, bool brief, int indent_level) const;
42  void generate_hash(HashGenerator &hashgen) const;
43 
44 private:
45  const std::string _name;
46 
47  // This flag is only kept for historical reasons, so we can preserve the
48  // file's hash code if no new flags are in use.
49  int _historical_flag;
50 };
51 
52 #endif
This represents a single keyword declaration in the dc file.
Definition: dcKeyword.h:28
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Represents the type specification for a single parameter within a field specification.
Definition: dcParameter.h:35
This is a common interface for a declaration in a DC file.
Definition: dcDeclaration.h:29
This class generates an arbitrary hash number from a sequence of ints.
Definition: hashGenerator.h:24
void write(std::ostream &out, int indent_level) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.