5#ifndef TRIGCOMBINEDEVENT_TRIGCOMPOSITE_H
6#define TRIGCOMBINEDEVENT_TRIGCOMPOSITE_H
13#include "GaudiKernel/ClassID.h"
15#include "GaudiKernel/MsgStream.h"
42 inline const std::string&
name()
const {
return m_name; }
56 void setFormat(
const std::vector<std::string>& keys,
bool mustBeSet=
false);
96 bool hasObject(
const std::string& key)
const;
109 std::vector<TrigFeatureLink>
getObjectsByType(
const std::string& keypart=
"")
const;
118 void addDetail(
const std::string& key,
const T& value=T());
125 void setDetail(
const std::string& key,
const T& value);
133 bool hasDetail(
const std::string& key)
const;
140 const T&
getDetail(
const std::string& key)
const;
174 void mustSet(
const std::string& key);
178 std::map<std::string, TrigFeatureLink >
m_links;
203 const std::map<std::string, T>&
detailsMap()
const;
227 std::vector<TrigFeatureLink>
result;
228 for ( std::map<std::string, TrigFeatureLink>::const_iterator i =
m_links.begin(); i !=
m_links.end(); ++i ) {
229 if ( i->second.clid() == requested_clid and i->first.find(keypart) != std::string::npos)
230 result.push_back(i->second);
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
uint32_t CLID
The Class ID type.
MsgStream & operator<<(MsgStream &m, const TrigComposite &d)
Prints the content of the object.
The class is meant to store links (of type TrigFeatureLink) to trigger objects and arbitrary details ...
MustSetList m_linksToBeSet
const std::map< std::string, T > & allDetails() const
return the map of all the details Notie that the non-const version is not provided because it would a...
bool hasDetail(const std::string &key) const
Checks if the object contains detail of the type T No verification is made if it is set.
void eraseDetail(const std::string &key)
erases the detail if it existed If the details inder that key did not exist, no action is performed.
~TrigComposite()
Destructor, does nothing special in fact, no links are touched.
MustSetList m_intsToBeSet
std::map< std::string, std::vector< int > > m_v_ints
void setFormat(const std::vector< std::string > &keys, bool mustBeSet=false)
defines the content (details which must to be stored) The method can be used to enforce certain conte...
const T & specimen() const
void mustSet(const std::string &key)
bool isValid() const
Checks the validity of the format, i.e.
bool hasObject(const std::string &key) const
checks if the object has link to the object under the key
void lockFormat()
makes further addition of the details impossible
TrigComposite()
Deafault constructor, should not be normally used, needed by the persistency layer.
std::vector< TrigFeatureLink > getObjectsByType(const std::string &keypart="") const
get all links which point to objects of given type
MustSetList m_stringsToBeSet
void unlockFormat()
makes addition of further details possible again
std::map< std::string, std::vector< std::string > > m_v_strings
void setObject(const std::string &key, TrigFeatureLink link)
sets the link
std::map< std::string, float > m_floats
bool isFormatLocked() const
return true if the format can not be further changed (no addDetail can be called)
const TrigFeatureLink & getObject(const std::string &key) const
returns
const T & getDetail(const std::string &key) const
return the value of the detail, if the key is absent the default is returned
void setDetail(const std::string &key, const T &value)
sets the value user the key, if they detail under that key already exists it's value is overwritten,...
MustSetList & detailsMustSetList()
MustSetList m_v_intsToBeSet
MustSetList m_v_stringsToBeSet
std::map< std::string, int > m_ints
void addDetail(const std::string &key, const T &value=T())
adds the value user the key, if they detail under that key already exists the exception is thrown If ...
const std::string & name() const
MustSetList m_v_floatsToBeSet
std::map< std::string, TrigFeatureLink > m_links
std::map< std::string, T > & detailsMap()
std::set< std::string > MustSetList
std::map< std::string, std::string > m_strings
MustSetList m_floatsToBeSet
std::map< std::string, std::vector< float > > m_v_floats
TrigComposite(const std::string &name)
Constructs empty composite, no objects no details.
void addObject(const std::string &key, TrigFeatureLink link)
adds the link