17 #ifndef MITKGENERICLOOKUPTABLE_H_HEADER_INCLUDED_C1061CEE
18 #define MITKGENERICLOOKUPTABLE_H_HEADER_INCLUDED_C1061CEE
25 #include <itkDataObject.h>
70 throw std::range_error(
"id does not exist in the lookup table");
102 #define mitkSpecializeGenericLookupTable(LookupTableName, Type) \
104 class MITKCORE_EXPORT LookupTableName : public GenericLookupTable<Type> \
108 typedef LookupTableName Self; \
109 typedef GenericLookupTable<Type> Superclass; \
110 virtual const char *GetNameOfClass() const { return #LookupTableName; } \
111 LookupTableName() {} \
112 virtual Superclass &operator=(const Superclass &other) { return Superclass::operator=(other); } \
113 virtual ~LookupTableName() {} \
116 MITKCORE_EXPORT std::ostream &operator<<(std::ostream &stream, const LookupTableName & );
123 #define mitkSpecializeGenericLookupTableOperator(LookupTableName) \
125 std::ostream &mitk::operator<<(std::ostream &stream, const LookupTableName &l) \
128 typedef LookupTableName::LookupTableType::const_iterator IterType; \
129 IterType e = l.GetLookupTable().end(); \
130 IterType b = l.GetLookupTable().begin(); \
132 for (IterType i = b; i != e; ++i) \
138 stream << i->first << " -> " << i->second; \
140 return stream << "]"; \
virtual const char * GetNameOfClass() const
bool operator==(const Self &lookupTable) const
std::map< IdentifierType, ValueType > LookupTableType
virtual Self & operator=(const Self &other)
void SetTableValue(IdentifierType id, ValueType value)
bool operator!=(const Self &lookupTable) const
DataCollection - Class to facilitate loading/accessing structured data.
ValueType GetTableValue(IdentifierType id) const
Template class for generating lookup-tables.
unsigned int IdentifierType
bool ValueExists(IdentifierType id) const
LookupTableType m_LookupTable
virtual ~GenericLookupTable()
const LookupTableType & GetLookupTable() const