Panda3D
|
00001 // Filename: eggNamedObject.h 00002 // Created by: drose (16Jan99) 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 EGGNAMEDOBJECT_H 00016 #define EGGNAMEDOBJECT_H 00017 00018 #include "pandabase.h" 00019 00020 #include "eggObject.h" 00021 #include "namable.h" 00022 #include "referenceCount.h" 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : EggNamedObject 00026 // Description : This is a fairly low-level base class--any egg 00027 // object that has a name. 00028 //////////////////////////////////////////////////////////////////// 00029 class EXPCL_PANDAEGG EggNamedObject : public EggObject, public Namable { 00030 PUBLISHED: 00031 INLINE EggNamedObject(const string &name = ""); 00032 INLINE EggNamedObject(const EggNamedObject ©); 00033 INLINE EggNamedObject &operator = (const EggNamedObject ©); 00034 00035 void output(ostream &out) const; 00036 00037 public: 00038 void write_header(ostream &out, int indent_level, 00039 const char *egg_keyword) const; 00040 00041 00042 static TypeHandle get_class_type() { 00043 return _type_handle; 00044 } 00045 static void init_type() { 00046 EggObject::init_type(); 00047 Namable::init_type(); 00048 register_type(_type_handle, "EggNamedObject", 00049 EggObject::get_class_type(), 00050 Namable::get_class_type()); 00051 } 00052 virtual TypeHandle get_type() const { 00053 return get_class_type(); 00054 } 00055 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00056 00057 private: 00058 static TypeHandle _type_handle; 00059 }; 00060 00061 INLINE ostream &operator << (ostream &out, const EggNamedObject &n); 00062 00063 #include "eggNamedObject.I" 00064 00065 #endif