00001 /* 00002 * Copyright (c) 1999, University of Amsterdam, The Netherlands. 00003 * All rights reserved. 00004 * 00005 * Author(s): 00006 * Edo Poll (poll@wins.uva.nl) 00007 * Marc Navarro (mnavarro@wins.uva.nl) 00008 * Dennis Koelma (koelma@wins.uva.nl) 00009 */ 00010 00011 #ifndef HxImgFtorKey_h 00012 #define HxImgFtorKey_h 00013 00014 #include "HxString.h" 00015 #include "HxStringList.h" 00016 #include "HxImgFtorKeyNameTable.h" 00017 00018 00021 class L_HXIMAGEREP HxImgFtorKey 00022 { 00023 public: 00024 00025 HxImgFtorKey(); 00026 HxImgFtorKey(const HxImgFtorKey&); 00027 HxImgFtorKey(HxString className, 00028 HxStringListIter argListBegin, 00029 HxStringListIter argListEnd); 00030 HxImgFtorKey(HxString className); 00031 00032 void addArgument(HxString argName); 00033 void setArguments( 00034 HxStringListIter argListBegin, 00035 HxStringListIter argListEnd); 00036 00037 HxString getArgument(int) const; 00038 HxString getClassName() const; 00039 00040 HxString toString() const; 00041 int compare(const HxImgFtorKey&) const; 00042 STD_OSTREAM& put(STD_OSTREAM&) const; 00043 00044 private: 00045 typedef unsigned short uShort; 00046 00047 enum {maxKeySize = 8}; 00048 uShort _key[maxKeySize]; 00049 static HxImgFtorKeyNameTable& nameTable(); 00050 00051 }; 00052 00053 inline STD_OSTREAM& 00054 operator<<(STD_OSTREAM& os, const HxImgFtorKey& key) 00055 { 00056 return key.put(os); 00057 } 00058 00059 inline bool 00060 operator<(const HxImgFtorKey& x, const HxImgFtorKey& y) 00061 { 00062 return x.compare(y) < 0; 00063 } 00064 00065 inline bool 00066 operator==(const HxImgFtorKey& x, const HxImgFtorKey& y) 00067 { 00068 return x.compare(y) == 0; 00069 } 00070 00071 inline HxImgFtorKeyNameTable& 00072 HxImgFtorKey::nameTable() 00073 { 00074 return HxImgFtorKeyNameTable::instance(); 00075 } 00076 00077 00078 #endif