00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef HxImgFtorTable_h
00012 #define HxImgFtorTable_h
00013
00014 #include "HxString.h"
00015 #include "HxImgFtorKey.h"
00016 #include "HxIoFwd.h"
00017
00018 #include <map>
00019
00020 class HxImgFunctor;
00021 class HxImgFtorObserver;
00022
00023
00026 class L_HXIMAGEREP HxImgFtorTable
00027 {
00028 public:
00029
00031 static HxImgFtorTable& instance();
00032
00034 void insert(const HxImgFtorKey& key, HxImgFunctor* f);
00035
00037 HxImgFunctor* find(const HxImgFtorKey& key);
00038
00039 void addImgFtorObserver(HxImgFtorObserver*);
00040
00041 STD_OSTREAM& put(STD_OSTREAM&) const;
00042
00043 ~HxImgFtorTable();
00044
00045 protected:
00046 HxImgFtorTable();
00047 HxImgFtorTable(const HxImgFtorTable&);
00048
00049 private:
00050 typedef std::map<HxImgFtorKey,
00051 HxImgFunctor*, std::less<HxImgFtorKey> > Map;
00052 typedef std::list<HxImgFtorObserver*> ObserverList;
00053
00054 #pragma warning (disable : 4251)
00055 Map _map;
00056 ObserverList _observerList;
00057 #pragma warning (default : 4251)
00058 };
00059
00060 inline STD_OSTREAM&
00061 operator << (STD_OSTREAM& os,const HxImgFtorTable& t)
00062 {
00063 return t.put(os);
00064 }
00065
00066
00067 #endif