The Gaudi Framework  v30r3 (a5ef0a68)
Gaudi::Utils Namespace Reference

Namespaces

 Histos
 Collection of useful utilities for manipulations with AIDA hisgograms.
 
 QuasiRandom
 
 RegEx
 RegeEx: nemspace to hold gaudi regular expression checking.
 

Classes

struct  _GetType
 Helper structure to define the proper return type for "get"-functions. More...
 
struct  _GetType< Gaudi::NamedRange_< CONTAINER > >
 the template specialization for "named ranges" More...
 
struct  _GetType< Gaudi::Range_< CONTAINER > >
 the template specialization for "ranges" More...
 
struct  _GetType< TYPE & >
 the template specialization for references More...
 
struct  _GetType< TYPE * >
 the template specialization for pointers More...
 
class  Aida2ROOT
 Accessor to underlying ROOT-representation of transient histograms The actual code is imported from Bender project. More...
 
class  AlgContext
 Helper "sentry" class to automatize the safe register/unregister the algorithm's context. More...
 
class  AlgNameSelector
 The trivial selector of algorithm by type. More...
 
class  AlgSelector
 Simple interface class for selection of algorithms. More...
 
class  AlgTypeSelector
 The trivial selector of algorithm by type. More...
 
class  AttribStringParser
 Parse attribute strings allowing iteration over the various attributes. More...
 
struct  CheckData
 Helper structure for implementation of "exists"-functions for GaudiCommon<BASE> More...
 
struct  CheckData< const TYPE >
 the template specialization for 'const'-type More...
 
struct  CheckData< Gaudi::NamedRange_< std::vector< const TYPE * > > >
 the template specialization for ranges More...
 
struct  CheckData< Gaudi::Range_< std::vector< const TYPE * > > >
 the template specialization for ranges More...
 
struct  CheckData< TYPE & >
 the template specialization for reference types More...
 
struct  CheckData< TYPE * >
 the template specialization for pointer types More...
 
struct  GetData
 Helper structure for implementation of "get"-functions for GaudiCommon<BASE> More...
 
struct  GetData< const TYPE >
 the template specialization for const types More...
 
struct  GetData< Gaudi::NamedRange_< std::vector< const TYPE * > > >
 the template specialization for named ranges More...
 
struct  GetData< Gaudi::Range_< std::vector< const TYPE * > > >
 the template specialization for ranges More...
 
struct  GetData< TYPE & >
 the template specialization for reference types More...
 
struct  GetData< TYPE * >
 the template specialization for pointer types More...
 
struct  GetOrCreateData
 Helper structure for implementation of "getOrCreate"-functions for GaudiCommon<BASE> More...
 
struct  GetOrCreateData< const TYPE, const TYPE2 >
 
struct  GetOrCreateData< const TYPE, TYPE2 >
 
struct  GetOrCreateData< Gaudi::NamedRange_< std::vector< const TYPE * > >, TYPE2 >
 
struct  GetOrCreateData< Gaudi::Range_< std::vector< const TYPE * > >, TYPE2 >
 
struct  GetOrCreateData< TYPE &, TYPE2 & >
 
struct  GetOrCreateData< TYPE &, TYPE2 >
 
struct  GetOrCreateData< TYPE *, TYPE2 * >
 
struct  GetOrCreateData< TYPE *, TYPE2 >
 
struct  GetOrCreateData< TYPE, const TYPE2 >
 
struct  GetOrCreateData< TYPE, TYPE2 & >
 
struct  GetOrCreateData< TYPE, TYPE2 * >
 
class  HistoStats
 The collection of trivial functions to access the statistical information for the histograms. More...
 
class  LockedChrono
 Helper object, useful for measurement of CPU-performance of highly-recursive structures, e.g. More...
 
class  MapBase
 Helper base-class to allow the generic Python-decoration for all "map-like" classes in Gaudi. More...
 
class  SignalMonitorSvc
 Implementation of Gaudi::ISignalMonitor. More...
 
class  StopSignalHandler
 Service that stop the processing if a signal is received. More...
 
struct  TuplePrinter
 
struct  TuplePrinter< Tuple, 1 >
 
class  TypeNameString
 Helper class to parse a string of format "type/name". More...
 

Functions

GAUDI_API IAlgorithmgetAlgorithm (const IAlgContextSvc *svc, const AlgSelector &sel)
 simple function to get the algorithm from Context Service More...
 
GAUDI_API IAlgorithmgetAlgorithm (const std::vector< IAlgorithm * > &lst, const AlgSelector &sel)
 simple function to get the algorithm from Context Service More...
 
GAUDI_API GaudiAlgorithmgetGaudiAlg (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiAlgorithm from the context More...
 
GAUDI_API GaudiHistoAlggetHistoAlg (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiHistoAlg from the context More...
 
GAUDI_API GaudiTupleAlggetTupleAlg (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiTupleAlg from the context More...
 
GAUDI_API GaudiSequencergetGaudiSequencer (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiSequencer from the context More...
 
GAUDI_API SequencergetSequencerAlg (const IAlgContextSvc *svc)
 simple function to extract the last active Sequencer from the context More...
 
GAUDI_API IAlgorithmgetSequencer (const IAlgContextSvc *svc)
 simple function to extract the last active "Sequencer" () GaudiSequencer or simple Sequencer) from the context More...
 
template<class TYPE , std::enable_if_t<!std::is_constructible< TYPE >::value, void * > = nullptr>
_GetType< TYPE >::return_type getFromTS (IDataProviderSvc *service, const std::string &location)
 Helper function to provide the minimal lookup and cast functionality of SmartDataPtr used in the helper classes. More...
 
AttribStringParser::Iterator begin (const AttribStringParser &parser)
 
AttribStringParser::Iterator end (const AttribStringParser &)
 
template<class ITERATOR >
std::ostreamtoStream (ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
 the helper function to print the sequence More...
 
template<class TYPE , std::size_t N>
std::ostreamtoStream (const boost::array< TYPE, N > &obj, std::ostream &s)
 printout of class boost::array The format is "Python's tuple" More...
 
GAUDI_API std::ostreamtoStream (const DataObjectHandleBase &v, std::ostream &o)
 
GAUDI_API bool hasProperty (const IProperty *p, const std::string &name)
 simple function which check the existence of the property with the given name. More...
 
GAUDI_API bool hasProperty (const IInterface *p, const std::string &name)
 simple function which check the existence of the property with the given name. More...
 
GAUDI_API Gaudi::Details::PropertyBasegetProperty (const IProperty *p, const std::string &name)
 simple function which gets the property with given name from the component More...
 
GAUDI_API Gaudi::Details::PropertyBasegetProperty (const IInterface *p, const std::string &name)
 simple function which gets the property with given name from the component More...
 
GAUDI_API bool hasProperty (const std::vector< const Gaudi::Details::PropertyBase * > *p, const std::string &name)
 check the property by name from the list of the properties More...
 
GAUDI_API const Gaudi::Details::PropertyBasegetProperty (const std::vector< const Gaudi::Details::PropertyBase * > *p, const std::string &name)
 get the property by name from the list of the properties More...
 
template<class TYPE >
StatusCode setProperty (IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
 simple function to set the property of the given object from the value More...
 
template<class TYPE >
StatusCode setProperty (IProperty *component, const std::string &name, const TYPE &value)
 simple function to set the property of the given object from the value More...
 
GAUDI_API StatusCode setProperty (IProperty *component, const std::string &name, const std::string &value, const std::string &doc="")
 the full specialization of the previous method setProperty( IProperty, std::string, const TYPE&) for standard strings More...
 
GAUDI_API StatusCode setProperty (IProperty *component, const std::string &name, const char *value, const std::string &doc="")
 the full specialization of the method setProperty( IProperty, std::string, const TYPE&) for C-strings More...
 
template<unsigned N>
StatusCode setProperty (IProperty *component, const std::string &name, const char(&value)[N], const std::string &doc="")
 the full specialization of the method setProperty( IProperty, std::string, const TYPE&) for C-arrays More...
 
GAUDI_API StatusCode setProperty (IProperty *component, const std::string &name, const Gaudi::Details::PropertyBase *property, const std::string &doc="")
 simple function to set the property of the given object from another property More...
 
GAUDI_API StatusCode setProperty (IProperty *component, const std::string &name, const Gaudi::Details::PropertyBase &property, const std::string &doc="")
 simple function to set the property of the given object from another property More...
 
template<class TYPE >
StatusCode setProperty (IProperty *component, const std::string &name, const Gaudi::Property< TYPE > &value, const std::string &doc="")
 simple function to set the property of the given object from another property More...
 
template<class TYPE >
StatusCode setProperty (IInterface *component, const std::string &name, const TYPE &value, const std::string &doc="")
 simple function to set the property of the given object from the value More...
 
GAUDI_API StatusCode setProperty (IInterface *component, const std::string &name, const std::string &value, const std::string &doc="")
 the full specialization of the method setProperty( IInterface , std::string, const TYPE&) for standard strings More...
 
GAUDI_API StatusCode setProperty (IInterface *component, const std::string &name, const char *value, const std::string &doc="")
 the full specialization of the method setProperty( IInterface , std::string, const TYPE&) for C-strings More...
 
template<unsigned N>
StatusCode setProperty (IInterface *component, const std::string &name, const char(&value)[N], const std::string &doc="")
 the full specialization of the method setProperty( IInterface, std::string, const TYPE&) for C-arrays More...
 
GAUDI_API StatusCode setProperty (IInterface *component, const std::string &name, const Gaudi::Details::PropertyBase *property, const std::string &doc="")
 simple function to set the property of the given object from another property More...
 
GAUDI_API StatusCode setProperty (IInterface *component, const std::string &name, const Gaudi::Details::PropertyBase &property, const std::string &doc="")
 simple function to set the property of the given object from another property More...
 
template<class TYPE >
StatusCode setProperty (IInterface *component, const std::string &name, const Gaudi::Property< TYPE > &value, const std::string &doc="")
 simple function to set the property of the given object from another property More...
 
bool iequal (const std::string &v1, const std::string &v2)
 Helper for case insensitive string comparison. More...
 
GAUDI_API std::ostreamtoStream (const Gaudi::StringKey &key, std::ostream &s)
 send the object to stream (needed to use it as property) More...
 
template<class SCALAR >
std::ostreamtoStream (const SCALAR &, std::ostream &)
 
template<class SCALAR , unsigned int N>
std::ostreamtoStream (const ROOT::Math::SVector< SCALAR, N > &obj, std::ostream &s)
 the general streaming function for SVector using python-tupel format More...
 
template<class TYPE >
std::ostreamtoStream (const TYPE &obj, std::ostream &s)
 the generic implementation of the printout to the std::ostream More...
 
std::ostreamtoStream (const std::string &obj, std::ostream &s)
 the printtout of the strings. More...
 
std::ostreamtoStream (const bool obj, std::ostream &s)
 the printout of boolean values "a'la Python" More...
 
std::ostreamtoStream (const float obj, std::ostream &s, const int prec=6)
 the printout of float values with the reasonable precision More...
 
std::ostreamtoStream (const double obj, std::ostream &s, const int prec=8)
 the printout of double values with the reasonable precision More...
 
std::ostreamtoStream (const long double obj, std::ostream &s, const int prec=10)
 the printout of long double values with the reasonable precision More...
 
template<class KTYPE , class VTYPE >
std::ostreamtoStream (const std::pair< KTYPE, VTYPE > &obj, std::ostream &s)
 the partial template specialization of std::pair<KTYPE,VTYPE> printout the pair is printed a'la Python tuple: " ( a , b )" More...
 
template<class TYPE , class ALLOCATOR >
std::ostreamtoStream (const std::vector< TYPE, ALLOCATOR > &obj, std::ostream &s)
 the partial template specialization of std::vector<TYPE,ALLOCATOR> printout. More...
 
template<class TYPE , class ALLOCATOR >
std::ostreamtoStream (const std::list< TYPE, ALLOCATOR > &obj, std::ostream &s)
 the partial template specialization of std::list<TYPE,ALLOCATOR> printout. More...
 
template<class TYPE , class CMP , class ALLOCATOR >
std::ostreamtoStream (const std::set< TYPE, CMP, ALLOCATOR > &obj, std::ostream &s)
 the partial template specialization of std::set<TYPE,CMP,ALLOCATOR> printout. More...
 
template<class TYPE , class HASH , class CMP , class ALLOCATOR >
std::ostreamtoStream (const std::unordered_set< TYPE, HASH, CMP, ALLOCATOR > &obj, std::ostream &s)
 the partial template specialization of std::unordered_set<TYPE,HASH,CMP,ALLOCATOR> printout. More...
 
template<class KTYPE , class VTYPE , class CMP , class ALLOCATOR >
std::ostreamtoStream (const std::map< KTYPE, VTYPE, CMP, ALLOCATOR > &obj, std::ostream &s)
 the partial template specialization of std::map<KTYPE,VTYPE,CMP,ALLOCATOR> printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )" More...
 
template<class KTYPE , class VTYPE , class CMP , class ALLOCATOR >
std::ostreamtoStream (const GaudiUtils::VectorMap< KTYPE, VTYPE, CMP, ALLOCATOR > &obj, std::ostream &s)
 the partial template specialization of GaudiUtils::VectorMap<KTYPE,VTYPE,CMP,ALLOCATOR> printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )" More...
 
template<class KTYPE , class VTYPE , class MAP >
std::ostreamtoStream (const GaudiUtils::Map< KTYPE, VTYPE, MAP > &obj, std::ostream &s)
 the partial template specialization of GaudiUtils::Map<KTYPE,VTYPE,MAP> printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )" More...
 
template<class KTYPE , class VTYPE , class HASH , class MAP >
std::ostreamtoStream (const GaudiUtils::HashMap< KTYPE, VTYPE, HASH, MAP > &obj, std::ostream &s)
 the partial template specialization of GaudiUtils::HashMap<KTYPE,VTYPE,HASH,MAP> printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )" More...
 
template<class TYPE , unsigned int N>
std::ostreamtoStream (const TYPE(&obj)[N], std::ostream &s)
 the specialization for C-arrays, a'la python tuple More...
 
template<class TYPE , std::size_t N>
std::ostreamtoStream (const std::array< TYPE, N > &obj, std::ostream &s)
 the specialization for std::array, a'la python tuple More...
 
template<unsigned int N>
std::ostreamtoStream (const char(&obj)[N], std::ostream &s)
 the specialization for C-string, a'la python tuple More...
 
std::ostreamtoStream (const char *obj, std::ostream &s)
 the specialization for C-string, a'la python tuple More...
 
template<typename... Args>
std::ostreamtoStream (const std::tuple< Args... > &tuple, std::ostream &s)
 the helper function to print the tuple More...
 
template<class TYPE >
std::string toString (const TYPE &obj)
 the generic implementation of the type conversion to the string More...
 
std::ostreamoperator<< (std::ostream &s, const TypeNameString &tn)
 Output stream operator for TypeNameString instances. More...
 
GAUDI_API std::ostreamtoStream (const Gaudi::XYZPoint &obj, std::ostream &s)
 print XYZ point More...
 
GAUDI_API std::ostreamtoStream (const Gaudi::XYZVector &obj, std::ostream &s)
 print XYZ vector More...
 
GAUDI_API std::ostreamtoStream (const Gaudi::LorentzVector &obj, std::ostream &s)
 print Lorentz vector More...
 
GAUDI_API std::ostreamtoStream (const TH1D &histo, std::ostream &stream, const bool asXML=false)
 stream the ROOT histogram into output stream More...
 
GAUDI_API std::ostreamtoStream (const TH2D &histo, std::ostream &stream, const bool asXML=false)
 stream the ROOT histogram into output stream More...
 
GAUDI_API std::ostreamtoStream (const TH1F &histo, std::ostream &stream, const bool asXML=false)
 stream the ROOT histogram into output stream More...
 
GAUDI_API std::ostreamtoStream (const TH2F &histo, std::ostream &stream, const bool asXML=false)
 stream the ROOT histogram into output stream More...
 
GAUDI_API std::ostreamtoStream (const AIDA::IHistogram1D &histo, std::ostream &stream, const bool asXML=false)
 stream the AIDA histogram into output stream More...
 
GAUDI_API std::ostreamtoStream (const AIDA::IHistogram2D &histo, std::ostream &stream, const bool asXML=false)
 stream the AIDA histogram into output stream More...
 
GAUDI_API std::string toString (const TH1D &histo, const bool asXML=false)
 convert the histogram into the string More...
 
GAUDI_API std::string toString (const TH2D &histo, const bool asXML=false)
 convert the histogram into the string More...
 
GAUDI_API std::string toString (const TH1F &histo, const bool asXML=false)
 convert the histogram into the string More...
 
GAUDI_API std::string toString (const TH2F &histo, const bool asXML=false)
 convert the histogram into the string More...
 
GAUDI_API std::string toString (const AIDA::IHistogram1D &histo, const bool asXML=false)
 convert the histogram into the string More...
 
GAUDI_API std::string toString (const AIDA::IHistogram2D &histo, const bool asXML=false)
 convert the histogram into the string More...
 
GAUDI_API std::string toString (const AIDA::IHistogram1D *histo)
 convert the histogram into the string More...
 
GAUDI_API std::string toString (AIDA::IHistogram1D *histo)
 convert the histogram into the string More...
 
GAUDI_API std::string toString (const TH1D *histo)
 convert the histogram into the string More...
 
GAUDI_API std::string toString (TH1D *histo)
 convert the histogram into the string More...
 
GAUDI_API std::string toString (const TH2D *histo)
 convert the histogram into the string More...
 
GAUDI_API std::string toString (TH2D *histo)
 convert the histogram into the string More...
 

Function Documentation

AttribStringParser::Iterator Gaudi::Utils::begin ( const AttribStringParser parser)
inline

Definition at line 129 of file AttribStringParser.h.

130  {
131  return AttribStringParser::Iterator( parser.parse(), parser.m_expandVars );
132  }
boost::spirit::classic::position_iterator2< ForwardIterator > Iterator
Definition: Iterator.h:18
AttribStringParser::Iterator Gaudi::Utils::end ( const AttribStringParser )
inline

Definition at line 133 of file AttribStringParser.h.

134  {
136  }
boost::spirit::classic::position_iterator2< ForwardIterator > Iterator
Definition: Iterator.h:18
IAlgorithm * Gaudi::Utils::getAlgorithm ( const IAlgContextSvc svc,
const AlgSelector sel 
)

simple function to get the algorithm from Context Service

// get the selector
const AlgSelector& selector = ... ;
// get the context service:
const IAlgContextSvc* svc = ... ;
// get the appropriate algorithm:
IAlgorithm* alg = getAlgorithm ( svc , selector ) ;
See also
IAlgContextSvc
Gaudi::Utils::AlgSelector
Parameters
svcpointer to Algororithm Contetx Service
selthe selection functor
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-09-07

Definition at line 24 of file GetAlg.cpp.

25 {
26  return svc ? getAlgorithm( svc->algorithms(), sel ) : nullptr;
27 }
sel
Definition: IOTest.py:95
GAUDI_API IAlgorithm * getAlgorithm(const IAlgContextSvc *svc, const AlgSelector &sel)
simple function to get the algorithm from Context Service
Definition: GetAlg.cpp:24
virtual const Algorithms & algorithms() const =0
get the stack of executed algorithms
IAlgorithm * Gaudi::Utils::getAlgorithm ( const std::vector< IAlgorithm * > &  lst,
const AlgSelector sel 
)

simple function to get the algorithm from Context Service

// get the selector
const AlgSelector& selector = ... ;
// get the list of algorithms:
const std::vector<IAlgorithm*>& algs = ... ;
// get the appropriate algorithm:
IAlgorithm* alg = getAlgorithm ( algs , selector ) ;
See also
IAlgContextSvc
Gaudi::Utils::AlgSelector
Parameters
lstlist of the algorithms
selthe selection functor
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-09-07

Definition at line 31 of file GetAlg.cpp.

32 {
33  auto it = std::find_if( lst.rbegin(), lst.rend(), std::cref( sel ) );
34  return it != lst.rend() ? *it : nullptr;
35 }
T rend(T...args)
sel
Definition: IOTest.py:95
T find_if(T...args)
T cref(T...args)
T rbegin(T...args)
template<class TYPE , std::enable_if_t<!std::is_constructible< TYPE >::value, void * > = nullptr>
_GetType< TYPE >::return_type Gaudi::Utils::getFromTS ( IDataProviderSvc service,
const std::string location 
)
inline

Helper function to provide the minimal lookup and cast functionality of SmartDataPtr used in the helper classes.

This version is dealing with the general case, where AnyDataWrapper cannot be used

This version allows the use of AnyDataWrapper but restricts to the case where TYPE is constructible

Definition at line 71 of file GetData.h.

72  {
73  DataObject* obj = nullptr;
74  // Return the casted pointer if the retrieve was successful or nullptr otherwise.
75  StatusCode sc = service->retrieveObject( location, obj );
76  if ( sc.isSuccess() ) {
77  typename _GetType<TYPE>::return_type tobj = dynamic_cast<typename _GetType<TYPE>::return_type>( obj );
78  return tobj;
79  } else {
80  return nullptr;
81  }
82  }
bool isSuccess() const
Definition: StatusCode.h:287
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
GaudiAlgorithm * Gaudi::Utils::getGaudiAlg ( const IAlgContextSvc svc)

simple function to extract the last active GaudiAlgorithm from the context

// get the context service:
const IAlgContextSvc* svc = ... ;
GaudiAlgorithm* ga = getGaudiAlg ( svc ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-09-07

Definition at line 65 of file GetAlgs.cpp.

65 { return getAlg<GaudiAlgorithm>( svc ); }
GaudiSequencer * Gaudi::Utils::getGaudiSequencer ( const IAlgContextSvc svc)

simple function to extract the last active GaudiSequencer from the context

// get the context service:
const IAlgContextSvc* svc = ... ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-09-07

Definition at line 119 of file GetAlgs.cpp.

119 { return getAlg<GaudiSequencer>( svc ); }
GaudiHistoAlg * Gaudi::Utils::getHistoAlg ( const IAlgContextSvc svc)

simple function to extract the last active GaudiHistoAlg from the context

// get the context service:
const IAlgContextSvc* svc = ... ;
GaudiHistoAlg* ha = getHistoAlg ( svc ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-09-07

Definition at line 83 of file GetAlgs.cpp.

83 { return getAlg<GaudiHistoAlg>( svc ); }
PropertyBase * Gaudi::Utils::getProperty ( const IProperty p,
const std::string name 
)

simple function which gets the property with given name from the component

const IProperty* p = ... ;
const Gaudi::Details::PropertyBase* pro = getProperty( p , "Context" ) ;
Parameters
ppointer to IProperty object
nameproperty name (case insensitive)
Returns
property with the given name (if exists), NULL otherwise
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-09-09

Definition at line 223 of file Property.cpp.

224 {
225  // trivial check
226  if ( !p ) {
227  return nullptr;
228  } // RETURN
229  // get all properties
230  const auto& props = p->getProperties();
231  // comparison criteria:
232  auto ifound = std::find_if( props.begin(), props.end(), is_iByName{name} );
233  return ifound != props.end() ? *ifound : nullptr;
234 }
virtual const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const =0
Get list of properties.
T find_if(T...args)
PropertyBase * Gaudi::Utils::getProperty ( const IInterface p,
const std::string name 
)

simple function which gets the property with given name from the component

const IInterface* p = ... ;
const Gaudi::Details::PropertyBase* pro = getProperty( p , "Context" ) ;
Parameters
ppointer to IInterface object
nameproperty name (case insensitive)
Returns
property with the given name (if exists), NULL otherwise
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-09-09

Definition at line 254 of file Property.cpp.

255 {
256  // trivial check
257  if ( !p ) {
258  return nullptr;
259  } // RETURN
260  // remove const-qualifier
261  IInterface* _i = const_cast<IInterface*>( p );
262  if ( !_i ) {
263  return nullptr;
264  } // RETURN
266  return property ? getProperty( property, name ) : nullptr;
267 }
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition of the basic interface.
Definition: IInterface.h:277
GAUDI_API Gaudi::Details::PropertyBase * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Definition: Property.cpp:223
const PropertyBase * Gaudi::Utils::getProperty ( const std::vector< const Gaudi::Details::PropertyBase * > *  p,
const std::string name 
)

get the property by name from the list of the properties

IJobOptionsSvc* svc = ... ;
const std::string client = ... ;
// get the property:
getProperty ( svc->getProperties( client ) , "Context" )
See also
IJobOptionsSvc
Parameters
plist of properties
nameproperty name (case insensitive)
Returns
property with the given name (if exists), NULL otherwise
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-09-09

Definition at line 320 of file Property.cpp.

321 {
322  // trivial check
323  if ( !p ) {
324  return nullptr;
325  } // RETURN
326  auto ifound = std::find_if( p->begin(), p->end(), is_iByName{name} );
327  return p->end() != ifound ? *ifound : nullptr; // RETURN
328 }
T end(T...args)
T find_if(T...args)
T begin(T...args)
IAlgorithm * Gaudi::Utils::getSequencer ( const IAlgContextSvc svc)

simple function to extract the last active "Sequencer" () GaudiSequencer or simple Sequencer) from the context

// get the context service:
const IAlgContextSvc* svc = ... ;
IAlgorithm* a = getSequencer ( svc ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-09-07

Definition at line 155 of file GetAlgs.cpp.

156 {
157  if ( !svc ) {
158  return nullptr;
159  } // RETURN
160  //
161  AlgTypeSelector<GaudiSequencer> sel1;
162  AlgTypeSelector<Sequencer> sel2;
163 
164  const auto& algs = svc->algorithms();
165  auto a = std::find_if( algs.rbegin(), algs.rend(), [&]( IAlgorithm* alg ) { return sel1( alg ) || sel2( alg ); } );
166  return a != algs.rend() ? *a : nullptr;
167 }
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
virtual const Algorithms & algorithms() const =0
get the stack of executed algorithms
T find_if(T...args)
Sequencer * Gaudi::Utils::getSequencerAlg ( const IAlgContextSvc svc)

simple function to extract the last active Sequencer from the context

// get the context service:
const IAlgContextSvc* svc = ... ;
Sequencer* sa = getSequencerAlg ( svc ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-09-07

Definition at line 136 of file GetAlgs.cpp.

136 { return getAlg<Sequencer>( svc ); }
GaudiTupleAlg * Gaudi::Utils::getTupleAlg ( const IAlgContextSvc svc)

simple function to extract the last active GaudiTupleAlg from the context

// get the context service:
const IAlgContextSvc* svc = ... ;
GaudiTupleAlg* ta = getTupleAlg ( svc ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-09-07

Definition at line 101 of file GetAlgs.cpp.

101 { return getAlg<GaudiTupleAlg>( svc ); }
bool Gaudi::Utils::hasProperty ( const IProperty p,
const std::string name 
)

simple function which check the existence of the property with the given name.

const IProperty* p = ... ;
const bool = hasProperty( p , "Context" ) ;
Parameters
ppointer to IProperty object
nameproperty name (case insensitive)
Returns
true if "p" has a property with such name
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-09-09

Definition at line 100 of file Property.cpp.

101 {
102  // delegate the actual work to another method ;
103  return p && getProperty( p, name );
104 }
GAUDI_API Gaudi::Details::PropertyBase * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Definition: Property.cpp:223
bool Gaudi::Utils::hasProperty ( const IInterface p,
const std::string name 
)

simple function which check the existence of the property with the given name.

IInterface* p = .
const bool = hasProperty( p , "Context" ) ;
Parameters
ppointer to IInterface object (any component)
nameproperty name (case insensitive)
Returns
true if "p" has a property with such name
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-09-09

Definition at line 76 of file Property.cpp.

77 {
78  // delegate to another method after trivial check
79  return p && getProperty( p, name );
80 }
GAUDI_API Gaudi::Details::PropertyBase * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Definition: Property.cpp:223
bool Gaudi::Utils::hasProperty ( const std::vector< const Gaudi::Details::PropertyBase * > *  p,
const std::string name 
)

check the property by name from the list of the properties

IJobOptionsSvc* svc = ... ;
const std::string client = ... ;
// get the property:
bool context =
hasProperty ( svc->getProperties( client ) , "Context" )
See also
IJobOptionsSvc
Parameters
plist of properties
nameproperty name (case insensitive)
Returns
true if the property exists
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-09-09

Definition at line 292 of file Property.cpp.

293 {
294  // delegate to another method
295  return getProperty( p, name );
296 }
GAUDI_API Gaudi::Details::PropertyBase * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Definition: Property.cpp:223
bool Gaudi::Utils::iequal ( const std::string v1,
const std::string v2 
)
inline

Helper for case insensitive string comparison.

Definition at line 49 of file PropertyHolder.h.

50  {
51  return v1.size() == v2.size() && std::equal( std::begin( v1 ), std::end( v1 ), std::begin( v2 ),
52  []( char c1, char c2 ) { return toupper( c1 ) == toupper( c2 ); } );
53  }
T end(T...args)
T size(T...args)
T begin(T...args)
T equal(T...args)
void toupper(std::string &s)
std::ostream& Gaudi::Utils::operator<< ( std::ostream s,
const TypeNameString tn 
)
inline

Output stream operator for TypeNameString instances.

Definition at line 49 of file TypeNameString.h.

50  {
51  return s << tn.type() << '/' << tn.name();
52  }
template<class TYPE >
StatusCode Gaudi::Utils::setProperty ( IProperty component,
const std::string name,
const TYPE &  value,
const std::string doc 
)

simple function to set the property of the given object from the value

IProperty* component = ... ;
std::vector<double> data = ... ;
StatusCode sc = setProperty ( componet , "Data" , data ) ;

Note: the interface IProperty allows setting of the properties either directly from other properties or from strings only

Parameters
componentcomponent which needs to be configured
namename of the property
valuevalue of the property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13
IProperty* component = ... ;
std::vector<double> data = ... ;
StatusCode sc = setProperty ( component , "Data" , data ) ;
sc = setProperty ( component , "Cuts" , cuts ) ;
sc = setProperty ( component , "Dictionary" , dict ) ;

Note: the native interface IProperty allows setting of the properties either directly from other properties or from strings only

Parameters
componentcomponent which needs to be configured
namename of the property
valuevalue of the property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 1243 of file Property.h.

1244  {
1245  using Gaudi::Utils::toString;
1246  return component && hasProperty( component, name )
1247  ? Gaudi::Utils::setProperty( component, name, toString( value ), doc )
1248  : StatusCode::FAILURE;
1249  }
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1243
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:356
bool hasProperty(const std::string &name) const override
Return true if we have a property with the given name.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
std::string toString(const Type &)
template<class TYPE >
StatusCode Gaudi::Utils::setProperty ( IProperty component,
const std::string name,
const TYPE &  value 
)

simple function to set the property of the given object from the value

IProperty* component = ... ;
std::vector<double> data = ... ;
StatusCode sc = setProperty ( componet , "Data" , data ) ;

Note: the interface IProperty allows setting of the properties either directly from other properties or from strings only

Parameters
componentcomponent which needs to be configured
namename of the property
valuevalue of the property
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 1155 of file Property.h.

1156  {
1157  return setProperty( component, name, value, std::string() );
1158  }
STL class.
StatusCode setProperty(IInterface *component, const std::string &name, const Gaudi::Property< TYPE > &value, const std::string &doc="")
simple function to set the property of the given object from another property
Definition: Property.h:1483
StatusCode Gaudi::Utils::setProperty ( IProperty component,
const std::string name,
const std::string value,
const std::string doc = "" 
)

the full specialization of the previous method setProperty( IProperty, std::string, const TYPE&) for standard strings

Parameters
componentcomponent which needs to be configured
namename of the property
valuevalue of the property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 363 of file Property.cpp.

365 {
366  if ( !component ) {
367  return StatusCode::FAILURE;
368  } // RETURN
369  if ( !hasProperty( component, name ) ) {
370  return StatusCode::FAILURE;
371  }
372  StatusCode sc = component->setProperty( name, value );
373  if ( !doc.empty() ) {
374  PropertyBase* p = getProperty( component, name );
375  if ( p ) {
376  p->setDocumentation( doc );
377  }
378  }
379  sc.ignore();
380  return sc;
381 }
constexpr static const auto FAILURE
Definition: StatusCode.h:88
T empty(T...args)
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:92
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
bool hasProperty(const std::string &name) const override
Return true if we have a property with the given name.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:165
GAUDI_API Gaudi::Details::PropertyBase * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Definition: Property.cpp:223
StatusCode Gaudi::Utils::setProperty ( IProperty component,
const std::string name,
const char *  value,
const std::string doc = "" 
)

the full specialization of the method setProperty( IProperty, std::string, const TYPE&) for C-strings

Parameters
componentcomponent which needs to be configured
namename of the property
valuevalue of the property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 344 of file Property.cpp.

346 {
347  return Gaudi::Utils::setProperty( component, name, std::string{value}, doc );
348 }
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1243
STL class.
template<unsigned N>
StatusCode Gaudi::Utils::setProperty ( IProperty component,
const std::string name,
const char(&)  value[N],
const std::string doc = "" 
)

the full specialization of the method setProperty( IProperty, std::string, const TYPE&) for C-arrays

Parameters
componentcomponent which needs to be configured
namename of the property
valuevalue of the property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 1206 of file Property.h.

1208  {
1209  return component ? setProperty( component, name, std::string( value, value + N ), doc ) : StatusCode::FAILURE;
1210  }
STL class.
int N
Definition: IOTest.py:101
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
StatusCode setProperty(IInterface *component, const std::string &name, const Gaudi::Property< TYPE > &value, const std::string &doc="")
simple function to set the property of the given object from another property
Definition: Property.h:1483
StatusCode Gaudi::Utils::setProperty ( IProperty component,
const std::string name,
const Gaudi::Details::PropertyBase property,
const std::string doc = "" 
)

simple function to set the property of the given object from another property

IProperty* component = ... ;
const Gaudi::Details::PropertyBase* prop = ... ;
StatusCode sc = setProperty ( component , "Data" , prop ) ;
Parameters
componentcomponent which needs to be configured
namename of the property
propertythe property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 405 of file Property.cpp.

407 {
408  if ( !component || !property ) return StatusCode::FAILURE;
409  PropertyBase* p = getProperty( component, name );
410  if ( !p || !p->assign( *property ) ) return StatusCode::FAILURE;
411  if ( !doc.empty() ) {
412  p->setDocumentation( doc );
413  }
414  return StatusCode::SUCCESS;
415 }
constexpr static const auto FAILURE
Definition: StatusCode.h:88
T empty(T...args)
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:92
virtual bool assign(const PropertyBase &source)=0
import the property value form the source
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
GAUDI_API Gaudi::Details::PropertyBase * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Definition: Property.cpp:223
StatusCode Gaudi::Utils::setProperty ( IProperty component,
const std::string name,
const Gaudi::Details::PropertyBase property,
const std::string doc = "" 
)

simple function to set the property of the given object from another property

IProperty* component = ... ;
const Gaudi::Details::PropertyBase& prop = ... ;
StatusCode sc = setProperty ( component , "Data" , prop ) ;
Parameters
componentcomponent which needs to be configured
namename of the property
propertythe property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 439 of file Property.cpp.

441 {
442  return setProperty( component, name, &property, doc );
443 }
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1243
template<class TYPE >
StatusCode Gaudi::Utils::setProperty ( IProperty component,
const std::string name,
const Gaudi::Property< TYPE > &  value,
const std::string doc = "" 
)

simple function to set the property of the given object from another property

IProperty* component = ... ;
StatusCode sc = setProperty ( component , "Data" , prop ) ;
Parameters
componentcomponent which needs to be configured
namename of the property
valuethe property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 1322 of file Property.h.

1324  {
1325  return setProperty( component, name, &value, doc );
1326  }
StatusCode setProperty(IInterface *component, const std::string &name, const Gaudi::Property< TYPE > &value, const std::string &doc="")
simple function to set the property of the given object from another property
Definition: Property.h:1483
template<class TYPE >
StatusCode Gaudi::Utils::setProperty ( IInterface component,
const std::string name,
const TYPE &  value,
const std::string doc = "" 
)

simple function to set the property of the given object from the value

IInterface* component = ... ;
std::vector<double> data = ... ;
StatusCode sc = setProperty ( component , "Data" , data ) ;
Parameters
componentcomponent which needs to be configured
namename of the property
valuevalue of the property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 1349 of file Property.h.

1351  {
1352  if ( !component ) {
1353  return StatusCode::FAILURE;
1354  }
1355  auto property = SmartIF<IProperty>{component};
1356  return property ? setProperty( property, name, value, doc ) : StatusCode::FAILURE;
1357  }
constexpr static const auto FAILURE
Definition: StatusCode.h:88
Gaudi::Details::PropertyBase * property(const std::string &name) const
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
StatusCode setProperty(IInterface *component, const std::string &name, const Gaudi::Property< TYPE > &value, const std::string &doc="")
simple function to set the property of the given object from another property
Definition: Property.h:1483
StatusCode Gaudi::Utils::setProperty ( IInterface component,
const std::string name,
const std::string value,
const std::string doc = "" 
)

the full specialization of the method setProperty( IInterface , std::string, const TYPE&) for standard strings

Parameters
componentcomponent which needs to be configured
namename of the property
valuevalue of the property
docthe new documentation string
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 458 of file Property.cpp.

460 {
461  if ( !component ) {
462  return StatusCode::FAILURE;
463  }
464  SmartIF<IProperty> property( component );
465  return property ? setProperty( property, name, value, doc ) : StatusCode::FAILURE;
466 }
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1243
constexpr static const auto FAILURE
Definition: StatusCode.h:88
Gaudi::Details::PropertyBase * property(const std::string &name) const
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
StatusCode Gaudi::Utils::setProperty ( IInterface component,
const std::string name,
const char *  value,
const std::string doc = "" 
)

the full specialization of the method setProperty( IInterface , std::string, const TYPE&) for C-strings

Parameters
componentcomponent which needs to be configured
namename of the property
valuevalue of the property
docthe new documentation string
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 481 of file Property.cpp.

483 {
484  return setProperty( component, name, std::string{value}, doc );
485 }
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1243
STL class.
template<unsigned N>
StatusCode Gaudi::Utils::setProperty ( IInterface component,
const std::string name,
const char(&)  value[N],
const std::string doc = "" 
)

the full specialization of the method setProperty( IInterface, std::string, const TYPE&) for C-arrays

Parameters
componentcomponent which needs to be configured
namename of the property
valuevalue of the property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 1403 of file Property.h.

1405  {
1406  if ( 0 == component ) {
1407  return StatusCode::FAILURE;
1408  }
1409  return setProperty( component, name, std::string{value, value + N}, doc );
1410  }
constexpr static const auto FAILURE
Definition: StatusCode.h:88
STL class.
int N
Definition: IOTest.py:101
StatusCode setProperty(IInterface *component, const std::string &name, const Gaudi::Property< TYPE > &value, const std::string &doc="")
simple function to set the property of the given object from another property
Definition: Property.h:1483
StatusCode Gaudi::Utils::setProperty ( IInterface component,
const std::string name,
const Gaudi::Details::PropertyBase property,
const std::string doc = "" 
)

simple function to set the property of the given object from another property

IInterface* component = ... ;
const Gaudi::Details::PropertyBase* prop = ... ;
StatusCode sc = setProperty ( component , "Data" , prop ) ;
Parameters
componentcomponent which needs to be configured
namename of the property
propertythe property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 509 of file Property.cpp.

511 {
512  if ( !component ) {
513  return StatusCode::FAILURE;
514  }
515  SmartIF<IProperty> prop( component );
516  if ( !prop ) {
517  return StatusCode::FAILURE;
518  }
519  return setProperty( prop, name, property, doc );
520 }
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1243
constexpr static const auto FAILURE
Definition: StatusCode.h:88
StatusCode Gaudi::Utils::setProperty ( IInterface component,
const std::string name,
const Gaudi::Details::PropertyBase property,
const std::string doc = "" 
)

simple function to set the property of the given object from another property

IInterface* component = ... ;
const Gaudi::Details::PropertyBase& prop = ... ;
StatusCode sc = setProperty ( component , "Data" , prop ) ;
Parameters
componentcomponent which needs to be configured
namename of the property
propertythe property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 544 of file Property.cpp.

546 {
547  return setProperty( component, name, &property, doc );
548 }
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1243
template<class TYPE >
StatusCode Gaudi::Utils::setProperty ( IInterface component,
const std::string name,
const Gaudi::Property< TYPE > &  value,
const std::string doc = "" 
)

simple function to set the property of the given object from another property

IInterface* component = ... ;
StatusCode sc = setProperty ( component , "Data" , prop ) ;
Parameters
componentcomponent which needs to be configured
namename of the property
valuethe property
docthe new documentation string
See also
IProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 1483 of file Property.h.

1485  {
1486  return setProperty( component, name, &value, doc );
1487  }
StatusCode setProperty(IInterface *component, const std::string &name, const Gaudi::Property< TYPE > &value, const std::string &doc="")
simple function to set the property of the given object from another property
Definition: Property.h:1483
template<class ITERATOR >
std::ostream & Gaudi::Utils::toStream ( ITERATOR  first,
ITERATOR  last,
std::ostream s,
const std::string open,
const std::string close,
const std::string delim 
)
inline

the helper function to print the sequence

Parameters
first(INPUT) begin-iterator for the sequence
last(INPUT) end-iterator for the sequence
s(UPDATE) the stream itself
open(INPUT) "open"-symbol
close(INPUT) "close"-symbol
delim(INPUT) "delimiter"-symbol
Returns
the stream
Author
Vanya BELYAEV Ivan..nosp@m.BEly.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-15

Definition at line 303 of file ToStream.h.

309  {
310  using ref_t = typename std::iterator_traits<ITERATOR>::reference;
312  return ostream_joiner( s << open, first, last, delim,
313  []( std::ostream& os, ref_t i ) -> std::ostream& { return toStream( i, os ); } )
314  << close;
315  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:40
STL class.
std::ostream & Gaudi::Utils::toStream ( const TH1D &  histo,
std::ostream stream,
const bool  asXML = false 
)

stream the ROOT histogram into output stream

Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream
asXML(INPUT) use XML-format
Returns
the updated stream
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 174 of file Histo2String.cpp.

175 {
176  return _toStream_1D_( histo, stream, asXML );
177 }
template<class TYPE , std::size_t N>
std::ostream& Gaudi::Utils::toStream ( const boost::array< TYPE, N > &  obj,
std::ostream s 
)
inline

printout of class boost::array The format is "Python's tuple"

Parameters
obj(INPUT) the arary to be printed
s(UPDATE) the actual stream
Returns
the updated stream
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-16

Definition at line 49 of file BoostArrayAsProperty.h.

50  {
51  return toStream( obj.begin(), obj.end(), s, "( ", " )", " , " );
52  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
string s
Definition: gaudirun.py:253
template<class TYPE >
std::ostream & Gaudi::Utils::toStream ( const TYPE &  obj,
std::ostream s 
)
inline

the generic implementation of the printout to the std::ostream

Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12

Definition at line 286 of file ToStream.h.

287  {
288  return s << obj;
289  }
std::ostream & Gaudi::Utils::toStream ( const TH2D &  histo,
std::ostream stream,
const bool  asXML = false 
)

stream the ROOT histogram into output stream

Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream
asXML(INPUT) use XML-format
Returns
the updated stream
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 196 of file Histo2String.cpp.

197 {
198  return _toStream_2D_( histo, stream, asXML );
199 }
std::ostream & Gaudi::Utils::toStream ( const TH1F &  histo,
std::ostream stream,
const bool  asXML = false 
)

stream the ROOT histogram into output stream

Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream
asXML(INPUT) use XML-format
Returns
the updated stream
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 185 of file Histo2String.cpp.

186 {
187  return _toStream_1D_( histo, stream, asXML );
188 }
std::ostream& Gaudi::Utils::toStream ( const std::string obj,
std::ostream s 
)
inline

the printtout of the strings.

the string is printed a'la Python using the quotes

Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12

Definition at line 77 of file ToStream.h.

78  {
79  auto c = ( std::string::npos == obj.find( '\'' ) ? '\'' : '\"' );
80  return s << c << obj << c;
81  }
T find(T...args)
std::ostream & Gaudi::Utils::toStream ( const TH2F &  histo,
std::ostream stream,
const bool  asXML = false 
)

stream the ROOT histogram into output stream

Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream
asXML(INPUT) use XML-format
Returns
the updated stream
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 207 of file Histo2String.cpp.

208 {
209  return _toStream_2D_( histo, stream, asXML );
210 }
template<class SCALAR >
std::ostream& Gaudi::Utils::toStream ( const SCALAR &  ,
std::ostream  
)
template<class SCALAR , unsigned int N>
std::ostream& Gaudi::Utils::toStream ( const ROOT::Math::SVector< SCALAR, N > &  obj,
std::ostream s 
)

the general streaming function for SVector using python-tupel format

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-10-07

Definition at line 86 of file SVectorAsProperty.h.

87  {
88  s << "( ";
89  for ( auto cur = obj.begin(); obj.end() != cur; ++cur ) {
90  if ( obj.begin() != cur ) {
91  s << " , ";
92  }
93  toStream( *cur, s );
94  }
95  return s << " )";
96  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
std::ostream& Gaudi::Utils::toStream ( const bool  obj,
std::ostream s 
)
inline

the printout of boolean values "a'la Python"

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-09-09

Definition at line 86 of file ToStream.h.

86 { return s << ( obj ? "True" : "False" ); }
std::ostream & Gaudi::Utils::toStream ( const AIDA::IHistogram1D &  histo,
std::ostream stream,
const bool  asXML = false 
)

stream the AIDA histogram into output stream

Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream
asXML(INPUT) use XML-format
Returns
the updated stream
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 218 of file Histo2String.cpp.

219 {
220  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &histo );
221  return root ? toStream( *root, stream, asXML ) : stream;
222 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:73
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
std::ostream& Gaudi::Utils::toStream ( const float  obj,
std::ostream s,
const int  prec = 6 
)
inline

the printout of float values with the reasonable precision

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-09-09

Definition at line 91 of file ToStream.h.

92  {
93  const int p = s.precision();
94  return s << std::setprecision( prec ) << obj << std::setprecision( p );
95  }
T precision(T...args)
T setprecision(T...args)
std::ostream & Gaudi::Utils::toStream ( const AIDA::IHistogram2D &  histo,
std::ostream stream,
const bool  asXML = false 
)

stream the AIDA histogram into output stream

Parameters
histo(INPUT) the histogram to be streamed
stream(OUTPUT) the stream
asXML(INPUT) use XML-format
Returns
the updated stream
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 230 of file Histo2String.cpp.

231 {
232  //
233  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &histo );
234  return root ? toStream( *root, stream, asXML ) : stream;
235 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:73
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
std::ostream& Gaudi::Utils::toStream ( const double  obj,
std::ostream s,
const int  prec = 8 
)
inline

the printout of double values with the reasonable precision

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-09-09

Definition at line 100 of file ToStream.h.

101  {
102  const int p = s.precision();
103  return s << std::setprecision( prec ) << obj << std::setprecision( p );
104  }
T precision(T...args)
T setprecision(T...args)
std::ostream& Gaudi::Utils::toStream ( const long double  obj,
std::ostream s,
const int  prec = 10 
)
inline

the printout of long double values with the reasonable precision

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-09-09

Definition at line 109 of file ToStream.h.

110  {
111  const int p = s.precision();
112  return s << std::setprecision( prec ) << obj << std::setprecision( p );
113  }
T precision(T...args)
T setprecision(T...args)
std::ostream & Gaudi::Utils::toStream ( const DataObjectHandleBase v,
std::ostream o 
)

Definition at line 24 of file DataObjectHandleProperty.cpp.

24 { return o << v; }
template<class KTYPE , class VTYPE >
std::ostream& Gaudi::Utils::toStream ( const std::pair< KTYPE, VTYPE > &  obj,
std::ostream s 
)
inline

the partial template specialization of std::pair<KTYPE,VTYPE> printout the pair is printed a'la Python tuple: " ( a , b )"

Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12

Definition at line 123 of file ToStream.h.

124  {
125  return toStream( obj.second, toStream( obj.first, s << "( " ) << " , " ) << " )";
126  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
template<class TYPE , class ALLOCATOR >
std::ostream& Gaudi::Utils::toStream ( const std::vector< TYPE, ALLOCATOR > &  obj,
std::ostream s 
)
inline

the partial template specialization of std::vector<TYPE,ALLOCATOR> printout.

The vector is printed a'la Python list: "[ a, b, c ]"

Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12

Definition at line 135 of file ToStream.h.

136  {
137  return toStream( obj.begin(), obj.end(), s, "[ ", " ]", " , " );
138  }
T end(T...args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
T begin(T...args)
string s
Definition: gaudirun.py:253
template<class TYPE , class ALLOCATOR >
std::ostream& Gaudi::Utils::toStream ( const std::list< TYPE, ALLOCATOR > &  obj,
std::ostream s 
)
inline

the partial template specialization of std::list<TYPE,ALLOCATOR> printout.

The vector is printed a'la Python list: "[ a, b, c ]"

Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-04-08

Definition at line 147 of file ToStream.h.

148  {
149  return toStream( obj.begin(), obj.end(), s, "[ ", " ]", " , " );
150  }
T end(T...args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
T begin(T...args)
string s
Definition: gaudirun.py:253
template<class TYPE , class CMP , class ALLOCATOR >
std::ostream& Gaudi::Utils::toStream ( const std::set< TYPE, CMP, ALLOCATOR > &  obj,
std::ostream s 
)
inline

the partial template specialization of std::set<TYPE,CMP,ALLOCATOR> printout.

The vector is printed a'la Python list: "[ a, b, c ]"

Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12

Definition at line 159 of file ToStream.h.

160  {
161  return toStream( obj.begin(), obj.end(), s, "[ ", " ]", " , " );
162  }
T end(T...args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
T begin(T...args)
string s
Definition: gaudirun.py:253
template<class TYPE , class HASH , class CMP , class ALLOCATOR >
std::ostream& Gaudi::Utils::toStream ( const std::unordered_set< TYPE, HASH, CMP, ALLOCATOR > &  obj,
std::ostream s 
)
inline

the partial template specialization of std::unordered_set<TYPE,HASH,CMP,ALLOCATOR> printout.

The vector is printed a'la Python list: "[ a, b, c ]"

Definition at line 168 of file ToStream.h.

169  {
170  return toStream( obj.begin(), obj.end(), s, "[", "]", " , " );
171  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
T begin(T...args)
string s
Definition: gaudirun.py:253
template<class KTYPE , class VTYPE , class CMP , class ALLOCATOR >
std::ostream& Gaudi::Utils::toStream ( const std::map< KTYPE, VTYPE, CMP, ALLOCATOR > &  obj,
std::ostream s 
)
inline

the partial template specialization of std::map<KTYPE,VTYPE,CMP,ALLOCATOR> printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"

Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12

Definition at line 181 of file ToStream.h.

182  {
184  return ostream_joiner( s << "{ ", obj, " , ",
186  return toStream( i.second, toStream( i.first, os ) << " : " );
187  } )
188  << " }";
189  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:40
STL class.
template<class KTYPE , class VTYPE , class CMP , class ALLOCATOR >
std::ostream& Gaudi::Utils::toStream ( const GaudiUtils::VectorMap< KTYPE, VTYPE, CMP, ALLOCATOR > &  obj,
std::ostream s 
)
inline

the partial template specialization of GaudiUtils::VectorMap<KTYPE,VTYPE,CMP,ALLOCATOR> printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"

See also
GaudiUtils::VectorMap
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12

Definition at line 200 of file ToStream.h.

201  {
203  return ostream_joiner( s << "{ ", obj, " , ",
205  return toStream( i.second, toStream( i.first, os ) << " : " );
206  } )
207  << " }";
208  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:40
STL class.
std::ostream & Gaudi::Utils::toStream ( const Gaudi::XYZPoint obj,
std::ostream s 
)

print XYZ point

Definition at line 121 of file ParsersVct.cpp.

122 {
123  s << "( ";
124  toStream( obj.X(), s );
125  s << " , ";
126  toStream( obj.Y(), s );
127  s << " , ";
128  toStream( obj.Z(), s );
129  s << " )";
130  return s;
131 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
string s
Definition: gaudirun.py:253
std::ostream & Gaudi::Utils::toStream ( const Gaudi::XYZVector obj,
std::ostream s 
)

print XYZ vector

Definition at line 135 of file ParsersVct.cpp.

136 {
137  s << "( ";
138  toStream( obj.X(), s );
139  s << " , ";
140  toStream( obj.Y(), s );
141  s << " , ";
142  toStream( obj.Z(), s );
143  s << " )";
144 
145  return s;
146 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
string s
Definition: gaudirun.py:253
std::ostream & Gaudi::Utils::toStream ( const Gaudi::LorentzVector obj,
std::ostream s 
)

print Lorentz vector

Definition at line 150 of file ParsersVct.cpp.

151 {
152 
153  s << "( ";
154  toStream( obj.Px(), s, 12 );
155  s << " , ";
156  toStream( obj.Py(), s, 12 );
157  s << " , ";
158  toStream( obj.Pz(), s, 13 );
159  s << " , ";
160  toStream( obj.E(), s, 14 );
161  s << " )";
162 
163  return s;
164 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
string s
Definition: gaudirun.py:253
template<class KTYPE , class VTYPE , class MAP >
std::ostream& Gaudi::Utils::toStream ( const GaudiUtils::Map< KTYPE, VTYPE, MAP > &  obj,
std::ostream s 
)
inline

the partial template specialization of GaudiUtils::Map<KTYPE,VTYPE,MAP> printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"

See also
GaudiUtils::VectorMap
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12

Definition at line 219 of file ToStream.h.

220  {
222  return ostream_joiner( s << "{ ", obj, " , ",
224  return toStream( i.second, toStream( i.first, s ) << " : " );
225  } )
226  << " }";
227  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:40
STL class.
std::ostream & Gaudi::Utils::toStream ( const Gaudi::StringKey key,
std::ostream s 
)

send the object to stream (needed to use it as property)

See also
Gaudi::StringKey
Gaudi::Utils::toString
Gaudi::Utils::toStream
Parameters
key(INPUT) the object to be printed
s(OUTPUT) the stream
Returns
the stream
Author
Vanya BELYAEV Iavn..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-10-07

Definition at line 63 of file StringKey.cpp.

64 {
65  return Gaudi::Utils::toStream( key.str(), s );
66 }
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
Definition: ToStream.h:303
string s
Definition: gaudirun.py:253
const std::string & str() const
the actual string
Definition: StringKey.h:47
template<class KTYPE , class VTYPE , class HASH , class MAP >
std::ostream& Gaudi::Utils::toStream ( const GaudiUtils::HashMap< KTYPE, VTYPE, HASH, MAP > &  obj,
std::ostream s 
)
inline

the partial template specialization of GaudiUtils::HashMap<KTYPE,VTYPE,HASH,MAP> printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"

See also
GaudiUtils::VectorMap
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12

Definition at line 238 of file ToStream.h.

239  {
240  // Copy the hash map into a map to have it ordered by key.
241  return toStream( GaudiUtils::Map<KTYPE, VTYPE>{obj.begin(), obj.end()}, s );
242  }
Extension of the STL map.
Definition: Map.h:82
iterator end()
Definition: Map.h:134
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
iterator begin()
Definition: Map.h:133
string s
Definition: gaudirun.py:253
template<class TYPE , unsigned int N>
std::ostream& Gaudi::Utils::toStream ( const TYPE(&)  obj[N],
std::ostream s 
)

the specialization for C-arrays, a'la python tuple

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-10-05

Definition at line 249 of file ToStream.h.

250  {
251  return toStream( obj, obj + N, s, "( ", " )", " , " );
252  }
int N
Definition: IOTest.py:101
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
template<class TYPE , std::size_t N>
std::ostream& Gaudi::Utils::toStream ( const std::array< TYPE, N > &  obj,
std::ostream s 
)

the specialization for std::array, a'la python tuple

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-16

Definition at line 259 of file ToStream.h.

260  {
261  return toStream( begin( obj ), end( obj ), s, "( ", " )", " , " );
262  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
AttribStringParser::Iterator begin(const AttribStringParser &parser)
template<unsigned int N>
std::ostream& Gaudi::Utils::toStream ( const char(&)  obj[N],
std::ostream s 
)

the specialization for C-string, a'la python tuple

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-10-05

Definition at line 269 of file ToStream.h.

270  {
271  return toStream( std::string( obj, obj + N ), s );
272  }
STL class.
int N
Definition: IOTest.py:101
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
std::ostream& Gaudi::Utils::toStream ( const char *  obj,
std::ostream s 
)
inline

the specialization for C-string, a'la python tuple

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-10-05

Definition at line 278 of file ToStream.h.

278 { return toStream( std::string( obj ), s ); }
STL class.
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
template<typename... Args>
std::ostream& Gaudi::Utils::toStream ( const std::tuple< Args... > &  tuple,
std::ostream s 
)
inline

the helper function to print the tuple

Parameters
tulpe(INPUT) tuple
Returns
the stream
Author
Aleander Mazurov alexa.nosp@m.nder.nosp@m..mazu.nosp@m.rov@.nosp@m.cern..nosp@m.ch
Date
2015-03-21

Definition at line 342 of file ToStream.h.

343  {
344  return TuplePrinter<decltype( tuple ), sizeof...( Args )>::toStream( tuple, s << " ( " ) << " ) ";
345  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
std::string Gaudi::Utils::toString ( const TH1D &  histo,
const bool  asXML = false 
)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 245 of file Histo2String.cpp.

246 {
248  toStream( histo, o, asXML );
249  return o.str();
250 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
std::string Gaudi::Utils::toString ( const TH2D &  histo,
const bool  asXML = false 
)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 275 of file Histo2String.cpp.

276 {
278  toStream( histo, o, asXML );
279  return o.str();
280 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
std::string Gaudi::Utils::toString ( const TH1F &  histo,
const bool  asXML = false 
)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 260 of file Histo2String.cpp.

261 {
263  toStream( histo, o, asXML );
264  return o.str();
265 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
std::string Gaudi::Utils::toString ( const TH2F &  histo,
const bool  asXML = false 
)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 290 of file Histo2String.cpp.

291 {
293  toStream( histo, o, asXML );
294  return o.str();
295 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
std::string Gaudi::Utils::toString ( const AIDA::IHistogram1D &  histo,
const bool  asXML = false 
)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 305 of file Histo2String.cpp.

306 {
308  toStream( histo, o, asXML );
309  return o.str();
310 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
std::string Gaudi::Utils::toString ( const AIDA::IHistogram2D &  histo,
const bool  asXML = false 
)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 320 of file Histo2String.cpp.

321 {
323  toStream( histo, o, asXML );
324  return o.str();
325 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
std::string Gaudi::Utils::toString ( const AIDA::IHistogram1D *  histo)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 335 of file Histo2String.cpp.

335 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const Type &)
std::string Gaudi::Utils::toString ( AIDA::IHistogram1D *  histo)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 345 of file Histo2String.cpp.

345 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const Type &)
std::string Gaudi::Utils::toString ( const TH1D *  histo)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 355 of file Histo2String.cpp.

355 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const Type &)
std::string Gaudi::Utils::toString ( TH1D *  histo)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 375 of file Histo2String.cpp.

375 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const Type &)
std::string Gaudi::Utils::toString ( const TH2D *  histo)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 365 of file Histo2String.cpp.

365 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const Type &)
std::string Gaudi::Utils::toString ( TH2D *  histo)

convert the histogram into the string

Parameters
histo(INPUT) the histogram to be streamed
asXML(INPUT) use XML-format
Returns
the string representation of the histogram
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2009-09-26

Definition at line 385 of file Histo2String.cpp.

385 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const Type &)
template<class TYPE >
std::string Gaudi::Utils::toString ( const TYPE &  obj)
inline

the generic implementation of the type conversion to the string

Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-12
See also
Gaudi::Utils::toStream
Todo:
need to be compared with boost::lexical_cast

Definition at line 356 of file ToStream.h.

357  {
359  std::ios::fmtflags orig_flags = s.flags();
360  s.setf( std::ios::showpoint ); // to display correctly floats
361  toStream( obj, s );
362  s.flags( orig_flags );
363  return s.str();
364  }
T setf(T...args)
T flags(T...args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:92
string s
Definition: gaudirun.py:253