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

#include <IccTagFactory.h>

Public Member Functions

 ~CIccTagCreator ()
 

Static Public Member Functions

static CIccTagCreateTag (icTagTypeSignature tagTypeSig)
 
static icTagSignature GetTagNameSig (const icChar *szName)
 
static const icCharGetTagSigName (icTagSignature tagTypeSig)
 
static icTagTypeSignature GetTagTypeNameSig (const icChar *szName)
 
static const icCharGetTagTypeSigName (icTagTypeSignature tagTypeSig)
 
static IIccTagFactoryPopFactory ()
 
static void PushFactory (IIccTagFactory *pFactory)
 

Private Member Functions

 CIccTagCreator ()
 
CIccTagDoCreateTag (icTagTypeSignature tagTypeSig)
 
icTagSignature DoGetTagNameSig (const icChar *szName)
 
const icCharDoGetTagSigName (icTagSignature tagSig)
 
icTagTypeSignature DoGetTagTypeNameSig (const icChar *szName)
 
const icCharDoGetTagTypeSigName (icTagTypeSignature tagTypeSig)
 
IIccTagFactoryDoPopFactory (bool bAll=false)
 
void DoPushFactory (IIccTagFactory *pFactory)
 

Static Private Member Functions

static CIccTagCreatorGetInstance ()
 

Private Attributes

CIccTagFactoryList factoryStack
 

Static Private Attributes

static CIccTagCreatorPtr theTagCreator
 

Detailed Description

Class: CIccTagCreator

Purpose: CIccTagCreator uses a singleton pattern to provide dynamically upgradeable CIccTag derived object creation based on tag signature.

Constructor & Destructor Documentation

◆ ~CIccTagCreator()

CIccTagCreator::~CIccTagCreator ( )
530{
531 IIccTagFactory *pFactory = DoPopFactory(true);
532
533 while (pFactory) {
534 delete pFactory;
535 pFactory = DoPopFactory(true);
536 }
537}
Definition IccTagFactory.h:102
IIccTagFactory * DoPopFactory(bool bAll=false)
Definition IccTagFactory.cpp:625

References DoPopFactory().

+ Here is the call graph for this function:

◆ CIccTagCreator()

CIccTagCreator::CIccTagCreator ( )
inlineprivate

Only GetInstance() can create the signleton

372{ }

Member Function Documentation

◆ CreateTag()

static CIccTag * CIccTagCreator::CreateTag ( icTagTypeSignature  tagTypeSig)
inlinestatic

Function: CreateTag(tagTypeSig) Create a tag of type tagTypeSig.

Parameter(s): tagTypeSig = signature of the ICC tag type for the tag to be created

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

280 { return CIccTagCreator::GetInstance()->DoCreateTag(tagTypeSig); }
static CIccTagCreator * GetInstance()
Definition IccTagFactory.cpp:539
CIccTag * DoCreateTag(icTagTypeSignature tagTypeSig)
Definition IccTagFactory.cpp:550

References DoCreateTag(), and GetInstance().

Referenced by CIccTag::Create(), and CIccTagArray::Read().

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

◆ DoCreateTag()

CIccTag * CIccTagCreator::DoCreateTag ( icTagTypeSignature  tagTypeSig)
private
551{
552 CIccTagFactoryList::iterator i;
553 CIccTag *rv = NULL;
554
555 for (i=factoryStack.begin(); i!=factoryStack.end(); i++) {
556 rv = (*i)->CreateTag(tagTypeSig);
557 if (rv)
558 break;
559 }
560 return rv;
561}
Definition IccTagBasic.h:108
CIccTagFactoryList factoryStack
Definition IccTagFactory.h:397

References IIccTagFactory::CreateTag(), and factoryStack.

Referenced by CreateTag().

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

◆ DoGetTagNameSig()

icTagSignature CIccTagCreator::DoGetTagNameSig ( const icChar szName)
private
578{
579 CIccTagFactoryList::iterator i;
581
582 for (i = factoryStack.begin(); i != factoryStack.end(); i++) {
583 rv = (*i)->GetTagNameSig(szName);
584 if (rv!=icSigUnknownTag)
585 return rv;
586 }
587
588 return icSigUnknownTag;
589}
#define icSigUnknownTag
Definition icProfileHeader.h:483
icTagSignature
Definition icProfileHeader.h:341

References factoryStack, and IIccTagFactory::GetTagNameSig().

Referenced by GetTagNameSig().

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

◆ DoGetTagSigName()

const icChar * CIccTagCreator::DoGetTagSigName ( icTagSignature  tagSig)
private
564{
565 CIccTagFactoryList::iterator i;
566 const icChar* rv;
567
568 for (i=factoryStack.begin(); i!=factoryStack.end(); i++) {
569 rv = (*i)->GetTagSigName(tagSig);
570 if (rv)
571 return rv;
572 }
573
574 return NULL;
575}
char icChar
Definition IccDefs.h:110

References factoryStack, and IIccTagFactory::GetTagSigName().

Referenced by GetTagSigName().

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

◆ DoGetTagTypeNameSig()

icTagTypeSignature CIccTagCreator::DoGetTagTypeNameSig ( const icChar szName)
private
607{
608 CIccTagFactoryList::iterator i;
610
611 for (i = factoryStack.begin(); i != factoryStack.end(); i++) {
612 rv = (*i)->GetTagTypeNameSig(szName);
613 if (rv!=icSigUnknownType)
614 return rv;
615 }
616
617 return icSigUnknownType;
618}
#define icSigUnknownType
Definition icProfileHeader.h:591
icTagTypeSignature
Definition icProfileHeader.h:526

References factoryStack, and IIccTagFactory::GetTagTypeNameSig().

Referenced by GetTagTypeNameSig().

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

◆ DoGetTagTypeSigName()

const icChar * CIccTagCreator::DoGetTagTypeSigName ( icTagTypeSignature  tagTypeSig)
private
593{
594 CIccTagFactoryList::iterator i;
595 const icChar* rv;
596
597 for (i=factoryStack.begin(); i!=factoryStack.end(); i++) {
598 rv = (*i)->GetTagTypeSigName(tagTypeSig);
599 if (rv)
600 return rv;
601 }
602
603 return NULL;
604}

References factoryStack, and IIccTagFactory::GetTagTypeSigName().

Referenced by GetTagTypeSigName().

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

◆ DoPopFactory()

IIccTagFactory * CIccTagCreator::DoPopFactory ( bool  bAll = false)
private
626{
627// int nNum = (bAll ? 0 : 1);
628
629 if (factoryStack.size()>0) {
630 CIccTagFactoryList::iterator i=factoryStack.begin();
631 IIccTagFactory* rv = (*i);
632 factoryStack.pop_front();
633 return rv;
634 }
635 return NULL;
636}

References factoryStack.

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

+ Here is the caller graph for this function:

◆ DoPushFactory()

void CIccTagCreator::DoPushFactory ( IIccTagFactory pFactory)
private
621{
622 factoryStack.push_front(pFactory);
623}

References factoryStack.

Referenced by GetInstance(), and PushFactory().

+ Here is the caller graph for this function:

◆ GetInstance()

CIccTagCreator * CIccTagCreator::GetInstance ( )
staticprivate

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

Parameter(s): None

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

540{
541 if (!theTagCreator.get()) {
543
544 theTagCreator->DoPushFactory(new CIccSpecTagFactory);
545 }
546
547 return theTagCreator.get();
548}
std::unique_ptr< CIccTagCreator > CIccTagCreatorPtr
Definition IccTagFactory.h:252
Definition IccTagFactory.h:185
Definition IccTagFactory.h:264
static CIccTagCreatorPtr theTagCreator
Definition IccTagFactory.h:395

References DoPushFactory(), and theTagCreator.

Referenced by CreateTag(), GetTagNameSig(), GetTagSigName(), GetTagTypeNameSig(), GetTagTypeSigName(), PopFactory(), and PushFactory().

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

◆ GetTagNameSig()

static icTagSignature CIccTagCreator::GetTagNameSig ( const icChar szName)
inlinestatic

Function: GetTagNameSig(szTagName) Get signature from tag display name.

Parameter(s): szTagName = name of tag

Returns tag signature of tag if tag name is recognized by the factory, icSigUnknownTag if the tag name is not recognized.

307 {
309 }
icTagSignature DoGetTagNameSig(const icChar *szName)
Definition IccTagFactory.cpp:577

References DoGetTagNameSig(), and GetInstance().

Referenced by icGetTagNameSig().

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

◆ GetTagSigName()

static const icChar * CIccTagCreator::GetTagSigName ( icTagSignature  tagTypeSig)
inlinestatic

Function: GetTagSigName(tagSig) Get display name of tagSig.

Parameter(s): tagSig = signature of the ICC tag to get a name for

Returns ptr to string containing name of tag type if it is recognized by any factory, NULL if all factories do not create tagTypeSig tags.

293 { return CIccTagCreator::GetInstance()->DoGetTagSigName(tagTypeSig); }
const icChar * DoGetTagSigName(icTagSignature tagSig)
Definition IccTagFactory.cpp:563

References DoGetTagSigName(), and GetInstance().

Referenced by CIccInfo::GetTagSigName(), and icGetTagSigName().

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

◆ GetTagTypeNameSig()

static icTagTypeSignature CIccTagCreator::GetTagTypeNameSig ( const icChar szName)
inlinestatic

Function: GetTagTypeNameSig(szTypeName) Get signature based on display name of tag type.

Parameter(s): szTypeName = name of the ICC tag type to get a signature for

Returns tag type signature of tag type name if type name is recognized by the factory, icSigUnknownType if the type name is not recognized.

336 {
338 }
icTagTypeSignature DoGetTagTypeNameSig(const icChar *szName)
Definition IccTagFactory.cpp:606

References DoGetTagTypeNameSig(), and GetInstance().

Referenced by icGetTypeNameTagSig().

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

◆ GetTagTypeSigName()

static const icChar * CIccTagCreator::GetTagTypeSigName ( icTagTypeSignature  tagTypeSig)
inlinestatic

Function: GetTagTypeSigName(tagTypeSig) Get display name of tagTypeSig.

Parameter(s): tagTypeSig = signature of the ICC tag type to get a name for

Returns ptr to string containing name of tag type if it is recognized by any factory, NULL if all factories do not create tagTypeSig tags.

323 { return CIccTagCreator::GetInstance()->DoGetTagTypeSigName(tagTypeSig); }
const icChar * DoGetTagTypeSigName(icTagTypeSignature tagTypeSig)
Definition IccTagFactory.cpp:592

References DoGetTagTypeSigName(), and GetInstance().

Referenced by CIccInfo::GetTagTypeSigName(), and icGetTagSigTypeName().

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

◆ PopFactory()

static IIccTagFactory * CIccTagCreator::PopFactory ( )
inlinestatic

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

Parameter(s): None

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

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

References DoPopFactory(), and GetInstance().

+ Here is the call graph for this function:

◆ PushFactory()

static void CIccTagCreator::PushFactory ( IIccTagFactory pFactory)
inlinestatic

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

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

352 { CIccTagCreator::GetInstance()->CIccTagCreator::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

◆ theTagCreator

std::unique_ptr< CIccTagCreator > CIccTagCreator::theTagCreator
staticprivate

Referenced by GetInstance().


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