scfImplementation< Class > Class Template Reference
[Shared Class Facility (SCF)]
Baseclass for the SCF implementation templates.
More...
#include <csutil/scf_implementation.h>

Public Member Functions | |
virtual void | AddRefOwner (void **ref_owner) |
For weak references: add a reference owner. | |
virtual void | DecRef () |
Decrement the number of references to this object. | |
virtual scfInterfaceMetadataList * | GetInterfaceMetadata () |
Request the meta-data for the interfaces implemented by this object. | |
virtual int | GetRefCount () |
Get the ref count (only for debugging). | |
virtual void | IncRef () |
Increment the number of references to this object. | |
scfImplementation & | operator= (const scfImplementation &) |
Assign to another instance. | |
virtual void | RemoveRefOwner (void **ref_owner) |
For weak references: remove a reference owner. | |
scfImplementation (const scfImplementation &) | |
Copy constructor. | |
scfImplementation (Class *object, iBase *parent=0) | |
Constructor. | |
Protected Member Functions | |
void * | QueryInterface (scfInterfaceID iInterfaceID, scfInterfaceVersion iVersion) |
Query a particular interface implemented by this object. |
Detailed Description
template<class Class>
class scfImplementation< Class >
Baseclass for the SCF implementation templates.
Provides common methods such as reference counting and handling of weak references.
Definition at line 198 of file scf_implementation.h.
Constructor & Destructor Documentation
scfImplementation< Class >::scfImplementation | ( | Class * | object, | |
iBase * | parent = 0 | |||
) | [inline] |
Constructor.
Initialize the SCF-implementation in class named Class. Will be called from scfImplementation(Ext)N constructor
Definition at line 207 of file scf_implementation.h.
scfImplementation< Class >::scfImplementation | ( | const scfImplementation< Class > & | ) | [inline] |
Copy constructor.
Use of the default copy constructor is nor desired since the information is insufficient to fully initialize scfImplementation; hence, an explicit copy constructor must be created in the derived class that initializes scfImplementation like in the normal constructor, i.e. "scfImplementation (this)".
Definition at line 229 of file scf_implementation.h.
Member Function Documentation
virtual void scfImplementation< Class >::AddRefOwner | ( | void ** | ref_owner | ) | [inline, virtual] |
For weak references: add a reference owner.
Thread-safe - it is possible to add reference owners from different threads at the same time. However, if an object may be destructed on another thread, race conditions might ensue. If weak references are to be used in a multithreaded environment each thread holding a weak reference to an object should also hold a normal reference somewhere.
Implements iBase.
Definition at line 286 of file scf_implementation.h.
virtual void scfImplementation< Class >::DecRef | ( | ) | [inline, virtual] |
Decrement the number of references to this object.
Thread-safe - it is possible to manipulate the reference count from different threads. If multiple threads simultaneously decrement the reference count and cause the object to be freed it's not defined on which thread the subsequent destruction happens - it may happen in any one of the decrementing thread.
Implements iBase.
Reimplemented in csPoolEvent.
Definition at line 260 of file scf_implementation.h.
virtual scfInterfaceMetadataList* scfImplementation< Class >::GetInterfaceMetadata | ( | ) | [inline, virtual] |
Request the meta-data for the interfaces implemented by this object.
Thread-safe - it is possible to query the supported interfaces from different threads at the same time.
Implements iBase.
Definition at line 314 of file scf_implementation.h.
virtual int scfImplementation< Class >::GetRefCount | ( | ) | [inline, virtual] |
Get the ref count (only for debugging).
If another thread manipulates the reference count at the same time the count may reflect the state before or after the manipulation; it is undefined which exactly.
Implements iBase.
Definition at line 281 of file scf_implementation.h.
virtual void scfImplementation< Class >::IncRef | ( | ) | [inline, virtual] |
Increment the number of references to this object.
Thread-safe - it is possible to manipulate the reference count from different threads at the same time.
Implements iBase.
Definition at line 272 of file scf_implementation.h.
scfImplementation& scfImplementation< Class >::operator= | ( | const scfImplementation< Class > & | ) | [inline] |
Assign to another instance.
When assigning an SCF object to another, anything contained in this class should not be copied, since it's all instance- specific. Hence the assignment operator does nothing.
Definition at line 255 of file scf_implementation.h.
void* scfImplementation< Class >::QueryInterface | ( | scfInterfaceID | iInterfaceID, | |
scfInterfaceVersion | iVersion | |||
) | [inline, protected, virtual] |
Query a particular interface implemented by this object.
You are _not_ allowed to cast this to anything but a pointer to this interface (not even iBase). Use scfQueryInterface<interface> instead of using this method directly. Thread-safe - it is possible to query interfaces from different threads at the same time.
Implements iBase.
Definition at line 335 of file scf_implementation.h.
virtual void scfImplementation< Class >::RemoveRefOwner | ( | void ** | ref_owner | ) | [inline, virtual] |
For weak references: remove a reference owner.
Thread-safe - it is possible to add reference owners from different threads at the same time. But the see comments in AddRefOwner() on weak references in a multithreaded environment.
Implements iBase.
Definition at line 298 of file scf_implementation.h.
The documentation for this class was generated from the following file:
- csutil/scf_implementation.h
Generated for Crystal Space 1.4.0 by doxygen 1.5.8