Main Page   Class Overview   Pixels   Images   Geometry   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 *)
STD_OSTREAM & put (STD_OSTREAM &) const
 ~HxImgFtorTable ()

Static Public Methods

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


Protected Methods

 HxImgFtorTable ()
 HxImgFtorTable (const HxImgFtorTable &)


Detailed Description

Table with (HxImgFtorKey, HxImgFunctor*) pairs.


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 }


The documentation for this class was generated from the following files:
Generated on Tue Jan 8 13:59:30 2002 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001