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

#include <ConstNodeMap.hh>

Public Types

typedef Diades::Utils::Exception< ConstNodeMapException
 
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
 ConstNodeMap ()
 
 ConstNodeMap (const Graph &g, SizeType capacity=0, ValueType dflt=ValueType())
 
 ~ConstNodeMap ()
 

Static Public Member Functions

static string typeName ()
 

Others

vector< ValueType_tabData
 
const Graph_owner
 
ValueType _dflt
 
void clear ()
 
void init (const Graph &g, SizeType capacity=0, ValueType dflt=ValueType())
 
const Graphowner () const
 
ConstNodeMapIterator< ValueTypenodeBegin (ConstReference value) const
 
ConstNodeMapIterator< ValueTypenodeEnd (ConstReference value) const
 
bool valid () const
 
Reference operator[] (Node node)
 
ConstReference operator[] (Node node) const
 
NodeIterator initValue (NodeIterator begin, NodeIterator end, ConstReference value)
 
void export2dot (ostream &os)
 

Detailed Description

template<typename T>
class Diades::Graph::ConstNodeMap< T >

Association between a node of a graph (Node) and a object T.

A ConstNodeMap defines a map between each node of a Graph and objects of type T. This map is more efficient than the map (even unordered_map) developped in the STL as it relies on vectors and their direct access to elements This is the constant version, i.e. the underlying graph is constant as opposed to NodeMap where the graph can be modified

Definition at line 27 of file ConstNodeMap.hh.

Member Typedef Documentation

◆ AllocatorType

template<typename T>
typedef vector<T>::allocator_type Diades::Graph::ConstNodeMap< T >::AllocatorType

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

Definition at line 67 of file ConstNodeMap.hh.

◆ ConstIterator

template<typename T>
typedef vector<T>::const_iterator Diades::Graph::ConstNodeMap< T >::ConstIterator

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

Definition at line 55 of file ConstNodeMap.hh.

◆ ConstPointer

template<typename T>
typedef vector<T>::const_pointer Diades::Graph::ConstNodeMap< T >::ConstPointer

ConstPointer constant pointer on the element of the map

Definition at line 75 of file ConstNodeMap.hh.

◆ ConstReference

template<typename T>
typedef vector<T>::const_reference Diades::Graph::ConstNodeMap< T >::ConstReference

ConstReference constant reference of the mapped element of type T

Definition at line 43 of file ConstNodeMap.hh.

◆ ConstReverseIterator

template<typename T>
typedef vector<T>::const_reverse_iterator Diades::Graph::ConstNodeMap< T >::ConstReverseIterator

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

Definition at line 83 of file ConstNodeMap.hh.

◆ DifferenceType

template<typename T>
typedef vector<T>::difference_type Diades::Graph::ConstNodeMap< T >::DifferenceType

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

Definition at line 63 of file ConstNodeMap.hh.

◆ Exception

Definition at line 33 of file ConstNodeMap.hh.

◆ Iterator

template<typename T>
typedef vector<T>::iterator Diades::Graph::ConstNodeMap< T >::Iterator

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

Definition at line 51 of file ConstNodeMap.hh.

◆ Pointer

template<typename T>
typedef vector<T>::pointer Diades::Graph::ConstNodeMap< T >::Pointer

Pointer pointer on the element of the map

Definition at line 71 of file ConstNodeMap.hh.

◆ Reference

template<typename T>
typedef vector<T>::reference Diades::Graph::ConstNodeMap< T >::Reference

Reference reference of the mapped element of type T

Definition at line 39 of file ConstNodeMap.hh.

◆ ReverseIterator

template<typename T>
typedef vector<T>::reverse_iterator Diades::Graph::ConstNodeMap< T >::ReverseIterator

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

Definition at line 79 of file ConstNodeMap.hh.

◆ SizeType

template<typename T>
typedef vector<T>::size_type Diades::Graph::ConstNodeMap< T >::SizeType

SizeType the type of the size of the map

Definition at line 59 of file ConstNodeMap.hh.

◆ ValueType

template<typename T>
typedef vector<T>::value_type Diades::Graph::ConstNodeMap< T >::ValueType

ValueType the type T

Definition at line 47 of file ConstNodeMap.hh.

Constructor & Destructor Documentation

◆ ConstNodeMap() [1/2]

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

Default constructor

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

Definition at line 292 of file ConstNodeMap.hh.

◆ ConstNodeMap() [2/2]

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

Parametrized constructor

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

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

Definition at line 296 of file ConstNodeMap.hh.

◆ ~ConstNodeMap()

template<typename T>
Diades::Graph::ConstNodeMap< T >::~ConstNodeMap ( )
inline

destructor

Definition at line 117 of file ConstNodeMap.hh.

Member Function Documentation

◆ clear()

template<typename T>
void Diades::Graph::ConstNodeMap< T >::clear ( )
inline

clear the map (must call init to use again)

Definition at line 132 of file ConstNodeMap.hh.

Referenced by Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::~ConstNodeMap().

◆ export2dot()

template<typename T >
void Diades::Graph::ConstNodeMap< T >::export2dot ( ostream &  os)

Export the map as a dot file. Require that the function printDot is working on the type T

Parameters
ostreamoutput stream

Definition at line 432 of file ConstNodeMap.hh.

Referenced by Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::valid().

◆ init()

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

Initialization of the map

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

Initialization of the map for the nodes of Graph g to the value dflt

Definition at line 307 of file ConstNodeMap.hh.

Referenced by Diades::Automata::Experimental::autFileStateEncoding(), Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::clear(), Diades::Petri::LabelledNet::LabelledNet(), and Diades::Petri::LabelledPrioritizedTimeNet::LabelledPrioritizedTimeNet().

◆ initValue()

template<typename T >
NodeIterator Diades::Graph::ConstNodeMap< T >::initValue ( NodeIterator  begin,
NodeIterator  end,
ConstReference  value 
)

Initialise a range of Node [begin, end) in the Graph with a value

Parameters
beginthe NodeIterator on the first Node to initialise
endthe NodeIterator on the element after the last Node to initialise
valuethe value for the initialisation

Definition at line 346 of file ConstNodeMap.hh.

Referenced by Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::valid().

◆ nodeBegin()

template<typename T>
ConstNodeMapIterator< typename ConstNodeMap< T >::ValueType > Diades::Graph::ConstNodeMap< T >::nodeBegin ( ConstReference  value) const

◆ nodeEnd()

template<typename T>
ConstNodeMapIterator< typename ConstNodeMap< T >::ValueType > Diades::Graph::ConstNodeMap< T >::nodeEnd ( ConstReference  value) const

◆ operator[]() [1/2]

template<typename T >
ConstNodeMap< T >::Reference Diades::Graph::ConstNodeMap< T >::operator[] ( Node  node)

Read/write accessor function

Parameters
nodeNode to read/write the associated information
Returns
a reference to the value associated to node.

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

Definition at line 321 of file ConstNodeMap.hh.

Referenced by Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::valid().

◆ operator[]() [2/2]

template<typename T >
ConstNodeMap< T >::ConstReference Diades::Graph::ConstNodeMap< T >::operator[] ( Node  node) const

Read-only accessor function

Parameters
nodeNode to read the associated information
Returns
a constant reference to the value associated to trans.

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

Definition at line 334 of file ConstNodeMap.hh.

◆ owner()

template<typename T>
const Graph& Diades::Graph::ConstNodeMap< T >::owner ( ) const
inline

◆ typeName()

template<typename T>
static string Diades::Graph::ConstNodeMap< T >::typeName ( )
inlinestatic

Definition at line 30 of file ConstNodeMap.hh.

◆ valid()

template<typename T>
bool Diades::Graph::ConstNodeMap< T >::valid ( ) const
inline

Validity of the map

Returns
true if the map is valid (has an owner)

Definition at line 174 of file ConstNodeMap.hh.

Member Data Documentation

◆ _dflt

template<typename T>
ValueType Diades::Graph::ConstNodeMap< T >::_dflt
private

Definition at line 221 of file ConstNodeMap.hh.

◆ _owner

template<typename T>
const Graph* Diades::Graph::ConstNodeMap< T >::_owner
private

◆ _tabData

template<typename T>
vector<ValueType> Diades::Graph::ConstNodeMap< T >::_tabData
mutableprivate

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