Panda3D
 All Classes Functions Variables Enumerations
internalNameCollection.h
1 // Filename: internalNameCollection.h
2 // Created by: drose (16Mar02)
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 INTERNALNAMECOLLECTION_H
16 #define INTERNALNAMECOLLECTION_H
17 
18 #include "pandabase.h"
19 #include "pointerToArray.h"
20 #include "internalName.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : InternalNameCollection
24 // Description :
25 ////////////////////////////////////////////////////////////////////
26 class EXPCL_PANDA_PGRAPH InternalNameCollection {
27 PUBLISHED:
30  void operator = (const InternalNameCollection &copy);
31  INLINE ~InternalNameCollection();
32 
33  void add_name(const InternalName *name);
34  bool remove_name(const InternalName *name);
35  void add_names_from(const InternalNameCollection &other);
36  void remove_names_from(const InternalNameCollection &other);
37  void remove_duplicate_names();
38  bool has_name(const InternalName *name) const;
39  void clear();
40 
41  int get_num_names() const;
42  const InternalName *get_name(int index) const;
43  MAKE_SEQ(get_names, get_num_names, get_name);
44  const InternalName *operator [] (int index) const;
45  int size() const;
46  INLINE void operator += (const InternalNameCollection &other);
47  INLINE InternalNameCollection operator + (const InternalNameCollection &other) const;
48 
49  void output(ostream &out) const;
50  void write(ostream &out, int indent_level = 0) const;
51 
52 private:
53  typedef PTA(CPT(InternalName)) InternalNames;
54  InternalNames _names;
55 };
56 
57 INLINE ostream &operator << (ostream &out, const InternalNameCollection &col) {
58  col.output(out);
59  return out;
60 }
61 
62 #include "internalNameCollection.I"
63 
64 #endif
65 
66 
void output(ostream &out) const
Writes a brief one-line description of the InternalNameCollection to the indicated output stream...