Predator  [unstable] git snapshot
Public Types | Public Member Functions | Private Types | Private Attributes
IdMapper< TId, MIN, MAX > Class Template Reference

#include <id_mapper.hh>

Inheritance diagram for IdMapper< TId, MIN, MAX >:
Inheritance graph
[legend]

Public Types

enum  ENotFoundAction {
  NFA_TRAP_TO_DEBUGGER,
  NFA_RETURN_NOTHING,
  NFA_RETURN_IDENTITY
}
 do not change the order, composite() relies on it More...
typedef std::vector< TId > TVector
typedef TSearch::const_iterator const_iterator
 STL iterator, always D_LEFT_TO_RIGHT.
typedef TSearch::const_reference const_reference
 needed for BOOST_FOREACH

Public Member Functions

 IdMapper ()
 IdMapper (const ENotFoundAction nfa)
void setNotFoundAction (const ENotFoundAction nfa)
void clear ()
void flip ()
bool empty () const
unsigned size () const
bool isTrivial () const
bool insert (TId left, TId right)
template<EDirection >
void query (TVector *pDst, TId id) const
template<EDirection >
void composite (const IdMapper &by)
void prettyPrint (std::ostream &) const
const_iterator begin () const
 needed for BOOST_FOREACH
const_iterator end () const
 needed for BOOST_FOREACH

Private Types

typedef std::pair< TId, TId > TPair
typedef std::set< TPairTSearch
typedef TSearch TBidirSearch [2]
typedef TSearch::const_iterator TIter

Private Attributes

ENotFoundAction nfa_
TBidirSearch biSearch_

Detailed Description

template<typename TId, TId MIN = std::numeric_limits<TId>::min(), TId MAX = std::numeric_limits<TId>::max()>
class IdMapper< TId, MIN, MAX >

Definition at line 41 of file id_mapper.hh.

Member Typedef Documentation

typedef TSearch::const_iterator const_iterator

STL iterator, always D_LEFT_TO_RIGHT.

Definition at line 119 of file id_mapper.hh.

typedef TSearch::const_reference const_reference

needed for BOOST_FOREACH

Definition at line 122 of file id_mapper.hh.

typedef TSearch TBidirSearch[2]
private

Definition at line 111 of file id_mapper.hh.

typedef TSearch::const_iterator TIter
private

Definition at line 112 of file id_mapper.hh.

typedef std::pair<TId, TId> TPair
private

Definition at line 109 of file id_mapper.hh.

typedef std::set<TPair> TSearch
private

Definition at line 110 of file id_mapper.hh.

typedef std::vector<TId> TVector

Definition at line 43 of file id_mapper.hh.

Member Enumeration Documentation

do not change the order, composite() relies on it

Enumerator:
NFA_TRAP_TO_DEBUGGER 
NFA_RETURN_NOTHING 
NFA_RETURN_IDENTITY 

Definition at line 46 of file id_mapper.hh.

Constructor & Destructor Documentation

IdMapper ( )
inline

Definition at line 53 of file id_mapper.hh.

IdMapper ( const ENotFoundAction  nfa)
inline

Definition at line 58 of file id_mapper.hh.

Member Function Documentation

const_iterator begin ( ) const
inline

needed for BOOST_FOREACH

Definition at line 125 of file id_mapper.hh.

void clear ( )
inline

Definition at line 68 of file id_mapper.hh.

void composite ( const IdMapper< TId, MIN, MAX > &  by)
bool empty ( ) const
inline
const_iterator end ( ) const
inline

needed for BOOST_FOREACH

Definition at line 128 of file id_mapper.hh.

void flip ( )
inline

Definition at line 75 of file id_mapper.hh.

bool insert ( TId  left,
TId  right 
)

Definition at line 146 of file id_mapper.hh.

References CL_BREAK_IF, D_LEFT_TO_RIGHT, D_RIGHT_TO_LEFT, and hasKey().

Referenced by IdMapper< TId, MIN, MAX >::composite().

bool isTrivial ( ) const
inline

Definition at line 92 of file id_mapper.hh.

void prettyPrint ( std::ostream &  str) const

Definition at line 243 of file id_mapper.hh.

References D_LEFT_TO_RIGHT.

void query ( TVector pDst,
TId  id 
) const

Definition at line 162 of file id_mapper.hh.

References CL_BREAK_IF.

Referenced by IdMapper< TId, MIN, MAX >::composite().

void setNotFoundAction ( const ENotFoundAction  nfa)
inline
unsigned size ( ) const
inline

Definition at line 86 of file id_mapper.hh.

Referenced by IdMapper< TShapeIdx, INT_MIN, INT_MAX >::size().

Field Documentation

TBidirSearch biSearch_
private
ENotFoundAction nfa_
private

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