DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <ConstNodeMap.hh>
Public Types | |
typedef Diades::Utils::Exception< ConstNodeMap > | Exception |
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 Graph & | owner () const |
ConstNodeMapIterator< ValueType > | nodeBegin (ConstReference value) const |
ConstNodeMapIterator< ValueType > | nodeEnd (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) |
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.
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.
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.
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.
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.
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.
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.
typedef Diades::Utils::Exception<ConstNodeMap> Diades::Graph::ConstNodeMap< T >::Exception |
Definition at line 33 of file ConstNodeMap.hh.
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.
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.
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.
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.
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.
typedef vector<T>::value_type Diades::Graph::ConstNodeMap< T >::ValueType |
ValueType
the type T
Definition at line 47 of file ConstNodeMap.hh.
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.
|
explicit |
Parametrized constructor
g | Graph whose nodes will be associated in the map |
capacity | Node capacity (memory allocation). This parameter is considered only if it is greater than the node capacity of the graph |
dflt | T 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.
|
inline |
destructor
Definition at line 117 of file ConstNodeMap.hh.
|
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().
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
ostream | output stream |
Definition at line 432 of file ConstNodeMap.hh.
Referenced by Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::valid().
void Diades::Graph::ConstNodeMap< T >::init | ( | const Graph & | g, |
SizeType | capacity = 0 , |
||
ValueType | dflt = ValueType() |
||
) |
Initialization of the map
g | Graph whose nodes will be associated in the map |
capacity | Node capacity (memory allocation). This parameter is considered only if it is greater than the node capacity of the graph |
dflt | T 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().
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
begin | the NodeIterator on the first Node to initialise |
end | the NodeIterator on the element after the last Node to initialise |
value | the value for the initialisation |
Definition at line 346 of file ConstNodeMap.hh.
Referenced by Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::valid().
ConstNodeMapIterator< typename ConstNodeMap< T >::ValueType > Diades::Graph::ConstNodeMap< T >::nodeBegin | ( | ConstReference | value | ) | const |
Definition at line 464 of file ConstNodeMap.hh.
Referenced by Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::owner().
ConstNodeMapIterator< typename ConstNodeMap< T >::ValueType > Diades::Graph::ConstNodeMap< T >::nodeEnd | ( | ConstReference | value | ) | const |
Definition at line 472 of file ConstNodeMap.hh.
Referenced by Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::owner().
ConstNodeMap< T >::Reference Diades::Graph::ConstNodeMap< T >::operator[] | ( | Node | node | ) |
Read/write accessor function
node | Node to read/write the associated information |
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().
ConstNodeMap< T >::ConstReference Diades::Graph::ConstNodeMap< T >::operator[] | ( | Node | node | ) | const |
Read-only accessor function
node | Node to read the associated information |
Be careful, this operator returns an undefined value if not initialized before.
Definition at line 334 of file ConstNodeMap.hh.
|
inline |
Definition at line 154 of file ConstNodeMap.hh.
Referenced by Diades::Graph::ConstNodeMapIterator< T >::ConstNodeMapIterator(), and Diades::Graph::ConstNodeMapIterator< T >::operator++().
|
inlinestatic |
Definition at line 30 of file ConstNodeMap.hh.
|
inline |
Validity of the map
Definition at line 174 of file ConstNodeMap.hh.
|
private |
Definition at line 221 of file ConstNodeMap.hh.
|
private |
Definition at line 220 of file ConstNodeMap.hh.
Referenced by Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::owner(), and Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::valid().
|
mutableprivate |
Definition at line 219 of file ConstNodeMap.hh.
Referenced by Diades::Graph::ConstNodeMap< set< Diades::Automata::Event > >::clear().