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

#include <IccArrayFactory.h>

Public Member Functions

 ~CIccArrayCreator ()
 

Static Public Member Functions

static IIccArrayCreateArray (icArraySignature arrayTypeSig, CIccTagArray *pTagArray=NULL)
 
static icArraySignature GetArraySig (const icChar *arrayName)
 
static bool GetArraySigName (std::string &arrayName, icArraySignature arrayTypeSig, bool bFillUnknown=true)
 
static IIccArrayFactoryPopFactory ()
 
static void PushFactory (IIccArrayFactory *pFactory)
 

Private Member Functions

 CIccArrayCreator ()
 
IIccArrayDoCreateArray (icArraySignature arrayTypeSig, CIccTagArray *pArray)
 
icArraySignature DoGetArraySig (const icChar *arrayName)
 
bool DoGetArraySigName (std::string &arrayName, icArraySignature arrayTypeSig, bool bFillUnknown=true)
 
IIccArrayFactoryDoPopFactory (bool bAll=false)
 
void DoPushFactory (IIccArrayFactory *pFactory)
 

Static Private Member Functions

static CIccArrayCreatorGetInstance ()
 

Private Attributes

CIccArrayFactoryList factoryStack
 

Static Private Attributes

static CIccArrayCreatorPtr theArrayCreator
 

Detailed Description

Class: CIccArrayCreator

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

Constructor & Destructor Documentation

◆ ~CIccArrayCreator()

CIccArrayCreator::~CIccArrayCreator ( )
146{
147 IIccArrayFactory *pFactory = DoPopFactory(true);
148
149 while (pFactory) {
150 delete pFactory;
151 pFactory = DoPopFactory(true);
152 }
153}
Definition IccArrayFactory.h:102
IIccArrayFactory * DoPopFactory(bool bAll=false)
Definition IccArrayFactory.cpp:210

References DoPopFactory().

+ Here is the call graph for this function:

◆ CIccArrayCreator()

CIccArrayCreator::CIccArrayCreator ( )
inlineprivate

Only GetInstance() can create the singleton

306{ }

Member Function Documentation

◆ CreateArray()

static IIccArray * CIccArrayCreator::CreateArray ( icArraySignature  arrayTypeSig,
CIccTagArray pTagArray = NULL 
)
inlinestatic

Function: CreateArray(structTypeSig) Create a element of type structTypeSig.

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

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

238 { return CIccArrayCreator::GetInstance()->DoCreateArray(arrayTypeSig, pTagArray); }
IIccArray * DoCreateArray(icArraySignature arrayTypeSig, CIccTagArray *pArray)
Definition IccArrayFactory.cpp:166
static CIccArrayCreator * GetInstance()
Definition IccArrayFactory.cpp:155

References DoCreateArray(), and GetInstance().

Referenced by CIccTagArray::GetArrayHandler(), and CIccTagArray::SetTagArrayType().

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

◆ DoCreateArray()

IIccArray * CIccArrayCreator::DoCreateArray ( icArraySignature  arrayTypeSig,
CIccTagArray pArray 
)
private
167{
168 CIccArrayFactoryList::iterator i;
169 IIccArray *rv = NULL;
170
171 for (i=factoryStack.begin(); i!=factoryStack.end(); i++) {
172 rv = (*i)->CreateArray(arrayTypeSig, pTagArray);
173 if (rv)
174 break;
175 }
176 return rv;
177}
CIccArrayFactoryList factoryStack
Definition IccArrayFactory.h:329
Definition IccTagComposite.h:130

References IIccArrayFactory::CreateArray(), and factoryStack.

Referenced by CreateArray().

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

◆ DoGetArraySig()

icArraySignature CIccArrayCreator::DoGetArraySig ( const icChar arrayName)
private
192{
193 CIccArrayFactoryList::iterator i;
194
195 for (i = factoryStack.begin(); i != factoryStack.end(); i++) {
196 icArraySignature rv = (*i)->GetArraySig(structName);
197 if (rv)
198 return rv;
199 }
200
201 return (icArraySignature)0;
202}
icArraySignature
Definition icProfileHeader.h:616

References factoryStack, and IIccArrayFactory::GetArraySig().

Referenced by GetArraySig().

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

◆ DoGetArraySigName()

bool CIccArrayCreator::DoGetArraySigName ( std::string &  arrayName,
icArraySignature  arrayTypeSig,
bool  bFillUnknown = true 
)
private
180{
181 CIccArrayFactoryList::iterator i;
182
183 for (i=factoryStack.begin(); i!=factoryStack.end(); i++) {
184 if ((*i)->GetArraySigName(arrayName, arrayTypeSig, bFillUnknown))
185 return true;
186 }
187
188 return false;
189}

References factoryStack, and IIccArrayFactory::GetArraySigName().

Referenced by GetArraySigName().

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

◆ DoPopFactory()

IIccArrayFactory * CIccArrayCreator::DoPopFactory ( bool  bAll = false)
private
211{
212 if (factoryStack.size()>0) {
213 CIccArrayFactoryList::iterator i=factoryStack.begin();
214 IIccArrayFactory* rv = (*i);
215 factoryStack.pop_front();
216 return rv;
217 }
218 return NULL;
219}

References factoryStack.

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

+ Here is the caller graph for this function:

◆ DoPushFactory()

void CIccArrayCreator::DoPushFactory ( IIccArrayFactory pFactory)
private
206{
207 factoryStack.push_front(pFactory);
208}

References factoryStack.

Referenced by GetInstance(), and PushFactory().

+ Here is the caller graph for this function:

◆ GetArraySig()

static icArraySignature CIccArrayCreator::GetArraySig ( const icChar arrayName)
inlinestatic

Function: GetArraySig(arrayName) Get signature associate with display name arrayName handler

Parameter(s): arrayName = string to find signature for

Returns array signuture if arrayName arrays are recognized by any factory, 0 if all factories do not create arrayName arrays.

269 { return CIccArrayCreator::GetInstance()->DoGetArraySig(arrayName); }
icArraySignature DoGetArraySig(const icChar *arrayName)
Definition IccArrayFactory.cpp:191

References DoGetArraySig(), and GetInstance().

Referenced by CIccTagXmlArray::ParseXml().

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

◆ GetArraySigName()

static bool CIccArrayCreator::GetArraySigName ( std::string &  arrayName,
icArraySignature  arrayTypeSig,
bool  bFillUnknown = true 
)
inlinestatic

Function: GetArraySigName(structTypeSig) Get display name of structTypeSig.

Parameter(s): arrayName = string to put struct name into arrayTypeSig = signature of the ICC struct type to get a name for bFillUnknown = flag to fill in arrayName if arryTypeSig is unknown

Returns true if struct type is recognized by any factory, false if all factories do not create arrayTypeSig arrays. If arrayTypeSig is not recognized by any factories a suitable display name will be placed in arrayName if bFindUnkown is true (otherwise arrayName will be empty).

255 { return CIccArrayCreator::GetInstance()->DoGetArraySigName(arrayName, arrayTypeSig, bFillUnknown); }
bool DoGetArraySigName(std::string &arrayName, icArraySignature arrayTypeSig, bool bFillUnknown=true)
Definition IccArrayFactory.cpp:179

References DoGetArraySigName(), and GetInstance().

Referenced by CIccTagArray::Describe(), CIccInfo::GetArraySigName(), and CIccTagXmlArray::ToXml().

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

◆ GetInstance()

CIccArrayCreator * CIccArrayCreator::GetInstance ( )
staticprivate

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

Parameter(s): None

Returns the singleton CIccArrayCreator object. It will allocate a new one and push a single CIccSpecArray Factory object onto the factory stack if the singleton has not been initialized.

156{
157 if (!theArrayCreator.get()) {
159
160 theArrayCreator->DoPushFactory(new CIccBasicArrayFactory);
161 }
162
163 return theArrayCreator.get();
164}
std::unique_ptr< CIccArrayCreator > CIccArrayCreatorPtr
Definition IccArrayFactory.h:208
Definition IccArrayFactory.h:164
Definition IccArrayFactory.h:221
static CIccArrayCreatorPtr theArrayCreator
Definition IccArrayFactory.h:327

References DoPushFactory(), and theArrayCreator.

Referenced by CreateArray(), GetArraySig(), GetArraySigName(), PopFactory(), and PushFactory().

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

◆ PopFactory()

static IIccArrayFactory * CIccArrayCreator::PopFactory ( )
inlinestatic

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

Parameter(s): None

Returns the top IIccArrayFactory 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 CIccArrayCreator::PushFactory ( IIccArrayFactory pFactory)
inlinestatic

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

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

285 { CIccArrayCreator::GetInstance()->CIccArrayCreator::DoPushFactory(pFactory); }

References DoPushFactory(), and GetInstance().

+ Here is the call graph for this function:

Field Documentation

◆ factoryStack

CIccArrayFactoryList CIccArrayCreator::factoryStack
private

◆ theArrayCreator

std::unique_ptr< CIccArrayCreator > CIccArrayCreator::theArrayCreator
staticprivate

Referenced by GetInstance().


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