7#ifndef TRIGNAVSTRUCTURE_TRIGGERELEMENT_H
8#define TRIGNAVSTRUCTURE_TRIGGERELEMENT_H
88 void serialize(std::vector<uint32_t>& output)
const;
89 void deserialize( std::vector<uint32_t>::const_iterator& inputIt);
100 return ! (*
this == rhs);
132 static const std::vector<TriggerElement*> dumvec;
160 static unsigned int enquireId( std::vector<uint32_t>::const_iterator& inputIt );
168 void serialize( std::vector<uint32_t>& output,
const std::map<TriggerElement*, uint16_t>& keys,
const TriggerElement* previous )
const;
176 void deserialize( std::vector<uint32_t>::const_iterator& inputIt,
const std::map<uint16_t, TriggerElement*>& keys,
const TriggerElement* previous );
214 o <<
" CLID:" << f.m_CLID
215 <<
" idx:" << f.m_index.subTypeIndex()
216 <<
":" << f.m_index.objectsBegin()
217 <<
":" << f.m_index.objectsEnd() << std::dec;
248 void addFeature(
const FeatureAccessHelper& f);
259 std::vector< FeatureAccessHelper >
m_uses;
260 std::vector< FeatureAccessHelper >
m_prev;
void setCLIDandIndex(class_id_type clid, sub_index_type idx)
FeatureAccessHelper(class_id_type clid, ObjectIndex index, bool forget=false)
bool m_forget
flag, if true saying that link to this feature should not be serialized
bool forget() const
flag, if true saying that the object does not need to be serialized
void setForget(bool value=true)
sets the forget flag
const ObjectIndex & getIndex() const
index in the external ojects array
friend std::ostream & operator<<(std::ostream &o, const FeatureAccessHelper &f)
ObjectIndex m_index
the external index (here we do not know what it is)
class_id_type m_CLID
the CLID of the object
class_id_type getCLID() const
Class ID of object.
bool operator==(const FeatureAccessHelper &rhs) const
Helper class for conversion from/to int stored in TE and pair of ints used in Navigation Object point...
bool operator<(const ObjectIndex &obj) const
void serialize(std::vector< uint32_t > &output) const
sub_index_type subTypeIndex() const
to get collection index
index_type objectsEnd() const
to get object number in th ecollection
index_type m_objIndexEnd
auxiliary index word for big features
bool operator==(const ObjectIndex &rhs) const
void updateBeginAndEnd(index_type begin, index_type end)
index_type objectsBegin() const
to get object number in th ecollection
void deserialize(std::vector< uint32_t >::const_iterator &inputIt)
index_type m_objIndexBegin
auxiliary index word for big features
bool isSameOrWithin(const ObjectIndex *idx) const
check if idx is the same as this or is within this index
sub_index_type m_subTypeIndex
actual index storage
void setSubTypeIndex(sub_index_type idx)
bool operator!=(const ObjectIndex &rhs) const
std::vector< FeatureAccessHelper > m_uses
all features attached are in this storage
bool getGhostState() const
void setGhostState(bool t=true)
std::vector< FeatureAccessHelper > & getFeatureAccessHelpers()
@ nofwdState
this TE is of type which stops fwd deactivation
@ ghostState
this TE is of type ghost/evaporating/one can't attach features to this TE
@ activeState
this bit is keeping active/inactive state of TE
@ errorState
somewhere in the algorithms dealing with this TE there was an error
unsigned int m_state
one word for all states, info in bits (saving space in serialized object)
static unsigned int enquireId(std::vector< uint32_t >::const_iterator &inputIt)
Relation
possible relations enumeration (Note: uses no longer here)
@ seedsRelation
what TEs I am seeding
@ sameRoIRelation
equilateral relation of all TEs rooted in one RoI
@ seededByRelation
what TEs are seeding me
void setErrorState(bool state=true)
te_id_type getId() const
reset internals.
void serialize(std::vector< uint32_t > &output, const std::map< TriggerElement *, uint16_t > &keys, const TriggerElement *previous) const
serializes TE
void setTransient(bool t=true)
const std::vector< TriggerElement * > & getRelated(Relation rel) const
returns reference to the likns to other TriggerElements related by relation r
bool getActiveState() const
get state of the TriggerElement
bool getErrorState() const
std::vector< FeatureAccessHelper > & getPreviousFeatures()
bool m_transient
marker that TE should not be serialized
const std::vector< FeatureAccessHelper > & getFeatureAccessHelpers() const
returns all features which ara attached to this TE
void addFeature(class_id_type clid, const ObjectIndex &index, bool forget=false)
add helper for new feature
std::vector< FeatureAccessHelper > m_prev
all features attached are in this TE and seeding TEs
std::vector< FeatureAccessHelper > FeatureVec
const std::vector< FeatureAccessHelper > & getPreviousFeatures() const
void deserialize(std::vector< uint32_t >::const_iterator &inputIt, const std::map< uint16_t, TriggerElement * > &keys, const TriggerElement *previous)
deserialization
void setActiveState(bool state)
set state of the TriggerElement
void relate(TriggerElement *te, Relation r)
reates given TE to other TE
std::map< Relation, std::vector< TriggerElement * > > m_relations
relations holder (features outside)
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
static const class_id_type invalid_class_id