Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxImgFtorTable Class Reference

Table with (HxImgFtorKey, HxImgFunctor*) pairs. More...

#include <HxImgFtorTable.h>

List of all members.

Public Methods

void insert (const HxImgFtorKey &key, HxImgFunctor *f)
 Insert a (key,functor) combination. More...

HxImgFunctorfind (const HxImgFtorKey &key)
 Find functor based on given key. More...

void addImgFtorObserver (HxImgFtorObserver *)
 Add an image functor observer. More...

STD_OSTREAM & put (STD_OSTREAM &) const
 Put on the given stream. More...

 ~HxImgFtorTable ()
 Destructor. More...


Static Public Methods

HxImgFtorTable & instance ()
 Access to this singleton class. More...


Protected Methods

 HxImgFtorTable ()
 HxImgFtorTable (const HxImgFtorTable &)


Detailed Description

Table with (HxImgFtorKey, HxImgFunctor*) pairs.


Constructor & Destructor Documentation

HxImgFtorTable::~HxImgFtorTable  
 

Destructor.

00033 {
00034 #ifdef CD_TRACE
00035     HxEnvironment::instance()->outputStream()
00036         << "HxImgFtorTable::~HxImgFtorTable()" << STD_ENDL;
00037 #endif
00038 }


Member Function Documentation

HxImgFtorTable & HxImgFtorTable::instance   [static]
 

Access to this singleton class.

00046 {
00047     static HxImgFtorTable _instance;
00048     return _instance;
00049 }

void HxImgFtorTable::insert const HxImgFtorKey   key,
HxImgFunctor   f
 

Insert a (key,functor) combination.

00053 {
00054     _map[key] = f;
00055 
00056     static int entryNum = 0;
00057     static HxRegKey* entryKey
00058         = HxRegistry::instance().insertKey("/imagefunctortable/entries");
00059     HxRegKey* classKey
00060         = entryKey->insertKey(key.getClassName());
00061     HxString entryName("entry");
00062     entryName += makeString(entryNum++);
00063     classKey->insertValue(entryName, HxRegData(key.toString()));
00064 
00065     ObserverList::iterator p;
00066     for (p = _observerList.begin(); p != _observerList.end(); p++)
00067         (*p)->inserted(key, *f);
00068 }

HxImgFunctor * HxImgFtorTable::find const HxImgFtorKey   key
 

Find functor based on given key.

00072 {
00073     Map::iterator i;
00074 #ifdef IF_DEBUG
00075     HxEnvironment::instance()->outputStream()
00076         << "Was requested to find " << key << STD_ENDL;
00077     HxEnvironment::instance()->flush();
00078 #endif IF_DEBUG
00079     i = _map.find(key);
00080     if (i == _map.end())
00081         return 0;
00082 #ifdef IF_DEBUG
00083     HxEnvironment::instance()->outputStream()
00084         << "And indeed found" << STD_ENDL << " ==> ";
00085     HxEnvironment::instance()->flush();
00086     ((*i).second)->put(HxEnvironment::instance()->outputStream());
00087     HxEnvironment::instance()->outputStream() << STD_ENDL;
00088     HxEnvironment::instance()->flush();
00089 #endif IF_DEBUG
00090     return (*i).second;
00091 }

void HxImgFtorTable::addImgFtorObserver HxImgFtorObserver   observer
 

Add an image functor observer.

00095 {
00096     _observerList.push_back(observer);
00097 }

STD_OSTREAM & HxImgFtorTable::put STD_OSTREAM &    os const
 

Put on the given stream.

00101 {
00102     Map::const_iterator i;
00103     os << "HxImgFtorTable" << STD_ENDL;
00104     for(i = _map.begin();i != _map.end();i++)
00105     {
00106         os << (*i).first << STD_ENDL;
00107     }
00108     return os;
00109 }


The documentation for this class was generated from the following files:
Generated on Mon Jan 27 15:49:04 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001