00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef NAMABLE_H
00016 #define NAMABLE_H
00017
00018 #include "pandabase.h"
00019
00020 #include "typedObject.h"
00021 #include <string>
00022
00023
00024
00025
00026
00027
00028
00029 class EXPCL_PANDAEXPRESS Namable : public MemoryBase {
00030 PUBLISHED:
00031 INLINE Namable(const string &initial_name = "");
00032 INLINE Namable(const Namable ©);
00033 INLINE Namable &operator = (const Namable &other);
00034
00035 INLINE void set_name(const string &name);
00036 INLINE void clear_name();
00037 INLINE bool has_name() const;
00038 INLINE const string &get_name() const;
00039
00040
00041
00042 INLINE void output(ostream &out) const;
00043
00044 private:
00045 string _name;
00046
00047 public:
00048 static TypeHandle get_class_type() {
00049 return _type_handle;
00050 }
00051 static void init_type() {
00052 register_type(_type_handle, "Namable");
00053 }
00054
00055 private:
00056 static TypeHandle _type_handle;
00057 };
00058
00059 INLINE ostream &operator << (ostream &out, const Namable &n);
00060
00061
00062
00063
00064
00065
00066
00067
00068 class NamableOrderByName {
00069 public:
00070 INLINE bool operator ()(const Namable *n1, const Namable *n2) const;
00071 };
00072
00073 #include "namable.I"
00074
00075 #endif
00076
00077