32 _keywords(copy._keywords),
33 _keywords_by_name(copy._keywords_by_name),
43 _keywords = copy._keywords;
44 _keywords_by_name = copy._keywords_by_name;
53 nassertv(_keywords_by_name.size() == _keywords.size());
61 return (_keywords_by_name.find(name) != _keywords_by_name.end());
77 nassertr(_keywords_by_name.size() == _keywords.size(), 0);
78 return _keywords.size();
86 nassertr(n >= 0 && n < (
int)_keywords.size(),
nullptr);
96 KeywordsByName::const_iterator ni;
97 ni = _keywords_by_name.find(name);
98 if (ni != _keywords_by_name.end()) {
111 return _keywords_by_name == other._keywords_by_name;
128 bool inserted = _keywords_by_name.insert(KeywordsByName::value_type(keyword->
get_name(), keyword)).second;
130 _keywords.push_back(keyword);
143 _keywords_by_name.clear();
151 output_keywords(std::ostream &out)
const {
152 Keywords::const_iterator ki;
153 for (ki = _keywords.begin(); ki != _keywords.end(); ++ki) {
154 out <<
" " << (*ki)->get_name();
172 hashgen.
add_int(_keywords_by_name.size());
173 KeywordsByName::const_iterator ni;
174 for (ni = _keywords_by_name.begin(); ni != _keywords_by_name.end(); ++ni) {
175 (*ni).second->generate_hash(hashgen);
This represents a single keyword declaration in the dc file.
This is a list of keywords (see DCKeyword) that may be set on a particular field.
const DCKeyword * get_keyword(int n) const
Returns the nth keyword in the list.
void add_int(int num)
Adds another integer to the hash so far.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
const std::string & get_name() const
Returns the name of this keyword.
const DCKeyword * get_keyword_by_name(const std::string &name) const
Returns the keyword in the list with the indicated name, or NULL if there is no keyword in the list w...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_num_keywords() const
Returns the number of keywords in the list.
bool has_keyword(const std::string &name) const
Returns true if this list includes the indicated keyword, false otherwise.
bool compare_keywords(const DCKeywordList &other) const
Returns true if this list has the same keywords as the other list, false if some keywords differ.
This class generates an arbitrary hash number from a sequence of ints.
void copy_keywords(const DCKeywordList &other)
Replaces this keyword list with those from the other list.
bool add_keyword(const DCKeyword *keyword)
Adds the indicated keyword to the list.
void clear_keywords()
Removes all keywords from the field.
void generate_hash(HashGenerator &hashgen) const
Accumulates the properties of these keywords into the hash.
int get_historical_flag() const
Returns the bitmask associated with this keyword, if any.