commore
1.0.6-SNAPSHOT
|
#include <RefObject.h>
Public Member Functions | |
RefObject () | |
virtual | ~RefObject () |
virtual void | attach () |
virtual void | release () |
virtual void | nested_attach () |
virtual void | nested_release () |
virtual void | interface_release () |
virtual void | Run () |
virtual CriticalSection * | get_cs () |
Static Public Member Functions | |
static AutoRefBase | auto_create () |
static AutoRefBase | auto_create (const AChar *s) |
static AutoRefBase | create () |
static AutoRefBase | create (const AChar *s) |
static AutoRefBase | bind () |
static AutoRefBase | bind (const AChar *s) |
static const AChar * | factory_name () |
Base classe for classes of objects which are meant to be used with AutoRef smart pointers. The RefObject has the responsability to handle its reference counting, via the methods attach and release (a default implementation is provided). When creating a class which inherits from RefObject, a RefFactory class responsible for instantiating this kind of objects must also be created, and instantiated. See RefFactory for more information about its instanciation. Classes which inherits from RefObject should implement the static factory_name method, which returns a factory identifier (usually, the string representation of the class name : "namespece::class"). It must be the same as the factory name returned by its factory (RefFactory::factory_name).
RefObject::RefObject | ( | ) |
Construtor Reference counter is set to 0
|
virtual |
|
virtual |
Manage basic ref counter Attach object to a new reference Inrease reference counter
|
inlinestatic |
Allow automatic creation of object auto_create is overriden by a subclass and call like this : AutoRef pa; should automatically create an A object referenced by pa.
|
inlinestatic |
Allow automaic creation of object with a parameter
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Allow creation of object without calling new operator. If create is overridden in a subclass, it is called like this to work : AutoRef pa; pa.create();
|
inlinestatic |
As create() with a parameter
|
inlinestatic |
Must be define in the subclass, if the RefObject is intended to be instantiated by factories (with the same factory_name).
|
virtual |
Default critical section to protect refenece count Can be overrriden by implementation
The default critical section protect RefObject reference counter
Reimplemented in commore::Processor::HImpl::PImpl, and commore::Action.
|
virtual |
Call when nested_release reach count 0 To be implemented by ref object
Reimplemented in TCPIPListener, TCPIPSender, and SocketClient.
|
virtual |
Manage interface reference counter and basic ref counter. Allow IAutoRef to know when refobjet is not referenced anymore by an other IAutoRef so it can call interface_release()
|
virtual |
|
virtual |
Release object Decrease reference counter If reference counter = 0 the object is deleted
|
inlinevirtual |
Base action usage.