DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Types | Static Public Member Functions | Private Attributes | List of all members
Diades::Graph::EdgeMap< T > Class Template Reference

#include <EdgeMap.hh>

Public Types

typedef Diades::Utils::Exception< EdgeMapException
 
typedef vector< T >::reference Reference
 
typedef vector< T >::const_reference ConstReference
 
typedef vector< T >::value_type ValueType
 
typedef vector< T >::iterator Iterator
 
typedef vector< T >::const_iterator ConstIterator
 
typedef vector< T >::size_type SizeType
 
typedef vector< T >::difference_type DifferenceType
 
typedef vector< T >::allocator_type AllocatorType
 
typedef vector< T >::pointer Pointer
 
typedef vector< T >::const_pointer ConstPointer
 
typedef vector< T >::reverse_iterator ReverseIterator
 
typedef vector< T >::const_reverse_iterator ConstReverseIterator
 

Public Member Functions

Constructors
 EdgeMap ()
 
 EdgeMap (Graph &g, SizeType capacity=0, ValueType dflt=ValueType())
 
 ~EdgeMap ()
 
Others
void init (Graph &g, SizeType capacity=0, ValueType dflt=ValueType())
 
void clear ()
 
const Graphowner () const
 
Graphowner ()
 
Reference operator[] (Edge edge)
 
ConstReference operator[] (Edge edge) const
 
bool valid () const
 
EdgeIterator initValue (EdgeIterator begin, EdgeIterator end, ConstReference value)
 
LocalEdgeIterator initValue (LocalEdgeIterator begin, LocalEdgeIterator end, ConstReference value)
 
EdgeMapIterator< ValueTypeedgeBegin (ConstReference value) const
 
EdgeMapIterator< ValueTypeegdeEnd (ConstReference value) const
 

Static Public Member Functions

static string typeName ()
 

Private Attributes

vector< ValueType_tabData
 
Graph_owner
 
_dflt
 

Detailed Description

template<class T>
class Diades::Graph::EdgeMap< T >

Association between a edge of a graph (Edge) and a object T.

A EdgeMap defines a map between each edge of a Graph and objects of type T. This map is more efficient than the map developped in the STL.

Definition at line 29 of file EdgeMap.hh.

Member Typedef Documentation

◆ AllocatorType

template<class T>
typedef vector<T>::allocator_type Diades::Graph::EdgeMap< T >::AllocatorType

AllocatorType the type of the allocator (use it at your own risk)

Definition at line 69 of file EdgeMap.hh.

◆ ConstIterator

template<class T>
typedef vector<T>::const_iterator Diades::Graph::EdgeMap< T >::ConstIterator

Iterator internal constant iterator of the mapping (use it at your own risk)

Definition at line 57 of file EdgeMap.hh.

◆ ConstPointer

template<class T>
typedef vector<T>::const_pointer Diades::Graph::EdgeMap< T >::ConstPointer

ConstPointer constant pointer on the element of the map

Definition at line 77 of file EdgeMap.hh.

◆ ConstReference

template<class T>
typedef vector<T>::const_reference Diades::Graph::EdgeMap< T >::ConstReference

ConstReference constant reference of the mapped element of type T

Definition at line 45 of file EdgeMap.hh.

◆ ConstReverseIterator

template<class T>
typedef vector<T>::const_reverse_iterator Diades::Graph::EdgeMap< T >::ConstReverseIterator

ConstReverseIterator internal constant reverse iterator of the mapping (use it at your own risk)

Definition at line 85 of file EdgeMap.hh.

◆ DifferenceType

template<class T>
typedef vector<T>::difference_type Diades::Graph::EdgeMap< T >::DifferenceType

DifferenceType the type of the distance in the map (use it at your own risk)

Definition at line 65 of file EdgeMap.hh.

◆ Exception

Definition at line 35 of file EdgeMap.hh.

◆ Iterator

template<class T>
typedef vector<T>::iterator Diades::Graph::EdgeMap< T >::Iterator

Iterator internal iterator of the mapping (use it at your own risk)

Definition at line 53 of file EdgeMap.hh.

◆ Pointer

template<class T>
typedef vector<T>::pointer Diades::Graph::EdgeMap< T >::Pointer

Pointer pointer on the element of the map

Definition at line 73 of file EdgeMap.hh.

◆ Reference

template<class T>
typedef vector<T>::reference Diades::Graph::EdgeMap< T >::Reference

Reference reference of the mapped element of type T

Definition at line 41 of file EdgeMap.hh.

◆ ReverseIterator

template<class T>
typedef vector<T>::reverse_iterator Diades::Graph::EdgeMap< T >::ReverseIterator

ReverseIterator internal reverse iterator of the mapping (use it at your own risk)

Definition at line 81 of file EdgeMap.hh.

◆ SizeType

template<class T>
typedef vector<T>::size_type Diades::Graph::EdgeMap< T >::SizeType

SizeType the type of the size of the map

Definition at line 61 of file EdgeMap.hh.

◆ ValueType

template<class T>
typedef vector<T>::value_type Diades::Graph::EdgeMap< T >::ValueType

ValueType the type T

Definition at line 49 of file EdgeMap.hh.

Constructor & Destructor Documentation

◆ EdgeMap() [1/2]

template<typename T >
Diades::Graph::EdgeMap< T >::EdgeMap ( )

Default constructor

Make an invalid map (empty). You must initilialize it with init

Definition at line 295 of file EdgeMap.hh.

◆ EdgeMap() [2/2]

template<typename T >
Diades::Graph::EdgeMap< T >::EdgeMap ( Graph g,
SizeType  capacity = 0,
ValueType  dflt = ValueType() 
)
explicit

Parametrized constructor

Parameters
gGraph whose edges will be associated in the map
capacityEdge capacity (memory allocation). This parameter is considered only if it is greater than the edge capacity of the graph
dfltT default value associated to each edge of the graph

Construction of a map for the edges of Graph g to the value dflt

Definition at line 299 of file EdgeMap.hh.

◆ ~EdgeMap()

template<class T>
Diades::Graph::EdgeMap< T >::~EdgeMap ( )
inline

destructor

Definition at line 117 of file EdgeMap.hh.

Member Function Documentation

◆ clear()

template<class T>
void Diades::Graph::EdgeMap< T >::clear ( )
inline

◆ edgeBegin()

template<class T>
EdgeMapIterator< ValueType > Diades::Graph::EdgeMap< T >::edgeBegin ( ConstReference  value) const

◆ egdeEnd()

template<class T>
EdgeMapIterator< ValueType > Diades::Graph::EdgeMap< T >::egdeEnd ( ConstReference  value) const

◆ init()

template<typename T >
void Diades::Graph::EdgeMap< T >::init ( Graph g,
SizeType  capacity = 0,
ValueType  dflt = ValueType() 
)

◆ initValue() [1/2]

template<class T>
EdgeIterator Diades::Graph::EdgeMap< T >::initValue ( EdgeIterator  begin,
EdgeIterator  end,
ConstReference  value 
)

◆ initValue() [2/2]

template<class T>
LocalEdgeIterator Diades::Graph::EdgeMap< T >::initValue ( LocalEdgeIterator  begin,
LocalEdgeIterator  end,
ConstReference  value 
)

◆ operator[]() [1/2]

template<typename T >
EdgeMap< T >::Reference Diades::Graph::EdgeMap< T >::operator[] ( Edge  edge)

Read/write accessor function

Parameters
edgeEdge to read/write the associated information
Returns
a reference to the value associated to edge.

Use this function to change the value of an element in the map

Definition at line 331 of file EdgeMap.hh.

Referenced by Diades::Graph::EdgeMap< Diades::Automata::FaultPattern::EventOccurrence >::owner().

◆ operator[]() [2/2]

template<typename T >
EdgeMap< T >::ConstReference Diades::Graph::EdgeMap< T >::operator[] ( Edge  edge) const

Read-only accessor function

Parameters
edgeEdge to read the associated information
Returns
a constant reference to the value associated to edge.

Be careful, this operator returns an undefined value if not initialized before.

Definition at line 345 of file EdgeMap.hh.

◆ owner() [1/2]

template<class T>
const Graph& Diades::Graph::EdgeMap< T >::owner ( ) const
inline
Returns
the owner of the map

Definition at line 154 of file EdgeMap.hh.

Referenced by Diades::Graph::EdgeMapIterator< T >::EdgeMapIterator(), and Diades::Graph::EdgeMapIterator< T >::operator++().

◆ owner() [2/2]

template<class T>
Graph& Diades::Graph::EdgeMap< T >::owner ( )
inline
Returns
the owner of the map

Definition at line 163 of file EdgeMap.hh.

◆ typeName()

template<class T>
static string Diades::Graph::EdgeMap< T >::typeName ( )
inlinestatic

Definition at line 32 of file EdgeMap.hh.

◆ valid()

template<class T>
bool Diades::Graph::EdgeMap< T >::valid ( ) const
inline

Validity of the map

Returns
true if the map is valid

Definition at line 191 of file EdgeMap.hh.

Member Data Documentation

◆ _dflt

template<class T>
T Diades::Graph::EdgeMap< T >::_dflt
private

Definition at line 216 of file EdgeMap.hh.

◆ _owner

template<class T>
Graph* Diades::Graph::EdgeMap< T >::_owner
mutableprivate

◆ _tabData

template<class T>
vector<ValueType> Diades::Graph::EdgeMap< T >::_tabData
mutableprivate

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