Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 119 of file AttribStringParser.h.

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

Definition at line 122 of file AttribStringParser.h.

122  {
124  }
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.

24  {
25  return svc ? getAlgorithm( svc->algorithms(), sel ) : nullptr;
26 }
sel
Definition: IOTest.py:93
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 30 of file GetAlg.cpp.

30  {
31  auto it = std::find_if( lst.rbegin(), lst.rend(), std::cref( sel ) );
32  return it != lst.rend() ? *it : nullptr;
33 }
T rend(T...args)
sel
Definition: IOTest.py:93
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 69 of file GetData.h.

69  {
70  DataObject* obj = nullptr;
71  // Return the casted pointer if the retrieve was successful or nullptr otherwise.
72  StatusCode sc = service->retrieveObject( location, obj );
73  if ( sc.isSuccess() ) {
74  typename _GetType<TYPE>::return_type tobj = dynamic_cast<typename _GetType<TYPE>::return_type>( obj );
75  return tobj;
76  } else {
77  return nullptr;
78  }
79  }
bool isSuccess() const
Definition: StatusCode.h:267
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
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 59 of file GetAlgs.cpp.

59 { 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 113 of file GetAlgs.cpp.

113 { 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 77 of file GetAlgs.cpp.

77 { 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 204 of file Property.cpp.

204  {
205  // trivial check
206  if ( !p ) { return nullptr; } // RETURN
207  // get all properties
208  const auto& props = p->getProperties();
209  // comparison criteria:
210  auto ifound = std::find_if( props.begin(), props.end(), is_iByName{name} );
211  return ifound != props.end() ? *ifound : nullptr;
212 }
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 232 of file Property.cpp.

232  {
233  // trivial check
234  if ( !p ) { return nullptr; } // RETURN
235  // remove const-qualifier
236  IInterface* _i = const_cast<IInterface*>( p );
237  if ( !_i ) { return nullptr; } // RETURN
239  return property ? getProperty( property, name ) : nullptr;
240 }
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition of the basic interface.
Definition: IInterface.h:244
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:204
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 292 of file Property.cpp.

292  {
293  // trivial check
294  if ( !p ) { return nullptr; } // RETURN
295  auto ifound = std::find_if( p->begin(), p->end(), is_iByName{name} );
296  return p->end() != ifound ? *ifound : nullptr; // RETURN
297 }
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 149 of file GetAlgs.cpp.

149  {
150  if ( !svc ) { return nullptr; } // RETURN
151  //
152  AlgTypeSelector<GaudiSequencer> sel1;
153  AlgTypeSelector<Sequencer> sel2;
154 
155  const auto& algs = svc->algorithms();
156  auto a = std::find_if( algs.rbegin(), algs.rend(), [&]( IAlgorithm* alg ) { return sel1( alg ) || sel2( alg ); } );
157  return a != algs.rend() ? *a : nullptr;
158 }
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 130 of file GetAlgs.cpp.

130 { 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 95 of file GetAlgs.cpp.

95 { 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 95 of file Property.cpp.

95  {
96  // delegate the actual work to another method ;
97  return p && getProperty( p, name );
98 }
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:204
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 72 of file Property.cpp.

72  {
73  // delegate to another method after trivial check
74  return p && getProperty( p, name );
75 }
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:204
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 265 of file Property.cpp.

265  {
266  // delegate to another method
267  return getProperty( p, name );
268 }
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:204
bool Gaudi::Utils::iequal ( const std::string v1,
const std::string v2 
)
inline

Helper for case insensitive string comparison.

Definition at line 44 of file PropertyHolder.h.

44  {
45  return v1.size() == v2.size() && std::equal( std::begin( v1 ), std::end( v1 ), std::begin( v2 ),
46  []( char c1, char c2 ) { return toupper( c1 ) == toupper( c2 ); } );
47  }
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 42 of file TypeNameString.h.

42  {
43  return s << tn.type() << '/' << tn.name();
44  }
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 1178 of file Property.h.

1178  {
1179  using Gaudi::Utils::toString;
1180  return component && hasProperty( component, name )
1181  ? Gaudi::Utils::setProperty( component, name, toString( value ), doc )
1182  : StatusCode::FAILURE;
1183  }
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:1178
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:334
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:50
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 1092 of file Property.h.

1092  {
1093  return setProperty( component, name, value, std::string() );
1094  }
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:1410
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 331 of file Property.cpp.

332  {
333  if ( !component ) { return StatusCode::FAILURE; } // RETURN
334  if ( !hasProperty( component, name ) ) { return StatusCode::FAILURE; }
335  StatusCode sc = component->setProperty( name, value );
336  if ( !doc.empty() ) {
337  PropertyBase* p = getProperty( component, name );
338  if ( p ) { p->setDocumentation( doc ); }
339  }
340  sc.ignore();
341  return sc;
342 }
T empty(T...args)
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:86
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:50
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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:204
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 313 of file Property.cpp.

314  {
315  return Gaudi::Utils::setProperty( component, name, std::string{value}, doc );
316 }
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:1178
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 1142 of file Property.h.

1143  {
1144  return component ? setProperty( component, name, std::string( value, value + N ), doc ) : StatusCode::FAILURE;
1145  }
STL class.
int N
Definition: IOTest.py:99
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
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:1410
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 366 of file Property.cpp.

367  {
368  if ( !component || !property ) return StatusCode::FAILURE;
369  PropertyBase* p = getProperty( component, name );
370  if ( !p || !p->assign( *property ) ) return StatusCode::FAILURE;
371  if ( !doc.empty() ) { p->setDocumentation( doc ); }
372  return StatusCode::SUCCESS;
373 }
T empty(T...args)
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:86
virtual bool assign(const PropertyBase &source)=0
import the property value form the source
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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:204
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 397 of file Property.cpp.

398  {
399  return setProperty( component, name, &property, doc );
400 }
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:1178
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 1256 of file Property.h.

1257  {
1258  return setProperty( component, name, &value, doc );
1259  }
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:1410
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 1282 of file Property.h.

1283  {
1284  if ( !component ) { return StatusCode::FAILURE; }
1285  auto property = SmartIF<IProperty>{component};
1286  return property ? setProperty( property, name, value, doc ) : StatusCode::FAILURE;
1287  }
Gaudi::Details::PropertyBase * property(const std::string &name) const
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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:1410
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 415 of file Property.cpp.

416  {
417  if ( !component ) { return StatusCode::FAILURE; }
418  SmartIF<IProperty> property( component );
419  return property ? setProperty( property, name, value, doc ) : StatusCode::FAILURE;
420 }
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:1178
Gaudi::Details::PropertyBase * property(const std::string &name) const
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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 435 of file Property.cpp.

436  {
437  return setProperty( component, name, std::string{value}, doc );
438 }
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:1178
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 1333 of file Property.h.

1334  {
1335  if ( 0 == component ) { return StatusCode::FAILURE; }
1336  return setProperty( component, name, std::string{value, value + N}, doc );
1337  }
STL class.
int N
Definition: IOTest.py:99
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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:1410
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 462 of file Property.cpp.

463  {
464  if ( !component ) { return StatusCode::FAILURE; }
465  SmartIF<IProperty> prop( component );
466  if ( !prop ) { return StatusCode::FAILURE; }
467  return setProperty( prop, name, property, doc );
468 }
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:1178
constexpr static const auto FAILURE
Definition: StatusCode.h:86
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 492 of file Property.cpp.

493  {
494  return setProperty( component, name, &property, doc );
495 }
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:1178
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 1410 of file Property.h.

1411  {
1412  return setProperty( component, name, &value, doc );
1413  }
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:1410
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 284 of file ToStream.h.

290  {
291  using ref_t = typename std::iterator_traits<ITERATOR>::reference;
293  return ostream_joiner( s << open, first, last, delim,
294  []( std::ostream& os, ref_t i ) -> std::ostream& { return toStream( i, os ); } )
295  << close;
296  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:37
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 157 of file Histo2String.cpp.

157  {
158  return _toStream_1D_( histo, stream, asXML );
159 }
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 47 of file BoostArrayAsProperty.h.

47  {
48  return toStream( obj.begin(), obj.end(), s, "( ", " )", " , " );
49  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
string s
Definition: gaudirun.py:312
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 268 of file ToStream.h.

268  {
269  return s << obj;
270  }
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 177 of file Histo2String.cpp.

177  {
178  return _toStream_2D_( histo, stream, asXML );
179 }
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 167 of file Histo2String.cpp.

167  {
168  return _toStream_1D_( histo, stream, asXML );
169 }
template<class SCALAR >
std::ostream& Gaudi::Utils::toStream ( const SCALAR &  ,
std::ostream  
)
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 187 of file Histo2String.cpp.

187  {
188  return _toStream_2D_( histo, stream, asXML );
189 }
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 75 of file ToStream.h.

75  {
76  auto c = ( std::string::npos == obj.find( '\'' ) ? '\'' : '\"' );
77  return s << c << obj << c;
78  }
T find(T...args)
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 77 of file SVectorAsProperty.h.

77  {
78  s << "( ";
79  for ( auto cur = obj.begin(); obj.end() != cur; ++cur ) {
80  if ( obj.begin() != cur ) { s << " , "; }
81  toStream( *cur, s );
82  }
83  return s << " )";
84  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 83 of file ToStream.h.

83 { 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 197 of file Histo2String.cpp.

197  {
198  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &histo );
199  return root ? toStream( *root, stream, asXML ) : stream;
200 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:71
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 88 of file ToStream.h.

88  {
89  const int p = s.precision();
90  return s << std::setprecision( prec ) << obj << std::setprecision( p );
91  }
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 208 of file Histo2String.cpp.

208  {
209  //
210  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &histo );
211  return root ? toStream( *root, stream, asXML ) : stream;
212 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:71
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 96 of file ToStream.h.

96  {
97  const int p = s.precision();
98  return s << std::setprecision( prec ) << obj << std::setprecision( p );
99  }
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 104 of file ToStream.h.

104  {
105  const int p = s.precision();
106  return s << std::setprecision( prec ) << obj << std::setprecision( p );
107  }
T precision(T...args)
T setprecision(T...args)
std::ostream & Gaudi::Utils::toStream ( const DataObjectHandleBase v,
std::ostream o 
)

Definition at line 20 of file DataObjectHandleProperty.cpp.

20 { 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 117 of file ToStream.h.

117  {
118  return toStream( obj.second, toStream( obj.first, s << "( " ) << " , " ) << " )";
119  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 128 of file ToStream.h.

128  {
129  return toStream( obj.begin(), obj.end(), s, "[ ", " ]", " , " );
130  }
T end(T...args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
T begin(T...args)
string s
Definition: gaudirun.py:312
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 139 of file ToStream.h.

139  {
140  return toStream( obj.begin(), obj.end(), s, "[ ", " ]", " , " );
141  }
T end(T...args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
T begin(T...args)
string s
Definition: gaudirun.py:312
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 150 of file ToStream.h.

150  {
151  return toStream( obj.begin(), obj.end(), s, "[ ", " ]", " , " );
152  }
T end(T...args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
T begin(T...args)
string s
Definition: gaudirun.py:312
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 158 of file ToStream.h.

158  {
159  return toStream( obj.begin(), obj.end(), s, "[", "]", " , " );
160  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
T begin(T...args)
string s
Definition: gaudirun.py:312
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 170 of file ToStream.h.

170  {
172  return ostream_joiner( s << "{ ", obj, " , ",
174  return toStream( i.second, toStream( i.first, os ) << " : " );
175  } )
176  << " }";
177  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:37
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 188 of file ToStream.h.

188  {
190  return ostream_joiner( s << "{ ", obj, " , ",
192  return toStream( i.second, toStream( i.first, os ) << " : " );
193  } )
194  << " }";
195  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:37
STL class.
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 206 of file ToStream.h.

206  {
208  return ostream_joiner( s << "{ ", obj, " , ",
210  return toStream( i.second, toStream( i.first, os ) << " : " );
211  } )
212  << " }";
213  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:37
STL class.
std::ostream & Gaudi::Utils::toStream ( const Gaudi::XYZPoint obj,
std::ostream s 
)

print XYZ point

Definition at line 106 of file ParsersVct.cpp.

106  {
107  s << "( ";
108  toStream( obj.X(), s );
109  s << " , ";
110  toStream( obj.Y(), s );
111  s << " , ";
112  toStream( obj.Z(), s );
113  s << " )";
114  return s;
115 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
string s
Definition: gaudirun.py:312
std::ostream & Gaudi::Utils::toStream ( const Gaudi::XYZVector obj,
std::ostream s 
)

print XYZ vector

Definition at line 119 of file ParsersVct.cpp.

119  {
120  s << "( ";
121  toStream( obj.X(), s );
122  s << " , ";
123  toStream( obj.Y(), s );
124  s << " , ";
125  toStream( obj.Z(), s );
126  s << " )";
127 
128  return s;
129 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
string s
Definition: gaudirun.py:312
std::ostream & Gaudi::Utils::toStream ( const Gaudi::LorentzVector obj,
std::ostream s 
)

print Lorentz vector

Definition at line 133 of file ParsersVct.cpp.

133  {
134 
135  s << "( ";
136  toStream( obj.Px(), s, 12 );
137  s << " , ";
138  toStream( obj.Py(), s, 12 );
139  s << " , ";
140  toStream( obj.Pz(), s, 13 );
141  s << " , ";
142  toStream( obj.E(), s, 14 );
143  s << " )";
144 
145  return s;
146 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
string s
Definition: gaudirun.py:312
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 224 of file ToStream.h.

224  {
225  // Copy the hash map into a map to have it ordered by key.
226  return toStream( GaudiUtils::Map<KTYPE, VTYPE>{obj.begin(), obj.end()}, s );
227  }
Extension of the STL map.
Definition: Map.h:81
iterator end()
Definition: Map.h:130
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
iterator begin()
Definition: Map.h:129
string s
Definition: gaudirun.py:312
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.

63  {
64  return Gaudi::Utils::toStream( key.str(), s );
65 }
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:284
string s
Definition: gaudirun.py:312
const std::string & str() const
the actual string
Definition: StringKey.h:45
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 234 of file ToStream.h.

234  {
235  return toStream( obj, obj + N, s, "( ", " )", " , " );
236  }
int N
Definition: IOTest.py:99
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 243 of file ToStream.h.

243  {
244  return toStream( begin( obj ), end( obj ), s, "( ", " )", " , " );
245  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 252 of file ToStream.h.

252  {
253  return toStream( std::string( obj, obj + N ), s );
254  }
STL class.
int N
Definition: IOTest.py:99
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 260 of file ToStream.h.

260 { return toStream( std::string( obj ), s ); }
STL class.
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 321 of file ToStream.h.

321  {
322  return TuplePrinter<decltype( tuple ), sizeof...( Args )>::toStream( tuple, s << " ( " ) << " ) ";
323  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 222 of file Histo2String.cpp.

222  {
224  toStream( histo, o, asXML );
225  return o.str();
226 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 250 of file Histo2String.cpp.

250  {
252  toStream( histo, o, asXML );
253  return o.str();
254 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 236 of file Histo2String.cpp.

236  {
238  toStream( histo, o, asXML );
239  return o.str();
240 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 264 of file Histo2String.cpp.

264  {
266  toStream( histo, o, asXML );
267  return o.str();
268 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 278 of file Histo2String.cpp.

278  {
280  toStream( histo, o, asXML );
281  return o.str();
282 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 292 of file Histo2String.cpp.

292  {
294  toStream( histo, o, asXML );
295  return o.str();
296 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
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 306 of file Histo2String.cpp.

306 { 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 316 of file Histo2String.cpp.

316 { 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 326 of file Histo2String.cpp.

326 { 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 346 of file Histo2String.cpp.

346 { 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 336 of file Histo2String.cpp.

336 { 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 356 of file Histo2String.cpp.

356 { 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 334 of file ToStream.h.

334  {
336  std::ios::fmtflags orig_flags = s.flags();
337  s.setf( std::ios::showpoint ); // to display correctly floats
338  toStream( obj, s );
339  s.flags( orig_flags );
340  return s.str();
341  }
T setf(T...args)
T flags(T...args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:82
string s
Definition: gaudirun.py:312