internalNameCollection.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. #ifndef INTERNALNAMECOLLECTION_H
  15. #define INTERNALNAMECOLLECTION_H
  16. #include "pandabase.h"
  17. #include "pointerToArray.h"
  18. #include "internalName.h"
  19. ////////////////////////////////////////////////////////////////////
  20. // Class : InternalNameCollection
  21. // Description :
  22. ////////////////////////////////////////////////////////////////////
  23. class EXPCL_PANDA_PGRAPH InternalNameCollection {
  24. PUBLISHED:
  25. InternalNameCollection();
  26. InternalNameCollection(const InternalNameCollection &copy);
  27. void operator = (const InternalNameCollection &copy);
  28. INLINE ~InternalNameCollection();
  29. void add_name(InternalName *name);
  30. bool remove_name(InternalName *name);
  31. void add_names_from(const InternalNameCollection &other);
  32. void remove_names_from(const InternalNameCollection &other);
  33. void remove_duplicate_names();
  34. bool has_name(InternalName *name) const;
  35. void clear();
  36. int get_num_names() const;
  37. InternalName *get_name(int index) const;
  38. InternalName *operator [] (int index) const;
  39. void output(ostream &out) const;
  40. void write(ostream &out, int indent_level = 0) const;
  41. private:
  42. typedef PTA(PT(InternalName)) InternalNames;
  43. InternalNames _names;
  44. };
  45. INLINE ostream &operator << (ostream &out, const InternalNameCollection &col) {
  46. col.output(out);
  47. return out;
  48. }
  49. #include "internalNameCollection.I"
  50. #endif