Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
CIccMpeCreator Class Reference

Class: CIccMpeCreator. More...

#include <IccMpeFactory.h>

+ Collaboration diagram for CIccMpeCreator:

Public Member Functions

 ~CIccMpeCreator ()
 

Static Public Member Functions

static CIccMultiProcessElementCreateElement (icElemTypeSignature elemTypeSig)
 Function: CreateElement(elemTypeSig) Create a element of type elemTypeSig.
 
static bool GetElementSigName (std::string &elemName, icElemTypeSignature elemTypeSig)
 Function: GetElementSigName(elemTypeSig) Get display name of elemTypeSig.
 
static IIccMpeFactoryPopFactory ()
 Function: PopFactory() Remove the top IIccMpeFactory from the stack of element factories tracked by the system.
 
static void PushFactory (IIccMpeFactory *pFactory)
 Function: PushFactory(pFactory) Add an IIccMpeFactory to the stack of element factories tracked by the system.
 

Private Member Functions

 CIccMpeCreator ()
 Only GetInstance() can create the singleton.
 
CIccMultiProcessElementDoCreateElement (icElemTypeSignature elemTypeSig)
 
bool DoGetElementSigName (std::string &elemName, icElemTypeSignature elemTypeSig)
 
IIccMpeFactoryDoPopFactory (bool bAll=false)
 
void DoPushFactory (IIccMpeFactory *pFactory)
 

Static Private Member Functions

static CIccMpeCreatorGetInstance ()
 Function: GetInstance() Private static function to access singleton CiccElementCreator Object.
 

Private Attributes

CIccMpeFactoryList factoryStack
 

Static Private Attributes

static CIccMpeCreatorPtr theElementCreator
 

Detailed Description

Class: CIccMpeCreator.

Purpose: CIccMpeCreator uses a singleton pattern to provide dynamically upgradeable CIccProcessElement derived object creation based on element signature.

Definition at line 196 of file IccMpeFactory.h.

Constructor & Destructor Documentation

◆ ~CIccMpeCreator()

CIccMpeCreator::~CIccMpeCreator ( )

Definition at line 227 of file IccMpeFactory.cpp.

228{
229 IIccMpeFactory *pFactory = DoPopFactory(true);
230
231 while (pFactory) {
232 delete pFactory;
233 pFactory = DoPopFactory(true);
234 }
235}
IIccMpeFactory * DoPopFactory(bool bAll=false)
Class: IIccMpeFactory.

◆ CIccMpeCreator()

CIccMpeCreator::CIccMpeCreator ( )
inlineprivate

Only GetInstance() can create the singleton.

Definition at line 267 of file IccMpeFactory.h.

267{ }

Member Function Documentation

◆ CreateElement()

static CIccMultiProcessElement * CIccMpeCreator::CreateElement ( icElemTypeSignature elemTypeSig)
inlinestatic

Function: CreateElement(elemTypeSig) Create a element of type elemTypeSig.

Parameter(s): elemTypeSig = signature of the ICC element type for the element to be created

Returns a new CIccProcessElement object of the given signature type. Each factory in the factoryStack is used until a factory supports the signature type.

Definition at line 213 of file IccMpeFactory.h.

214 { return CIccMpeCreator::GetInstance()->DoCreateElement(elemTypeSig); }
CIccMultiProcessElement * DoCreateElement(icElemTypeSignature elemTypeSig)
static CIccMpeCreator * GetInstance()
Function: GetInstance() Private static function to access singleton CiccElementCreator Object.

References DoCreateElement(), and GetInstance().

Referenced by CIccMultiProcessElement::Create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoCreateElement()

CIccMultiProcessElement * CIccMpeCreator::DoCreateElement ( icElemTypeSignature elemTypeSig)
private

Definition at line 248 of file IccMpeFactory.cpp.

249{
250 CIccMpeFactoryList::iterator i;
251 CIccMultiProcessElement *rv = NULL;
252
253 for (i=factoryStack.begin(); i!=factoryStack.end(); i++) {
254 rv = (*i)->CreateElement(elemTypeSig);
255 if (rv)
256 break;
257 }
258 return rv;
259}
CIccMpeFactoryList factoryStack
Class: CIccMultiProcessElement.
Definition IccTagMPE.h:146

Referenced by CreateElement().

+ Here is the caller graph for this function:

◆ DoGetElementSigName()

bool CIccMpeCreator::DoGetElementSigName ( std::string & elemName,
icElemTypeSignature elemTypeSig )
private

Definition at line 261 of file IccMpeFactory.cpp.

262{
263 CIccMpeFactoryList::iterator i;
264
265 for (i=factoryStack.begin(); i!=factoryStack.end(); i++) {
266 if ((*i)->GetElementSigName(elemName, elemTypeSig))
267 return true;
268 }
269
270 return false;
271}

Referenced by GetElementSigName().

+ Here is the caller graph for this function:

◆ DoPopFactory()

IIccMpeFactory * CIccMpeCreator::DoPopFactory ( bool bAll = false)
private

Definition at line 278 of file IccMpeFactory.cpp.

279{
280 if (factoryStack.size()>0) {
281 CIccMpeFactoryList::iterator i=factoryStack.begin();
282 IIccMpeFactory* rv = (*i);
283 factoryStack.pop_front();
284 return rv;
285 }
286 return NULL;
287}

Referenced by PopFactory().

+ Here is the caller graph for this function:

◆ DoPushFactory()

void CIccMpeCreator::DoPushFactory ( IIccMpeFactory * pFactory)
private

Definition at line 273 of file IccMpeFactory.cpp.

274{
275 factoryStack.push_front(pFactory);
276}

◆ GetElementSigName()

static bool CIccMpeCreator::GetElementSigName ( std::string & elemName,
icElemTypeSignature elemTypeSig )
inlinestatic

Function: GetElementSigName(elemTypeSig) Get display name of elemTypeSig.

Parameter(s): elemName = string to put element name into elemTypeSig = signature of the ICC element type to get a name for

Returns true if element type is recognized by any factory, false if all factories do not create elemTypeSig elements. If element type is not recognized by any factories a suitable display name will be placed in elemName.

Definition at line 229 of file IccMpeFactory.h.

230 { return CIccMpeCreator::GetInstance()->DoGetElementSigName(elemName, elemTypeSig); }
bool DoGetElementSigName(std::string &elemName, icElemTypeSignature elemTypeSig)

References DoGetElementSigName(), and GetInstance().

Referenced by CIccInfo::GetElementTypeSigName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetInstance()

CIccMpeCreator * CIccMpeCreator::GetInstance ( )
staticprivate

Function: GetInstance() Private static function to access singleton CiccElementCreator Object.

Parameter(s): None

Returns the singleton CIccMpeCreator object. It will allocate a new one and push a single CIccSpecElement Factory object onto the factory stack if the singleton has not been intialized.

Definition at line 237 of file IccMpeFactory.cpp.

238{
239 if (!theElementCreator.get()) {
241
242 theElementCreator->DoPushFactory(new CIccBasicMpeFactory);
243 }
244
245 return theElementCreator.get();
246}
std::unique_ptr< CIccMpeCreator > CIccMpeCreatorPtr
Class: CIccBasicMpeFactory.
Class: CIccMpeCreator.
static CIccMpeCreatorPtr theElementCreator

Referenced by CreateElement(), GetElementSigName(), PopFactory(), and PushFactory().

+ Here is the caller graph for this function:

◆ PopFactory()

static IIccMpeFactory * CIccMpeCreator::PopFactory ( )
inlinestatic

Function: PopFactory() Remove the top IIccMpeFactory from the stack of element factories tracked by the system.

Parameter(s): None

Returns the top IIccMpeFactory from the stack of element factories tracked by the system. The returned element factory is no longer owned by the system and needs to be deleted to avoid memory leaks.

Note: The initial CIccBasicElemFactory cannot be popped off the stack.

Definition at line 262 of file IccMpeFactory.h.

References DoPopFactory(), and GetInstance().

+ Here is the call graph for this function:

◆ PushFactory()

static void CIccMpeCreator::PushFactory ( IIccMpeFactory * pFactory)
inlinestatic

Function: PushFactory(pFactory) Add an IIccMpeFactory to the stack of element factories tracked by the system.

Parameter(s): pFactory = pointer to an IIccMpeFactory object to add to the system. The pFactory must be created with new, and will be owned CIccMpeCreator until popped off the stack using PopFactory(). Any factories not popped off will be taken care of properly on application shutdown.

Definition at line 245 of file IccMpeFactory.h.

246 { CIccMpeCreator::GetInstance()->CIccMpeCreator::DoPushFactory(pFactory); }

References GetInstance().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ factoryStack

CIccMpeFactoryList CIccMpeCreator::factoryStack
private

Definition at line 289 of file IccMpeFactory.h.

◆ theElementCreator

CIccMpeCreatorPtr CIccMpeCreator::theElementCreator
staticprivate

Definition at line 287 of file IccMpeFactory.h.


The documentation for this class was generated from the following files: