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