ATLAS Offline Software
Loading...
Searching...
No Matches
TrigComposite.cxx File Reference
#include <stdexcept>
#include "TrigCombinedEvent/TrigComposite.h"
Include dependency graph for TrigComposite.cxx:

Go to the source code of this file.

Macros

#define GEN_(type, varaible)

Functions

MsgStream & operator<< (MsgStream &log, const TrigComposite &d)
 Prints the content of the object.

Macro Definition Documentation

◆ GEN_

#define GEN_ ( type,
varaible )
Value:
template<> std::map<std::string, type>& TrigComposite::detailsMap() { return varaible; } \
template<> const std::map<std::string, type>& TrigComposite::detailsMap() const { return varaible; } \
template<> std::set<std::string>& TrigComposite::detailsMustSetList<type>() { return varaible##ToBeSet; } \
template<> const type& TrigComposite::specimen<type>() const { static const type x{}; return x;} \
template void TrigComposite::addDetail<type>(const std::string&, const type&); \
template void TrigComposite::setDetail<type>(const std::string&, const type&); \
template bool TrigComposite::hasDetail<type>(const std::string& ) const; \
template const type& TrigComposite::getDetail<type>(const std::string& ) const; \
template void TrigComposite::eraseDetail<type>(const std::string& ); \
template void TrigComposite::setFormat<type>(const std::vector<std::string>&, bool ); \
template void TrigComposite::mustSet<type>(const std::string&);
#define x
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.
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)
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()
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 ...
std::map< std::string, T > & detailsMap()

Definition at line 154 of file TrigComposite.cxx.

154#define GEN_(type, varaible) \
155 template<> std::map<std::string, type>& TrigComposite::detailsMap() { return varaible; } \
156 template<> const std::map<std::string, type>& TrigComposite::detailsMap() const { return varaible; } \
157 template<> std::set<std::string>& TrigComposite::detailsMustSetList<type>() { return varaible##ToBeSet; } \
158 template<> const type& TrigComposite::specimen<type>() const { static const type x{}; return x;} \
159 template void TrigComposite::addDetail<type>(const std::string&, const type&); \
160 template void TrigComposite::setDetail<type>(const std::string&, const type&); \
161 template bool TrigComposite::hasDetail<type>(const std::string& ) const; \
162 template const type& TrigComposite::getDetail<type>(const std::string& ) const; \
163 template void TrigComposite::eraseDetail<type>(const std::string& ); \
164 template void TrigComposite::setFormat<type>(const std::vector<std::string>&, bool ); \
165 template void TrigComposite::mustSet<type>(const std::string&);

Function Documentation

◆ operator<<()

MsgStream & operator<< ( MsgStream & log,
const TrigComposite & d )

Prints the content of the object.

Definition at line 198 of file TrigComposite.cxx.

198 {
199 log << "TrigComposite object: " << d.name() << endmsg;
200 print<float> (log, d, "floats");
201 print<int> (log, d, "ints");
202 print<std::string> (log, d, "strings");
203
204
205 print<std::vector<float> > (log, d, "vector of floats") ;
206 print<std::vector<int> > (log, d, "vector of ints");
207 print<std::vector<string> > (log, d, "vector of strings");
208
209 if ( ! d.allDetails<TrigFeatureLink>().empty() ) {
210 typedef std::map<std::string, TrigFeatureLink>::value_type key_value;
211 for( const key_value& kv : d.allDetails<TrigFeatureLink>()) {
212 log << "(" << kv.first << ", " << "CLID:" << kv.second.clid() <<") ";
213 }
214
215 } else {
216 log << "There are no objects assocuiated with this TrigComposite object" << endmsg;
217 }
218
219
220 return log;
221}
#define endmsg
void print(char *figname, TCanvas *c1)