15 #ifndef COPYONWRITEOBJECT_H
16 #define COPYONWRITEOBJECT_H
18 #include "pandabase.h"
20 #include "cachedTypedWritableReferenceCount.h"
22 #include "conditionVar.h"
23 #include "mutexHolder.h"
33 #define COW_THREADED 1
47 INLINE CopyOnWriteObject(
const CopyOnWriteObject ©);
48 INLINE
void operator = (
const CopyOnWriteObject ©);
52 virtual bool unref()
const;
54 #endif // COW_THREADED
57 virtual PT(CopyOnWriteObject) make_cow_copy()=0;
68 LockStatus _lock_status;
70 #endif // COW_THREADED
74 return get_class_type();
76 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
84 static void init_type() {
85 CachedTypedWritableReferenceCount::init_type();
86 register_type(_type_handle,
"CopyOnWriteObject",
87 CachedTypedWritableReferenceCount::get_class_type());
106 INLINE CopyOnWriteObj(
const Base ©);
115 return get_class_type();
117 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
125 static void init_type();
136 template<
class Base,
class Param1>
140 INLINE CopyOnWriteObj1(
const Base ©);
151 return get_class_type();
153 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
161 static void init_type();
167 #include "copyOnWriteObject.I"
This is a special extension to ReferenceCount that includes dual reference counts: the standard refer...
A standard mutex, or mutual exclusion lock.
A condition variable, usually used to communicate information about changing state to a thread that i...
virtual bool unref() const
Explicitly decrements the reference count.
void cache_ref() const
Explicitly increments the cache reference count and the normal reference count simultaneously.
This base class provides basic reference counting, but also can be used with a CopyOnWritePointer to ...
This safely stores the primary, owned pointer to a CopyOnWriteObject.
A thread; that is, a lightweight process.
This is similar to RefCountObj, but it implements a CopyOnWriteObject inheritance instead of a Refere...
TypeHandle is the identifier used to differentiate C++ class types.