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;
55 #endif // COW_THREADED 58 virtual PT(CopyOnWriteObject) make_cow_copy()=0;
69 LockStatus _lock_status;
71 #endif // COW_THREADED 75 return get_class_type();
77 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
85 static void init_type() {
86 CachedTypedWritableReferenceCount::init_type();
87 register_type(_type_handle,
"CopyOnWriteObject",
88 CachedTypedWritableReferenceCount::get_class_type());
107 INLINE CopyOnWriteObj(
const Base ©);
116 return get_class_type();
118 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
126 static void init_type();
137 template<
class Base,
class Param1>
141 INLINE CopyOnWriteObj1(
const Base ©);
145 ALLOC_DELETED_CHAIN(ThisClass)
152 return get_class_type();
154 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
162 static void init_type();
168 #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...
bool cache_unref() const
Explicitly decrements the cache reference count and the normal reference count simultaneously.
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.
virtual bool unref() const
Explicitly decrements the reference count.