DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <InfoManager.hh>
Classes | |
class | GetInfo |
Public Types | |
using | Info = _Info |
using | InfoId = _InfoId |
using | NullInfo = _NullInfo |
using | NullInfoId = _NullInfoId |
using | Hash = _Hash |
using | Exception = Diades::Utils::Exception< InfoManager > |
template<typename InfoIdIterator > | |
using | InfoIdRangeInfoIterator = Diades::Utils::RangeMapperIterator< GetInfo< InfoIdIterator > > |
Public Member Functions | |
InfoManager ()=default | |
InfoManager (InfoManager const &other)=default | |
InfoManager & | operator= (InfoManager const &other) |
InfoManager (InfoManager &&other) | |
InfoManager & | operator= (InfoManager &&other) |
virtual | ~InfoManager ()=default |
bool | hasInfo (const Info &info) const |
bool | hasInfoId (InfoId id) const |
bool | setInfo (const Info &info, InfoId id) |
InfoId | infoId (const Info &info) |
const Info & | getInfo (InfoId id) const |
InfoManager & | initialise (unsigned capacity) |
const std::vector< Info > & | storage () const |
InfoIdIterator | begin () const |
InfoIdIterator | end () const |
template<typename InfoIdIterator > | |
InfoIdRangeInfoIterator< InfoIdIterator > | infoIdRangeInfoIterator (InfoIdIterator iterator) const |
size_t | numberOfInfos () const |
bool | isConsistentWith (const InfoManager &manager) const |
bool | isEquivalentTo (const InfoManager &manager) const |
InfoManager & | appendWith (const InfoManager &manager) |
InfoManager & | makeIntersection (const InfoManager &m1, const InfoManager &m2) |
InfoManager & | makeUnion (const InfoManager &m1, const InfoManager &m2) |
bool | isNull (const Info &info) const |
bool | isNullId (const InfoId &infoId) const |
Static Public Member Functions | |
static string | typeName () |
Public Attributes | |
const Info | nullInfo = NullInfo().nullValue() |
const InfoId | nullInfoId = NullInfoId().nullValue() |
Protected Types | |
using | Map = std::unordered_map< size_t, std::vector< InfoId > > |
using | InfoIdIterator = typename std::vector< InfoId >::const_iterator |
Protected Attributes | |
Map | _infoMap |
std::vector< Info > | _infos |
std::vector< InfoId > | _infoIds |
Private Member Functions | |
void | clear () |
An InfoManager is a container that associates an Info with an InfoId. Based on this class it is then possible to manipulate Info object's as simple ids with help of InfoId. No pointers/references are then embedded in an InfoId. To get the effective Info of a given InfoId, ask the InfoManager (hash table + vector). For efficiency purpose, an InfoId does not even hold a pointer about the InfoManager that creates it. It means that an InfoId may have several meanings depending on the InfoManagers that are available. It is up to the client to manage InfoId's ownership.
An InfoManager aims at being very flexible. It can be copied. We can perform intersection, union of InfoManagers. But be aware that two InfoManagers are totally independent. A consistency check can be performed to attest that an InfoManager owns a subset of Info's from another manager with the same InfoId's. If two InfoManagers own the same Info's with the same InfoId's they are equivalent.
Info/InfoId must be copyable. Info must be hashable (default is std::hash<Info>>) Info must have an operator == (by Value). Info must have a NullInfo (by default it is NullValue<Info>.nullValue()) InfoId must have a NullInfoId (by default it is NullValue<InfoId>.nullValue()) InfoId must have an operator == (by Value).
Definition at line 55 of file InfoManager.hh.
using Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::Exception = Diades::Utils::Exception<InfoManager> |
Definition at line 113 of file InfoManager.hh.
using Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::Hash = _Hash |
Definition at line 98 of file InfoManager.hh.
nullInfo the null Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::Info |
Definition at line 62 of file InfoManager.hh.
nullInfoId the null Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::InfoId |
Definition at line 68 of file InfoManager.hh.
|
protected |
Definition at line 125 of file InfoManager.hh.
using Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::InfoIdRangeInfoIterator = Diades::Utils::RangeMapperIterator<GetInfo<InfoIdIterator> > |
Definition at line 174 of file InfoManager.hh.
|
protected |
Definition at line 119 of file InfoManager.hh.
using Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::NullInfo = _NullInfo |
Definition at line 73 of file InfoManager.hh.
using Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::NullInfoId = _NullInfoId |
Definition at line 81 of file InfoManager.hh.
|
default |
Default constructor
|
default |
Copy constructor (default)
other |
|
inline |
|
virtualdefault |
|
inline |
Manager appending
manager | the manage to append |
By appending, we mean that any Info of the manager in parameter will be included in the current manager. However, the InfoId of the current manager associated with a given StateInfo might not be (will certainly be not) the same as the InfoId in the other manager.
Definition at line 531 of file InfoManager.hh.
Referenced by Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::makeUnion().
|
inline |
Definition at line 418 of file InfoManager.hh.
Referenced by explainLog(), and Diades::Automata::Experimental::initialiseMatcher().
|
inlineprivate |
Clear the manager, the manager is invalid
Definition at line 456 of file InfoManager.hh.
Referenced by Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::initialise(), and Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::makeIntersection().
|
inline |
Definition at line 428 of file InfoManager.hh.
Referenced by explainLog(), and Diades::Automata::Experimental::initialiseMatcher().
|
inline |
id | a InfoId |
a
InfoId may not be associated yet to a Info then it is associated with the nullInfo Definition at line 365 of file InfoManager.hh.
Referenced by Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::appendWith(), Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::makeIntersection(), Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::makeUnion(), and Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::GetInfo< _Iterator >::operator()().
|
inline |
info | a Info |
Definition at line 247 of file InfoManager.hh.
Referenced by Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::makeIntersection(), Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::makeUnion(), and Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::setInfo().
|
inline |
id | a InfoId |
Definition at line 277 of file InfoManager.hh.
|
inline |
info | a Info |
Definition at line 326 of file InfoManager.hh.
Referenced by Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::appendWith(), Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::makeIntersection(), Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::makeUnion(), and Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::setInfo().
|
inline |
iterator | a InfoIdIterator (whatever iterator which refers to a InfoId) |
here
is how to use this. Suppose you have a range of InfoId begin,end from the current manager, then infoIdRangeInfoIterator(begin), infoIdRangeInfoIterator(end) is the corresponding Info Range. Definition at line 443 of file InfoManager.hh.
|
inline |
capacity | the capacity to reserve |
The current InfoManager is fully reinitialised so any Info that was associated with it is now invalid. 'capacity' allocates memory. The recommended use is to create less Info's than capacity. If more, there will be memory reallocation (performance issue only).
Definition at line 391 of file InfoManager.hh.
|
inline |
Consistency checking
manager | the manager to check with |
consistency:
a manager is consistent with another one if any Info owned by the current manager is owned by the other one with the same Info.
Definition at line 485 of file InfoManager.hh.
|
inline |
Equivalence checking
manager | the manager to check with |
equivalence:
a manager is equivalent to another one if any Info owned by the current manager is owned by the other one with the same Info and reciprocally
Definition at line 512 of file InfoManager.hh.
|
inline |
info |
Definition at line 667 of file InfoManager.hh.
|
inline |
infoId |
Definition at line 677 of file InfoManager.hh.
|
inline |
Intersection of two InfoManager's
m1 | the first InfoManager |
m2 | the second InfoManager |
The current InfoManager is the intersection of m1 and m2. It means that the current InfoManager consists of the Info owned by both m1 and m2. The associated InfoId is obviously different.
Definition at line 555 of file InfoManager.hh.
|
inline |
Union of two InfoManager's
m1 | the first InfoManager |
m2 | the second InfoManager |
The current InfoManager is the union of m1 and m2. It means that the current InfoManager consists of the Info owned by at least one InfoManager m1 or m2. The associated InfoId is obviously different.
Definition at line 613 of file InfoManager.hh.
|
inline |
Definition at line 469 of file InfoManager.hh.
Referenced by Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::appendWith(), Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::isConsistentWith(), Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::makeIntersection(), and Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::makeUnion().
|
inline |
Assignement
other |
note
that it is not a default one as I have constants nullInfo and nullInfoId that are already defined Definition at line 199 of file InfoManager.hh.
|
inline |
Move assignement (not default)
other |
Definition at line 225 of file InfoManager.hh.
|
inline |
Associate info to a specific id
info | the Info |
id | the InfoId |
Definition at line 292 of file InfoManager.hh.
|
inline |
Definition at line 408 of file InfoManager.hh.
Referenced by tagStates(), and trimDdAutStates2().
|
inlinestatic |
Definition at line 105 of file InfoManager.hh.
|
protected |
Definition at line 146 of file InfoManager.hh.
Referenced by Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::operator=().
|
protected |
Definition at line 133 of file InfoManager.hh.
Referenced by Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::operator=().
|
protected |
Definition at line 139 of file InfoManager.hh.
Referenced by Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::isConsistentWith(), Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::operator=(), and Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::storage().
const Info Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::nullInfo = NullInfo().nullValue() |
Definition at line 87 of file InfoManager.hh.
Referenced by Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::getInfo(), and Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::isNull().
const InfoId Diades::Utils::InfoManager< _Info, _InfoId, _NullInfo, _NullInfoId, _Hash >::nullInfoId = NullInfoId().nullValue() |
Definition at line 92 of file InfoManager.hh.
Referenced by Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::hasInfoId(), Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::infoId(), and Diades::Utils::InfoManager< std::string, size_t, NullValue< std::string >, NullValue< size_t >, std::hash< std::string > >::isNullId().