13 #ifndef MITKGENERICLOOKUPTABLE_H_HEADER_INCLUDED_C1061CEE 14 #define MITKGENERICLOOKUPTABLE_H_HEADER_INCLUDED_C1061CEE 21 #include <itkDataObject.h> 66 throw std::range_error(
"id does not exist in the lookup table");
98 #define mitkSpecializeGenericLookupTable(LookupTableName, Type) \ 100 class MITKCORE_EXPORT LookupTableName : public GenericLookupTable<Type> \ 104 typedef LookupTableName Self; \ 105 typedef GenericLookupTable<Type> Superclass; \ 106 virtual const char *GetNameOfClass() const { return #LookupTableName; } \ 107 LookupTableName() {} \ 108 virtual Superclass &operator=(const Superclass &other) { return Superclass::operator=(other); } \ 109 virtual ~LookupTableName() {} \ 112 MITKCORE_EXPORT std::ostream &operator<<(std::ostream &stream, const LookupTableName & ); 119 #define mitkSpecializeGenericLookupTableOperator(LookupTableName) \ 121 std::ostream &mitk::operator<<(std::ostream &stream, const LookupTableName &l) \ 124 typedef LookupTableName::LookupTableType::const_iterator IterType; \ 125 IterType e = l.GetLookupTable().end(); \ 126 IterType b = l.GetLookupTable().begin(); \ 128 for (IterType i = b; i != e; ++i) \ 134 stream << i->first << " -> " << i->second; \ 136 return stream << "]"; \ 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.
Template class for generating lookup-tables.
virtual const char * GetNameOfClass() const
const LookupTableType & GetLookupTable() const
ValueType GetTableValue(IdentifierType id) const
unsigned int IdentifierType
LookupTableType m_LookupTable
bool ValueExists(IdentifierType id) const
virtual ~GenericLookupTable()
bool operator==(const Self &lookupTable) const