sipxmedialib  Version 3.3
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MpResourceFactory Class Reference

MpResourceFactory is used to construct resources by type name. More...

#include <MpResourceFactory.h>

Public Member Functions

 MpResourceFactory ()
 
virtual ~MpResourceFactory ()
 
OsStatus addConstructor (MpResourceConstructor &resourceConstructor)
 Add a constructor for a new resource type. More...
 
OsStatus newResource (const UtlString &resourceType, const UtlString &newResourceName, int maxResourcesToCreate, int &numResourcesCreated, MpResource *resourcesCreated[]) const
 Create a new resource of given type. More...
 
UtlBoolean constructorExists (const UtlString &resourceType)
 

Private Member Functions

 MpResourceFactory (const MpResourceFactory &rMpResourceFactory)
 
MpResourceFactoryoperator= (const MpResourceFactory &rhs)
 

Private Attributes

UtlHashMap mConstructors
 

Detailed Description

MpResourceFactory is used to construct resources by type name.

MpResourceConstructors are added to the MpResourceFactory and registered with a resource type name. Resources are then constructed using the MpResourceFactory.

Constructor & Destructor Documentation

Constructor

~MpResourceFactory ( )
virtual

Destructor

MpResourceFactory ( const MpResourceFactory rMpResourceFactory)
private

Disabled copy constructor

Member Function Documentation

OsStatus addConstructor ( MpResourceConstructor resourceConstructor)

Add a constructor for a new resource type.

OsStatus newResource ( const UtlString &  resourceType,
const UtlString &  newResourceName,
int  maxResourcesToCreate,
int &  numResourcesCreated,
MpResource resourcesCreated[] 
) const

Create a new resource of given type.

Creates one or more resources as defined by the implementation of the named resource constructor (typically of different resource types as opposed to duplicates). Some resources are created in sets as they work together in some way. This interface allows the constructor to create multiple resources and assocate or initialize them together.

Parameters
[in]newResourceName- name to give the new resource, must be unique to the target flowgraph that this resource is to be inserted.
[in]maxResourcesToCreate- the size of the resourcesCreated passed in
[out]numResourcesCreated- the actual number of resource created and contained in the resourcesCreated array
[out]resourcesCreated- array containing the created resources.
UtlBoolean constructorExists ( const UtlString &  resourceType)
MpResourceFactory& operator= ( const MpResourceFactory rhs)
private

Disable assignment operator

Member Data Documentation

UtlHashMap mConstructors
private