DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <NodeMap.hh>
Public Types | |
typedef Diades::Utils::Exception< NodeMap > | 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 | |
NodeMap () | |
NodeMap (Graph &g, SizeType capacity=0, ValueType dflt=ValueType()) | |
~NodeMap () | |
Static Public Member Functions | |
static string | typeName () |
Others | |
vector< ValueType > | _tabData |
Graph * | _owner |
ValueType | _dflt |
void | clear () |
void | init (Graph &g, SizeType capacity=0, ValueType dflt=ValueType()) |
const Graph & | owner () const |
Graph & | owner () |
NodeMapIterator< ValueType > | nodeBegin (ConstReference value) const |
NodeMapIterator< 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 NodeMap 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
Definition at line 29 of file NodeMap.hh.
typedef vector<T>::allocator_type Diades::Graph::NodeMap< T >::AllocatorType |
AllocatorType
the type of the allocator (use it at your own risk)
Definition at line 69 of file NodeMap.hh.
typedef vector<T>::const_iterator Diades::Graph::NodeMap< T >::ConstIterator |
Iterator
internal constant iterator of the mapping (use it at your own risk)
Definition at line 57 of file NodeMap.hh.
typedef vector<T>::const_pointer Diades::Graph::NodeMap< T >::ConstPointer |
ConstPointer
constant pointer on the element of the map
Definition at line 77 of file NodeMap.hh.
typedef vector<T>::const_reference Diades::Graph::NodeMap< T >::ConstReference |
ConstReference
constant reference of the mapped element of type T
Definition at line 45 of file NodeMap.hh.
typedef vector<T>::const_reverse_iterator Diades::Graph::NodeMap< T >::ConstReverseIterator |
ConstReverseIterator
internal constant reverse iterator of the mapping (use it at your own risk)
Definition at line 85 of file NodeMap.hh.
typedef vector<T>::difference_type Diades::Graph::NodeMap< T >::DifferenceType |
DifferenceType
the type of the distance in the map (use it at your own risk)
Definition at line 65 of file NodeMap.hh.
typedef Diades::Utils::Exception<NodeMap> Diades::Graph::NodeMap< T >::Exception |
Definition at line 35 of file NodeMap.hh.
typedef vector<T>::iterator Diades::Graph::NodeMap< T >::Iterator |
Iterator
internal iterator of the mapping (use it at your own risk)
Definition at line 53 of file NodeMap.hh.
typedef vector<T>::pointer Diades::Graph::NodeMap< T >::Pointer |
Pointer
pointer on the element of the map
Definition at line 73 of file NodeMap.hh.
typedef vector<T>::reference Diades::Graph::NodeMap< T >::Reference |
Reference
reference of the mapped element of type T
Definition at line 41 of file NodeMap.hh.
typedef vector<T>::reverse_iterator Diades::Graph::NodeMap< T >::ReverseIterator |
ReverseIterator
internal reverse iterator of the mapping (use it at your own risk)
Definition at line 81 of file NodeMap.hh.
typedef vector<T>::size_type Diades::Graph::NodeMap< T >::SizeType |
SizeType
the type of the size of the map
Definition at line 61 of file NodeMap.hh.
typedef vector<T>::value_type Diades::Graph::NodeMap< T >::ValueType |
ValueType
the type T
Definition at line 49 of file NodeMap.hh.
Diades::Graph::NodeMap< T >::NodeMap | ( | ) |
Default constructor
Make an invalid map (empty). You must initilialize it with init
Definition at line 300 of file NodeMap.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 304 of file NodeMap.hh.
|
inline |
destructor
Definition at line 119 of file NodeMap.hh.
|
inline |
clear the map (must call init to use again)
Definition at line 134 of file NodeMap.hh.
Referenced by Diades::Automata::Experimental::StateMachine< _StatePropertyId, _InputSymbolId, _NullStatePropertyId, _NullInputSymbolId >::clear(), and Diades::Graph::NodeMap< Status >::~NodeMap().
void Diades::Graph::NodeMap< 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 443 of file NodeMap.hh.
Referenced by Diades::Graph::NodeMap< Status >::valid().
void Diades::Graph::NodeMap< T >::init | ( | 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 315 of file NodeMap.hh.
Referenced by Diades::Graph::NodeMap< Status >::clear(), Diades::Utils::PartialOrder< Diades::Petri::Extension, Diades::Petri::AdequateOrder, Diades::Petri::ExtensionEquality >::clear(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _InputSymbolId, _NullStatePropertyId, _NullInputSymbolId >::clear(), Diades::Automata::Trace::clear(), Diades::Automata::Component::Component(), exportBackwardToDot(), exportToDot(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _InputSymbolId, _NullStatePropertyId, _NullInputSymbolId >::finaliseInitialStates(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _InputSymbolId, _NullStatePropertyId, _NullInputSymbolId >::finaliseStatePropertyIds(), main(), Diades::Utils::PartialOrder< Diades::Petri::Extension, Diades::Petri::AdequateOrder, Diades::Petri::ExtensionEquality >::PartialOrder(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _InputSymbolId, _NullStatePropertyId, _NullInputSymbolId >::StateMachine(), and Diades::Automata::Topology::Topology().
NodeIterator Diades::Graph::NodeMap< 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 354 of file NodeMap.hh.
Referenced by Diades::Automata::Component::clearAllInitialStates(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _InputSymbolId, _NullStatePropertyId, _NullInputSymbolId >::clearAllInitialStates(), Diades::Automata::Component::setAllInitialStates(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _InputSymbolId, _NullStatePropertyId, _NullInputSymbolId >::setAllInitialStates(), and Diades::Graph::NodeMap< Status >::valid().
NodeMapIterator< typename NodeMap< T >::ValueType > Diades::Graph::NodeMap< T >::nodeBegin | ( | ConstReference | value | ) | const |
Definition at line 475 of file NodeMap.hh.
Referenced by Diades::Graph::NodeMap< Status >::owner().
NodeMapIterator< typename NodeMap< T >::ValueType > Diades::Graph::NodeMap< T >::nodeEnd | ( | ConstReference | value | ) | const |
Definition at line 483 of file NodeMap.hh.
Referenced by Diades::Graph::NodeMap< Status >::owner().
NodeMap< T >::Reference Diades::Graph::NodeMap< 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 329 of file NodeMap.hh.
Referenced by Diades::Graph::NodeMap< Status >::valid().
NodeMap< T >::ConstReference Diades::Graph::NodeMap< 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 342 of file NodeMap.hh.
|
inline |
Definition at line 156 of file NodeMap.hh.
Referenced by Diades::Graph::NodeMapIterator< T >::NodeMapIterator(), and Diades::Graph::NodeMapIterator< T >::operator++().
|
inline |
Definition at line 163 of file NodeMap.hh.
|
inlinestatic |
Definition at line 32 of file NodeMap.hh.
|
inline |
Validity of the map
Definition at line 182 of file NodeMap.hh.
|
private |
Definition at line 229 of file NodeMap.hh.
|
private |
Definition at line 228 of file NodeMap.hh.
Referenced by Diades::Graph::NodeMap< Status >::owner(), and Diades::Graph::NodeMap< Status >::valid().
|
mutableprivate |
Definition at line 227 of file NodeMap.hh.
Referenced by Diades::Graph::NodeMap< Status >::clear().