scfImplementationPooled< Super, Allocator, Locked > Class Template Reference
[Shared Class Facility (SCF)]
Derive an SCF implementation from this class to have it pooled.
More...
#include <csutil/pooledscfclass.h>
Inherits Super.
Public Member Functions | |
| void | DecRef () |
| DecRef() implementation that returns the object to the pool. | |
| void * | operator new (size_t n, Pool &p) |
| Allocate a new instance of a pooled SCF class. | |
| void | operator delete (void *instance) |
| Recycle a new instance of a pooled SCF class. | |
| void | operator delete (void *instance, Pool &p) |
| Recycle a new instance of a pooled SCF class. | |
| template<typename A , typename B , typename C , typename D , typename E > | |
| scfImplementationPooled (scfClassType *object, A a, B b, C c, D d, E e) | |
| Constructor. | |
| template<typename A , typename B , typename C , typename D > | |
| scfImplementationPooled (scfClassType *object, A a, B b, C c, D d) | |
| Constructor. | |
| template<typename A , typename B , typename C > | |
| scfImplementationPooled (scfClassType *object, A a, B b, C c) | |
| Constructor. | |
| template<typename A , typename B > | |
| scfImplementationPooled (scfClassType *object, A a, B b) | |
| Constructor. | |
| template<typename A > | |
| scfImplementationPooled (scfClassType *object, A a) | |
| Constructor. | |
| scfImplementationPooled (scfClassType *object) | |
| Constructor. | |
Protected Attributes | |
| Pool * | scfPool |
| Pointer to the pool this instance is from. | |
Detailed Description
template<typename Super, typename Allocator = CS::Memory::AllocatorMalloc, bool Locked = false>
class scfImplementationPooled< Super, Allocator, Locked >
Derive an SCF implementation from this class to have it pooled.
- The Super template argument is the scfImplementation...<> class you would normally use.
- Locked specifies whether the pool should be locked for allocations. Use it if allocations may be made from different threads.
class csFoo : public scfImplementationPooled<scfImplementation1<csFoo, iFoo> > { ... };
- A pooled class must needs to have the scfPooledImplementationType class in its initializer list:
csFoo () : scfPooledImplementationType (this) { ... } - To obtain an instance of Class, use new with the pool object as the placement argument:
csFoo::Pool fooPool; ... csRef<csFoo> foo; foo.AttachNew (new (fooPool) csFoo);
Definition at line 65 of file pooledscfclass.h.
Constructor & Destructor Documentation
| scfImplementationPooled< Super, Allocator, Locked >::scfImplementationPooled | ( | scfClassType * | object | ) | [inline] |
Constructor.
Call from the derived class with 'this' as first argument.
Definition at line 167 of file pooledscfclass.h.
| scfImplementationPooled< Super, Allocator, Locked >::scfImplementationPooled | ( | scfClassType * | object, | |
| A | a | |||
| ) | [inline] |
Constructor.
Call from the derived class with 'this' as first argument.
Definition at line 170 of file pooledscfclass.h.
| scfImplementationPooled< Super, Allocator, Locked >::scfImplementationPooled | ( | scfClassType * | object, | |
| A | a, | |||
| B | b | |||
| ) | [inline] |
Constructor.
Call from the derived class with 'this' as first argument.
Definition at line 173 of file pooledscfclass.h.
| scfImplementationPooled< Super, Allocator, Locked >::scfImplementationPooled | ( | scfClassType * | object, | |
| A | a, | |||
| B | b, | |||
| C | c | |||
| ) | [inline] |
Constructor.
Call from the derived class with 'this' as first argument.
Definition at line 176 of file pooledscfclass.h.
| scfImplementationPooled< Super, Allocator, Locked >::scfImplementationPooled | ( | scfClassType * | object, | |
| A | a, | |||
| B | b, | |||
| C | c, | |||
| D | d | |||
| ) | [inline] |
Constructor.
Call from the derived class with 'this' as first argument.
Definition at line 179 of file pooledscfclass.h.
| scfImplementationPooled< Super, Allocator, Locked >::scfImplementationPooled | ( | scfClassType * | object, | |
| A | a, | |||
| B | b, | |||
| C | c, | |||
| D | d, | |||
| E | e | |||
| ) | [inline] |
Constructor.
Call from the derived class with 'this' as first argument.
Definition at line 182 of file pooledscfclass.h.
Member Function Documentation
| void scfImplementationPooled< Super, Allocator, Locked >::DecRef | ( | ) | [inline] |
DecRef() implementation that returns the object to the pool.
Definition at line 153 of file pooledscfclass.h.
| void scfImplementationPooled< Super, Allocator, Locked >::operator delete | ( | void * | instance | ) | [inline] |
| void scfImplementationPooled< Super, Allocator, Locked >::operator delete | ( | void * | instance, | |
| Pool & | p | |||
| ) | [inline] |
| void* scfImplementationPooled< Super, Allocator, Locked >::operator new | ( | size_t | n, | |
| Pool & | p | |||
| ) | [inline] |
Member Data Documentation
Pool* scfImplementationPooled< Super, Allocator, Locked >::scfPool [protected] |
The documentation for this class was generated from the following file:
- csutil/pooledscfclass.h
Generated for Crystal Space 1.4.0 by doxygen 1.5.8
