IccMAX 2.1.27
Color Profile Tools
Loading...
Searching...
No Matches
CIccMpeCreator Class Reference

#include <IccMpeFactory.h>

Public Member Functions

 ~CIccMpeCreator ()
 

Static Public Member Functions

static CIccMultiProcessElementCreateElement (icElemTypeSignature elemTypeSig)
 
static bool GetElementSigName (std::string &elemName, icElemTypeSignature elemTypeSig)
 
static IIccMpeFactoryPopFactory ()
 
static void PushFactory (IIccMpeFactory *pFactory)
 

Private Member Functions

 CIccMpeCreator ()
 
CIccMultiProcessElementDoCreateElement (icElemTypeSignature elemTypeSig)
 
bool DoGetElementSigName (std::string &elemName, icElemTypeSignature elemTypeSig)
 
IIccMpeFactoryDoPopFactory (bool bAll=false)
 
void DoPushFactory (IIccMpeFactory *pFactory)
 

Static Private Member Functions

static CIccMpeCreatorGetInstance ()
 

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.

Constructor & Destructor Documentation

◆ ~CIccMpeCreator()

CIccMpeCreator::~CIccMpeCreator ( )
228{
229 IIccMpeFactory *pFactory = DoPopFactory(true);
230
231 while (pFactory) {
232 delete pFactory;
233 pFactory = DoPopFactory(true);
234 }
235}
Definition IccMpeFactory.h:105
IIccMpeFactory * DoPopFactory(bool bAll=false)
Definition IccMpeFactory.cpp:278

References DoPopFactory().

+ Here is the call graph for this function:

◆ CIccMpeCreator()

CIccMpeCreator::CIccMpeCreator ( )
inlineprivate

Only GetInstance() can create the singleton

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.

214 { return CIccMpeCreator::GetInstance()->DoCreateElement(elemTypeSig); }
CIccMultiProcessElement * DoCreateElement(icElemTypeSignature elemTypeSig)
Definition IccMpeFactory.cpp:248
static CIccMpeCreator * GetInstance()
Definition IccMpeFactory.cpp:237

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
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}
Definition IccTagMPE.h:146
CIccMpeFactoryList factoryStack
Definition IccMpeFactory.h:289

References IIccMpeFactory::CreateElement(), and factoryStack.

Referenced by CreateElement().

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

◆ DoGetElementSigName()

bool CIccMpeCreator::DoGetElementSigName ( std::string &  elemName,
icElemTypeSignature  elemTypeSig 
)
private
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}

References factoryStack, and IIccMpeFactory::GetElementSigName().

Referenced by GetElementSigName().

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

◆ DoPopFactory()

IIccMpeFactory * CIccMpeCreator::DoPopFactory ( bool  bAll = false)
private
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}

References factoryStack.

Referenced by ~CIccMpeCreator(), and PopFactory().

+ Here is the caller graph for this function:

◆ DoPushFactory()

void CIccMpeCreator::DoPushFactory ( IIccMpeFactory pFactory)
private
274{
275 factoryStack.push_front(pFactory);
276}

References factoryStack.

Referenced by GetInstance(), and PushFactory().

+ Here is the caller graph for this function:

◆ 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.

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

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.

238{
239 if (!theElementCreator.get()) {
241
242 theElementCreator->DoPushFactory(new CIccBasicMpeFactory);
243 }
244
245 return theElementCreator.get();
246}
std::unique_ptr< CIccMpeCreator > CIccMpeCreatorPtr
Definition IccMpeFactory.h:184
Definition IccMpeFactory.h:154
Definition IccMpeFactory.h:197
static CIccMpeCreatorPtr theElementCreator
Definition IccMpeFactory.h:287

References DoPushFactory(), and theElementCreator.

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

+ Here is the call graph for this function:
+ 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.

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.

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

References DoPushFactory(), and GetInstance().

Referenced by main().

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

Field Documentation

◆ factoryStack

CIccMpeFactoryList CIccMpeCreator::factoryStack
private

◆ theElementCreator

CIccMpeCreatorPtr CIccMpeCreator::theElementCreator
staticprivate

Referenced by GetInstance().


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