eggNamedObject.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Filename: eggNamedObject.h
  2. // Created by: drose (16Jan99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. #ifndef EGGNAMEDOBJECT_H
  6. #define EGGNAMEDOBJECT_H
  7. #include <pandabase.h>
  8. #include "eggObject.h"
  9. #include <namable.h>
  10. #include <referenceCount.h>
  11. #ifndef WIN32_VC
  12. class ostream;
  13. #endif
  14. ////////////////////////////////////////////////////////////////////
  15. // Class : EggNamedObject
  16. // Description : This is a fairly high-level base class--any egg
  17. // object that has a name.
  18. ////////////////////////////////////////////////////////////////////
  19. class EXPCL_PANDAEGG EggNamedObject : public EggObject, public Namable {
  20. public:
  21. INLINE EggNamedObject(const string &name = "");
  22. INLINE EggNamedObject(const EggNamedObject &copy);
  23. INLINE EggNamedObject &operator = (const EggNamedObject &copy);
  24. void write_header(ostream &out, int indent_level,
  25. const char *egg_keyword) const;
  26. static TypeHandle get_class_type() {
  27. return _type_handle;
  28. }
  29. static void init_type() {
  30. EggObject::init_type();
  31. Namable::init_type();
  32. register_type(_type_handle, "EggNamedObject",
  33. EggObject::get_class_type(),
  34. Namable::get_class_type());
  35. }
  36. virtual TypeHandle get_type() const {
  37. return get_class_type();
  38. }
  39. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  40. private:
  41. static TypeHandle _type_handle;
  42. };
  43. #include "eggNamedObject.I"
  44. #endif