42 const static size_t max_features_per_te = 0xfff;
43 if (
m_uses.size() == max_features_per_te-1 ) {
44 std::cout <<
"ERROR - count of features per TE exceeds the limitation, further attach operations are ignored" << std::endl;
46 if (
m_uses.size() == max_features_per_te ) {
72 std::vector<TriggerElement*>::const_iterator it;
74 (*it)->setActiveState(
false);
97 std::vector<TriggerElement*>::const_iterator it;
98 for ( it = tes.begin(); it != tes.end(); ++it ) {
112 return unsigned(*inputIt);
117 if (
count % 2 == 0 ) {
118 s = (uint32_t(val) << 16) & 0xffff0000;
121 v.back() |= uint32_t(val & 0xffff);
126 if (
count % 2 == 0 ) {
127 val = ((*it) >> 16 ) & 0xffff;
129 val = (*it) & 0xffff;
137 output.push_back(
m_id);
138 unsigned summaryIndex = output.size();
142 std::vector<TriggerElement*> dumvec;
143 const std::vector<TriggerElement*>& relvec =
146 std::vector<TriggerElement*>::const_iterator teIt;
147 unsigned relationsCount = 0;
149 for ( teIt = relvec.begin(); teIt != relvec.end(); ++teIt ) {
150 std::map<TriggerElement*, uint16_t>::const_iterator key = keys.find(*teIt);
151 if ( key != keys.end() ) {
161 std::vector< FeatureAccessHelper >::const_iterator featuresIt;
162 unsigned featuresCount = 0;
164 for ( featuresIt =
m_uses.begin(); featuresIt !=
m_uses.end(); ++featuresIt ) {
165 if ( ! featuresIt->forget() ) {
166 output.push_back ( featuresIt->getCLID() );
167 featuresIt->getIndex().serialize(output);
171 uint32_t seedingUsesStateWord = ((relvec.size() << 20)) | (featuresCount << 8) | (
m_state & 0xf);
172 output[summaryIndex] = seedingUsesStateWord;
183 const std::map<uint16_t, TriggerElement*>& keys,
const TriggerElement* ) {
186 uint32_t seedingUsesStateWord = *inputIt++;
187 m_state = seedingUsesStateWord & 0xf;
188 unsigned int size = (seedingUsesStateWord & 0xfff00000) >> 20;
189 unsigned int featuresAttached = (seedingUsesStateWord & 0x000fff00) >> 8;
194 std::map<uint16_t, TriggerElement*>::const_iterator id;
195 unsigned relationsCount = 0;
197 for (
unsigned int i = 0 ; i < size; ++i ) {
202 if (
id != keys.end() ) {
211 if ( relationsCount %2 == 1 ) inputIt++;
216 for (
unsigned int i = 0 ; i < featuresAttached; ++i ) {
217 unsigned int clid = *inputIt++;
242 throw std::runtime_error(
"To many collections of one type: " + std::to_string(subType)+
" >= 0xffff" );
308 uint32_t w = *inputIt++;
309 if ( w & 0x80000000 ) {
315 }
else if ( (w & 0x40000000) == 0 ) {
318 uint32_t w2 = *inputIt++;
void insertUint16ToUint32Vector(std::vector< uint32_t > &v, uint16_t val, unsigned count)
void extractUint16FromUint32Vector(std::vector< uint32_t >::const_iterator &it, uint16_t &val, unsigned count)
static const Attributes_t empty
the FeatureAccessHelper is a class used to keep track of features attached to this TE.
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
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
std::vector< FeatureAccessHelper > m_uses
all features attached are in this storage
void setGhostState(bool t=true)
@ 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
@ seededByRelation
what TEs are seeding me
void setErrorState(bool state=true)
void serialize(std::vector< uint32_t > &output, const std::map< TriggerElement *, uint16_t > &keys, const TriggerElement *previous) const
serializes TE
const std::vector< TriggerElement * > & getRelated(Relation rel) const
returns reference to the likns to other TriggerElements related by relation r
bool m_transient
marker that TE should not be serialized
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
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)
std::string find(const std::string &s)
return a remapped string
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
static const index_type invalid_index
const FeatureContainerInit< FEATURE, CONTAINER > RegisterFeatureContainerTypes< FEATURE, CONTAINER >::s
static const index_type invalid_sub_index