00001 // Filename: dcKeyword.h 00002 // Created by: drose (22Jul05) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef DCKEYWORD_H 00016 #define DCKEYWORD_H 00017 00018 #include "dcbase.h" 00019 #include "dcDeclaration.h" 00020 00021 class DCParameter; 00022 class HashGenerator; 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : DCKeyword 00026 // Description : This represents a single keyword declaration in the 00027 // dc file. It is used to define a communication 00028 // property associated with a field, for instance 00029 // "broadcast" or "airecv". 00030 //////////////////////////////////////////////////////////////////// 00031 class EXPCL_DIRECT DCKeyword : public DCDeclaration { 00032 public: 00033 DCKeyword(const string &name, int historical_flag = ~0); 00034 virtual ~DCKeyword(); 00035 00036 PUBLISHED: 00037 const string &get_name() const; 00038 00039 public: 00040 int get_historical_flag() const; 00041 void clear_historical_flag(); 00042 00043 virtual void output(ostream &out, bool brief) const; 00044 virtual void write(ostream &out, bool brief, int indent_level) const; 00045 void generate_hash(HashGenerator &hashgen) const; 00046 00047 private: 00048 const string _name; 00049 00050 // This flag is only kept for historical reasons, so we can preserve 00051 // the file's hash code if no new flags are in use. 00052 int _historical_flag; 00053 }; 00054 00055 #endif