BazisLib::ObjectManager Namespace Reference

Contains classes that implement the referencing counting within the service/client model. More...


Classes

class  EmptyClass
 Used as a template argument to derive unmanaged classes. More...
class  ManagedObjectBase
 Represents a managed object. More...
class  ServiceObject
 Represents a service (an object that may have clients). More...
class  IntermediateServiceObject
 Represents a simple intermediate service. More...
class  ConstManagedPointer
 Represents a read-only managed pointer for function parameters. Should only be used for creating references/pointers. More...
class  ParentServiceReference
 Represents a managed pointer field. More...
class  ManagedPointer
 Represents a managed pointer to an object. More...

Functions

template<class _DestType , class _SourceType >
static ManagedPointer< _DestType > managed_cast (const ConstManagedPointer< _SourceType > &ptr)
 Provides type casting for managed pointers.


Detailed Description

Contains classes that implement the referencing counting within the service/client model.

Attention:
Before implementing anything using ObjectManager, see the AUTO_THIS macro reference The object manager differs from most of garbage collectors that provide automatic object deletion when such object is no longer used. The main idea of the object manager is to automate reference counting and to eliminate the need for a separate 'service thread'. An object should be deleted synchronously and instantly when it is no longer used. This requirement introduces several limiting conditions on the object structure. A detailed explanation of Object Manager concepts and use examples can be found in this article.


Function Documentation

template<class _DestType , class _SourceType >
static ManagedPointer<_DestType> BazisLib::ObjectManager::managed_cast ( const ConstManagedPointer< _SourceType > &  ptr  )  [inline, static]

Provides type casting for managed pointers.

Use the managed_cast template function to cast from one managed pointer type to another. Example:

class A
{
	...
};

class B : public A
{
	...
};

...
{
	ManagedPointer ptr = new A();
	ManagedPointer ptr2 = managed_cast<B>(ptr);
}

Here is the call graph for this function:

SourceForge.net Logo