18 #ifndef itkEquivalencyTable_h
19 #define itkEquivalencyTable_h
23 #include "itksys/hash_map.hxx"
59 using HashTableType = itksys::hash_map<
unsigned long,
unsigned long,
60 itksys::hash< unsigned long > >;
77 bool Add(
unsigned long a,
unsigned long b);
86 bool AddAndFlatten(
unsigned long a,
unsigned long b);
91 unsigned long Lookup(
const unsigned long a)
const
95 if ( result == m_HashMap.end() ) {
return a; }
96 else {
return ( *result ).second; }
103 unsigned long RecursiveLookup(
const unsigned long a)
const;
109 if ( m_HashMap.find(a) == m_HashMap.end() ) {
return false; }
110 else {
return true; }
116 { m_HashMap.erase(a); }
120 { m_HashMap.clear(); }
124 {
return m_HashMap.empty(); }
127 HashTableType::size_type
Size()
const
128 {
return m_HashMap.size(); }
144 void PrintSelf(std::ostream & os,
Indent indent)
const override;
unsigned long Lookup(const unsigned long a) const
itksys::hash_map< unsigned long, unsigned long, itksys::hash< unsigned long > > HashTableType
void Erase(const unsigned long a)
class ITK_FORWARD_EXPORT DataObject
HashTableType::size_type Size() const
Hash table to manage integral label equivalencies.
HashTableType::value_type ValueType
HashTableType::iterator Iterator
bool IsEntry(const unsigned long a) const
Control indentation during Print() invocation.
HashTableType::const_iterator ConstIterator
Base class for most ITK classes.
Base class for all data objects in ITK.