15 #ifndef INTERNALNAME_H 16 #define INTERNALNAME_H 18 #include "pandabase.h" 20 #include "typedWritableReferenceCount.h" 21 #include "pointerTo.h" 23 #include "lightMutex.h" 24 #include "lightMutexHolder.h" 45 InternalName(InternalName *parent,
const string &basename);
48 INLINE
static PT(InternalName) make(
const string &name);
51 INLINE
static PT(InternalName) make(
const char (&literal)[N]);
54 virtual ~InternalName();
55 virtual bool unref()
const;
57 static PT(InternalName) make(
const string &name,
int index);
58 PT(InternalName) append(
const string &basename);
60 INLINE InternalName *get_parent()
const;
61 string get_name()
const;
62 string join(
const string &sep)
const;
63 INLINE
const string &get_basename()
const;
65 int find_ancestor(
const string &basename)
const;
66 const InternalName *get_ancestor(
int n)
const;
67 const InternalName *get_top()
const;
68 string get_net_basename(
int n)
const;
70 void output(ostream &out)
const;
73 INLINE
static PT(InternalName) get_root();
74 INLINE
static PT(InternalName) get_error();
75 INLINE
static PT(InternalName) get_vertex();
76 INLINE
static PT(InternalName) get_normal();
77 INLINE
static PT(InternalName) get_tangent();
78 INLINE
static PT(InternalName) get_tangent_name(
const string &name);
79 INLINE
static PT(InternalName) get_binormal();
80 INLINE
static PT(InternalName) get_binormal_name(
const string &name);
81 INLINE
static PT(InternalName) get_texcoord();
82 INLINE
static PT(InternalName) get_texcoord_name(
const string &name);
83 INLINE
static PT(InternalName) get_color();
84 INLINE
static PT(InternalName) get_rotate();
85 INLINE
static PT(InternalName) get_size();
86 INLINE
static PT(InternalName) get_aspect_ratio();
87 INLINE
static PT(InternalName) get_transform_blend();
88 INLINE
static PT(InternalName) get_transform_weight();
89 INLINE
static PT(InternalName) get_transform_index();
90 INLINE
static PT(InternalName) get_morph(InternalName *column,
const string &slider);
91 INLINE
static PT(InternalName) get_index();
92 INLINE
static PT(InternalName) get_world();
93 INLINE
static PT(InternalName) get_camera();
94 INLINE
static PT(InternalName) get_model();
95 INLINE
static PT(InternalName) get_view();
100 #if PY_MAJOR_VERSION >= 3 101 EXTENSION(
static PT(InternalName) make(PyUnicodeObject *str));
103 EXTENSION(
static PT(InternalName) make(PyStringObject *str));
111 typedef phash_map<PyObject *, InternalName *, pointer_hash> PyInternTable;
112 static PyInternTable _py_intern_table;
116 PT(InternalName) _parent;
119 typedef phash_map<string, InternalName *, string_hash> NameTable;
120 NameTable _name_table;
123 typedef phash_map<const char *, PT(InternalName), pointer_hash> LiteralTable;
124 static LiteralTable _literal_table;
127 static PT(InternalName) _root;
128 static PT(InternalName) _error;
129 static PT(InternalName) _default;
130 static PT(InternalName) _vertex;
131 static PT(InternalName) _normal;
132 static PT(InternalName) _tangent;
133 static PT(InternalName) _binormal;
134 static PT(InternalName) _texcoord;
135 static PT(InternalName) _color;
136 static PT(InternalName) _rotate;
137 static PT(InternalName) _size;
138 static PT(InternalName) _aspect_ratio;
139 static PT(InternalName) _transform_blend;
140 static PT(InternalName) _transform_weight;
141 static PT(InternalName) _transform_index;
142 static PT(InternalName) _index;
143 static PT(InternalName) _world;
144 static PT(InternalName) _camera;
145 static PT(InternalName) _model;
146 static PT(InternalName) _view;
150 static void register_with_read_factory();
163 static void init_type() {
164 TypedWritableReferenceCount::init_type();
165 register_type(_type_handle,
"InternalName",
166 TypedWritableReferenceCount::get_class_type());
169 register_type(_texcoord_type_handle,
"TexCoordName",
170 TypedWritableReferenceCount::get_class_type());
173 return get_class_type();
175 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
182 INLINE ostream &operator << (ostream &out,
const InternalName &tcn);
199 INLINE CPT_InternalName(
const To *ptr = (
const To *)NULL);
202 INLINE CPT_InternalName(
const string &name);
205 INLINE CPT_InternalName(
const char (&literal)[N]);
207 #ifdef USE_MOVE_SEMANTICS 212 #endif // USE_MOVE_SEMANTICS 214 INLINE CPT_InternalName &operator = (
const To *ptr);
219 INLINE
void swap(CPT_InternalName &one, CPT_InternalName &two) NOEXCEPT {
224 #include "internalName.I" virtual void finalize(BamReader *manager)
Called by the BamReader to perform any final actions needed for setting up the object after all objec...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Base class for objects that can be written to and read from Bam files.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
This describes the structure of a single array within a Geom data.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
void swap(PointerToVoid &other) NOEXCEPT
Swaps the contents of this PointerTo with the other, without touching the reference counts...
PointerTo is a template class which implements a smart pointer to an object derived from ReferenceCou...
TypeHandle is the identifier used to differentiate C++ class types.
This is a standard, non-reentrant mutex, similar to the Mutex class.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
virtual bool unref() const
Explicitly decrements the reference count.