yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Minisat::IntMap< K, V, MkIndex > Class Template Reference

#include <IntMap.h>

+ Collaboration diagram for Minisat::IntMap< K, V, MkIndex >:

Public Member Functions

 IntMap (MkIndex _index=MkIndex())
 
bool has (K k) const
 
const V & operator[] (K k) const
 
V & operator[] (K k)
 
const V * begin () const
 
const V * end () const
 
V * begin ()
 
V * end ()
 
void reserve (K key, V pad)
 
void reserve (K key)
 
void insert (K key, V val, V pad)
 
void insert (K key, V val)
 
void clear (bool dispose=false)
 
void moveTo (IntMap &to)
 
void copyTo (IntMap &to) const
 

Private Attributes

vec< V > map
 
MkIndex index
 

Detailed Description

template<class K, class V, class MkIndex = MkIndexDefault<K>>
class Minisat::IntMap< K, V, MkIndex >

Definition at line 31 of file IntMap.h.

Constructor & Destructor Documentation

template<class K, class V, class MkIndex = MkIndexDefault<K>>
Minisat::IntMap< K, V, MkIndex >::IntMap ( MkIndex  _index = MkIndex())
inlineexplicit

Definition at line 35 of file IntMap.h.

35 : index(_index){}
MkIndex index
Definition: IntMap.h:33

Member Function Documentation

template<class K, class V, class MkIndex = MkIndexDefault<K>>
const V* Minisat::IntMap< K, V, MkIndex >::begin ( ) const
inline

Definition at line 42 of file IntMap.h.

42 { return &map[0]; }
vec< V > map
Definition: IntMap.h:32
template<class K, class V, class MkIndex = MkIndexDefault<K>>
V* Minisat::IntMap< K, V, MkIndex >::begin ( )
inline

Definition at line 44 of file IntMap.h.

44 { return &map[0]; }
vec< V > map
Definition: IntMap.h:32
template<class K, class V, class MkIndex = MkIndexDefault<K>>
void Minisat::IntMap< K, V, MkIndex >::clear ( bool  dispose = false)
inline

Definition at line 52 of file IntMap.h.

52 { map.clear(dispose); }
vec< V > map
Definition: IntMap.h:32
void clear(bool dealloc=false)
Definition: Vec.h:125

+ Here is the caller graph for this function:

template<class K, class V, class MkIndex = MkIndexDefault<K>>
void Minisat::IntMap< K, V, MkIndex >::copyTo ( IntMap< K, V, MkIndex > &  to) const
inline

Definition at line 54 of file IntMap.h.

54 { map.copyTo(to.map); to.index = index; }
vec< V > map
Definition: IntMap.h:32
void copyTo(vec< T > &copy) const
Definition: Vec.h:92
MkIndex index
Definition: IntMap.h:33
template<class K, class V, class MkIndex = MkIndexDefault<K>>
const V* Minisat::IntMap< K, V, MkIndex >::end ( ) const
inline

Definition at line 43 of file IntMap.h.

43 { return &map[map.size()]; }
vec< V > map
Definition: IntMap.h:32
Size size(void) const
Definition: Vec.h:64
template<class K, class V, class MkIndex = MkIndexDefault<K>>
V* Minisat::IntMap< K, V, MkIndex >::end ( )
inline

Definition at line 45 of file IntMap.h.

45 { return &map[map.size()]; }
vec< V > map
Definition: IntMap.h:32
Size size(void) const
Definition: Vec.h:64
template<class K, class V, class MkIndex = MkIndexDefault<K>>
bool Minisat::IntMap< K, V, MkIndex >::has ( k) const
inline

Definition at line 37 of file IntMap.h.

37 { return index(k) < map.size(); }
vec< V > map
Definition: IntMap.h:32
Size size(void) const
Definition: Vec.h:64
MkIndex index
Definition: IntMap.h:33

+ Here is the caller graph for this function:

template<class K, class V, class MkIndex = MkIndexDefault<K>>
void Minisat::IntMap< K, V, MkIndex >::insert ( key,
val,
pad 
)
inline

Definition at line 49 of file IntMap.h.

49 { reserve(key, pad); operator[](key) = val; }
void reserve(K key, V pad)
Definition: IntMap.h:47
const V & operator[](K k) const
Definition: IntMap.h:39

+ Here is the caller graph for this function:

template<class K, class V, class MkIndex = MkIndexDefault<K>>
void Minisat::IntMap< K, V, MkIndex >::insert ( key,
val 
)
inline

Definition at line 50 of file IntMap.h.

50 { reserve(key); operator[](key) = val; }
void reserve(K key, V pad)
Definition: IntMap.h:47
const V & operator[](K k) const
Definition: IntMap.h:39
template<class K, class V, class MkIndex = MkIndexDefault<K>>
void Minisat::IntMap< K, V, MkIndex >::moveTo ( IntMap< K, V, MkIndex > &  to)
inline

Definition at line 53 of file IntMap.h.

53 { map.moveTo(to.map); to.index = index; }
vec< V > map
Definition: IntMap.h:32
void moveTo(vec< T > &dest)
Definition: Vec.h:93
MkIndex index
Definition: IntMap.h:33
template<class K, class V, class MkIndex = MkIndexDefault<K>>
const V& Minisat::IntMap< K, V, MkIndex >::operator[] ( k) const
inline

Definition at line 39 of file IntMap.h.

39 { assert(has(k)); return map[index(k)]; }
vec< V > map
Definition: IntMap.h:32
bool has(K k) const
Definition: IntMap.h:37
MkIndex index
Definition: IntMap.h:33

+ Here is the caller graph for this function:

template<class K, class V, class MkIndex = MkIndexDefault<K>>
V& Minisat::IntMap< K, V, MkIndex >::operator[] ( k)
inline

Definition at line 40 of file IntMap.h.

40 { assert(has(k)); return map[index(k)]; }
vec< V > map
Definition: IntMap.h:32
bool has(K k) const
Definition: IntMap.h:37
MkIndex index
Definition: IntMap.h:33
template<class K, class V, class MkIndex = MkIndexDefault<K>>
void Minisat::IntMap< K, V, MkIndex >::reserve ( key,
pad 
)
inline

Definition at line 47 of file IntMap.h.

47 { map.growTo(index(key)+1, pad); }
vec< V > map
Definition: IntMap.h:32
void growTo(Size size)
Definition: Vec.h:117
MkIndex index
Definition: IntMap.h:33

+ Here is the caller graph for this function:

template<class K, class V, class MkIndex = MkIndexDefault<K>>
void Minisat::IntMap< K, V, MkIndex >::reserve ( key)
inline

Definition at line 48 of file IntMap.h.

48 { map.growTo(index(key)+1); }
vec< V > map
Definition: IntMap.h:32
void growTo(Size size)
Definition: Vec.h:117
MkIndex index
Definition: IntMap.h:33

Field Documentation

template<class K, class V, class MkIndex = MkIndexDefault<K>>
MkIndex Minisat::IntMap< K, V, MkIndex >::index
private

Definition at line 33 of file IntMap.h.

template<class K, class V, class MkIndex = MkIndexDefault<K>>
vec<V> Minisat::IntMap< K, V, MkIndex >::map
private

Definition at line 32 of file IntMap.h.


The documentation for this class was generated from the following file: