The Gaudi Framework  v33r1 (b1225454)
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_v< TYPE >, void * > = nullptr>
_GetType< TYPE >::return_type getFromTS (IDataProviderSvc *service, std::string_view 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

◆ begin()

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

Definition at line 130 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:28

◆ end()

AttribStringParser::Iterator Gaudi::Utils::end ( const AttribStringParser )
inline

Definition at line 133 of file AttribStringParser.h.

133  {
135  }
boost::spirit::classic::position_iterator2< ForwardIterator > Iterator
Definition: Iterator.h:28

◆ getAlgorithm() [1/2]

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 34 of file GetAlg.cpp.

34  {
35  return svc ? getAlgorithm( svc->algorithms(), sel ) : nullptr;
36 }
virtual const Algorithms & algorithms() const =0
get the stack of executed algorithms
GAUDI_API IAlgorithm * getAlgorithm(const IAlgContextSvc *svc, const AlgSelector &sel)
simple function to get the algorithm from Context Service
Definition: GetAlg.cpp:34

◆ getAlgorithm() [2/2]

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 40 of file GetAlg.cpp.

40  {
41  auto it = std::find_if( lst.rbegin(), lst.rend(), std::cref( sel ) );
42  return it != lst.rend() ? *it : nullptr;
43 }
T rend(T... args)
T find_if(T... args)
T cref(T... args)
T rbegin(T... args)

◆ getFromTS()

template<class TYPE , std::enable_if_t<!std::is_constructible_v< TYPE >, void * > = nullptr>
_GetType< TYPE >::return_type Gaudi::Utils::getFromTS ( IDataProviderSvc service,
std::string_view  location 
)

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 79 of file GetData.h.

79  {
80  DataObject* obj = nullptr;
81  // Return the casted pointer if the retrieve was successful or nullptr otherwise.
82  StatusCode sc = service->retrieveObject( location, obj );
83  if ( sc.isSuccess() ) {
84  typename _GetType<TYPE>::return_type tobj = dynamic_cast<typename _GetType<TYPE>::return_type>( obj );
85  return tobj;
86  } else {
87  return nullptr;
88  }
89  }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool isSuccess() const
Definition: StatusCode.h:365
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view 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:40

◆ getGaudiAlg()

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 69 of file GetAlgs.cpp.

69 { return getAlg<GaudiAlgorithm>( svc ); }

◆ getGaudiSequencer()

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 123 of file GetAlgs.cpp.

123 { return getAlg<GaudiSequencer>( svc ); }

◆ getHistoAlg()

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 87 of file GetAlgs.cpp.

87 { return getAlg<GaudiHistoAlg>( svc ); }

◆ getProperty() [1/3]

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

214  {
215  // trivial check
216  if ( !p ) { return nullptr; } // RETURN
217  // get all properties
218  const auto& props = p->getProperties();
219  // comparison criteria:
220  auto ifound = std::find_if( props.begin(), props.end(), is_iByName{name} );
221  return ifound != props.end() ? *ifound : nullptr;
222 }
T find_if(T... args)
virtual const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const =0
Get list of properties.

◆ getProperty() [2/3]

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

242  {
243  // trivial check
244  if ( !p ) { return nullptr; } // RETURN
245  // remove const-qualifier
246  IInterface* _i = const_cast<IInterface*>( p );
247  if ( !_i ) { return nullptr; } // RETURN
248  SmartIF<IProperty> property( _i );
249  return property ? getProperty( property, name ) : nullptr;
250 }
const char *PyHelper() getProperty(IInterface *p, char *name)
Definition: Bootstrap.cpp:247
Definition of the basic interface.
Definition: IInterface.h:254

◆ getProperty() [3/3]

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

302  {
303  // trivial check
304  if ( !p ) { return nullptr; } // RETURN
305  auto ifound = std::find_if( p->begin(), p->end(), is_iByName{name} );
306  return p->end() != ifound ? *ifound : nullptr; // RETURN
307 }
T end(T... args)
T find_if(T... args)
T begin(T... args)

◆ getSequencer()

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 159 of file GetAlgs.cpp.

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

◆ getSequencerAlg()

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 140 of file GetAlgs.cpp.

140 { return getAlg<Sequencer>( svc ); }

◆ getTupleAlg()

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 105 of file GetAlgs.cpp.

105 { return getAlg<GaudiTupleAlg>( svc ); }

◆ hasProperty() [1/3]

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

105  {
106  // delegate the actual work to another method ;
107  return p && getProperty( p, name );
108 }
const char *PyHelper() getProperty(IInterface *p, char *name)
Definition: Bootstrap.cpp:247

◆ hasProperty() [2/3]

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

82  {
83  // delegate to another method after trivial check
84  return p && getProperty( p, name );
85 }
const char *PyHelper() getProperty(IInterface *p, char *name)
Definition: Bootstrap.cpp:247

◆ hasProperty() [3/3]

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

275  {
276  // delegate to another method
277  return getProperty( p, name );
278 }
const char *PyHelper() getProperty(IInterface *p, char *name)
Definition: Bootstrap.cpp:247

◆ iequal()

bool Gaudi::Utils::iequal ( const std::string v1,
const std::string v2 
)
inline

Helper for case insensitive string comparison.

Definition at line 54 of file PropertyHolder.h.

54  {
55  return v1.size() == v2.size() && std::equal( std::begin( v1 ), std::end( v1 ), std::begin( v2 ),
56  []( char c1, char c2 ) { return toupper( c1 ) == toupper( c2 ); } );
57  }
T end(T... args)
T size(T... args)
T begin(T... args)
T equal(T... args)
void toupper(std::string &s)

◆ operator<<()

std::ostream& Gaudi::Utils::operator<< ( std::ostream s,
const TypeNameString tn 
)
inline

Output stream operator for TypeNameString instances.

Definition at line 54 of file TypeNameString.h.

54  {
55  return s << tn.type() << '/' << tn.name();
56  }
string s
Definition: gaudirun.py:328

◆ setProperty() [1/15]

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 1207 of file Property.h.

1207  {
1208  using Gaudi::Utils::toString;
1209  return component && hasProperty( component, name )
1210  ? Gaudi::Utils::setProperty( component, name, toString( value ), doc )
1211  : StatusCode::FAILURE;
1212  }
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:1207
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:341
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
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
Definition: Property.cpp:275

◆ setProperty() [2/15]

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 1121 of file Property.h.

1121  {
1122  return setProperty( component, name, value, std::string() );
1123  }
STL class.
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243

◆ setProperty() [3/15]

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

342  {
343  if ( !component ) { return StatusCode::FAILURE; } // RETURN
344  if ( !hasProperty( component, name ) ) { return StatusCode::FAILURE; }
345  StatusCode sc = component->setProperty( name, value );
346  if ( !doc.empty() ) {
347  PropertyBase* p = getProperty( component, name );
348  if ( p ) { p->setDocumentation( doc ); }
349  }
350  sc.ignore();
351  return sc;
352 }
T empty(T... args)
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:98
GAUDI_API bool hasProperty(const IProperty *p, const std::string &name)
simple function which check the existence of the property with the given name.
Definition: Property.cpp:105
const char *PyHelper() getProperty(IInterface *p, char *name)
Definition: Bootstrap.cpp:247
virtual StatusCode setProperty(const Gaudi::Details::PropertyBase &p)=0
Set the property by property.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:42
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:168
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ setProperty() [4/15]

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

324  {
325  return Gaudi::Utils::setProperty( component, name, std::string{value}, doc );
326 }
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:1207
STL class.

◆ setProperty() [5/15]

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 1171 of file Property.h.

1172  {
1173  return component ? setProperty( component, name, std::string( value, value + N ), doc ) : StatusCode::FAILURE;
1174  }
STL class.
int N
Definition: IOTest.py:110
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243

◆ setProperty() [6/15]

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

377  {
378  if ( !component || !property ) return StatusCode::FAILURE;
379  PropertyBase* p = getProperty( component, name );
380  if ( !p || !p->assign( *property ) ) return StatusCode::FAILURE;
381  if ( !doc.empty() ) { p->setDocumentation( doc ); }
382  return StatusCode::SUCCESS;
383 }
T empty(T... args)
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:98
virtual bool assign(const PropertyBase &source)=0
import the property value form the source
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
const char *PyHelper() getProperty(IInterface *p, char *name)
Definition: Bootstrap.cpp:247
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:42
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ setProperty() [7/15]

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

408  {
409  return setProperty( component, name, &property, doc );
410 }
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243

◆ setProperty() [8/15]

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 1285 of file Property.h.

1286  {
1287  return setProperty( component, name, &value, doc );
1288  }
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243

◆ setProperty() [9/15]

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 1311 of file Property.h.

1312  {
1313  if ( !component ) { return StatusCode::FAILURE; }
1314  auto property = SmartIF<IProperty>{component};
1315  return property ? setProperty( property, name, value, doc ) : StatusCode::FAILURE;
1316  }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ setProperty() [10/15]

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

426  {
427  if ( !component ) { return StatusCode::FAILURE; }
428  SmartIF<IProperty> property( component );
429  return property ? setProperty( property, name, value, doc ) : StatusCode::FAILURE;
430 }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ setProperty() [11/15]

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

446  {
447  return setProperty( component, name, std::string{value}, doc );
448 }
STL class.
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243

◆ setProperty() [12/15]

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 1362 of file Property.h.

1363  {
1364  if ( 0 == component ) { return StatusCode::FAILURE; }
1365  return setProperty( component, name, std::string{value, value + N}, doc );
1366  }
STL class.
int N
Definition: IOTest.py:110
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ setProperty() [13/15]

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

473  {
474  if ( !component ) { return StatusCode::FAILURE; }
475  SmartIF<IProperty> prop( component );
476  if ( !prop ) { return StatusCode::FAILURE; }
477  return setProperty( prop, name, property, doc );
478 }
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243
constexpr static const auto FAILURE
Definition: StatusCode.h:101

◆ setProperty() [14/15]

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

503  {
504  return setProperty( component, name, &property, doc );
505 }
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243

◆ setProperty() [15/15]

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 1439 of file Property.h.

1440  {
1441  return setProperty( component, name, &value, doc );
1442  }
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:243

◆ toStream() [1/35]

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 291 of file ToStream.h.

297  {
298  using ref_t = typename std::iterator_traits<ITERATOR>::reference;
300  return ostream_joiner( s << open, first, last, delim,
301  []( std::ostream& os, ref_t i ) -> std::ostream& { return toStream( i, os ); } )
302  << close;
303  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:47
string s
Definition: gaudirun.py:328
STL class.

◆ toStream() [2/35]

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 167 of file Histo2String.cpp.

167  {
168  return _toStream_1D_( histo, stream, asXML );
169 }

◆ toStream() [3/35]

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 57 of file BoostArrayAsProperty.h.

57  {
58  return toStream( obj.begin(), obj.end(), s, "( ", " )", " , " );
59  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
string s
Definition: gaudirun.py:328

◆ toStream() [4/35]

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 275 of file ToStream.h.

275  {
276  return s << obj;
277  }
string s
Definition: gaudirun.py:328

◆ toStream() [5/35]

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 187 of file Histo2String.cpp.

187  {
188  return _toStream_2D_( histo, stream, asXML );
189 }

◆ toStream() [6/35]

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 177 of file Histo2String.cpp.

177  {
178  return _toStream_1D_( histo, stream, asXML );
179 }

◆ toStream() [7/35]

template<class SCALAR >
std::ostream& Gaudi::Utils::toStream ( const SCALAR &  ,
std::ostream  
)

◆ toStream() [8/35]

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

197  {
198  return _toStream_2D_( histo, stream, asXML );
199 }

◆ toStream() [9/35]

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 85 of file ToStream.h.

85 { return s << std::quoted( obj, '\'' ); }
string s
Definition: gaudirun.py:328

◆ toStream() [10/35]

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 87 of file SVectorAsProperty.h.

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

◆ toStream() [11/35]

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 90 of file ToStream.h.

90 { return s << ( obj ? "True" : "False" ); }
string s
Definition: gaudirun.py:328

◆ toStream() [12/35]

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 95 of file ToStream.h.

95  {
96  const int p = s.precision();
97  return s << std::setprecision( prec ) << obj << std::setprecision( p );
98  }
string s
Definition: gaudirun.py:328
T setprecision(T... args)

◆ toStream() [13/35]

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 207 of file Histo2String.cpp.

207  {
208  auto root = Gaudi::Utils::Aida2ROOT::aida2root( &histo );
209  return root ? toStream( *root, stream, asXML ) : stream;
210 }
static TH1D * aida2root(AIDA::IHistogram1D *aida)
get the underlying pointer for 1D-histogram
Definition: Aida2ROOT.cpp:80
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93

◆ toStream() [14/35]

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 103 of file ToStream.h.

103  {
104  const int p = s.precision();
105  return s << std::setprecision( prec ) << obj << std::setprecision( p );
106  }
string s
Definition: gaudirun.py:328
T setprecision(T... args)

◆ toStream() [15/35]

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 218 of file Histo2String.cpp.

218  {
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:80
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93

◆ toStream() [16/35]

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 111 of file ToStream.h.

111  {
112  const int p = s.precision();
113  return s << std::setprecision( prec ) << obj << std::setprecision( p );
114  }
string s
Definition: gaudirun.py:328
T setprecision(T... args)

◆ toStream() [17/35]

std::ostream & Gaudi::Utils::toStream ( const DataObjectHandleBase v,
std::ostream o 
)

Definition at line 30 of file DataObjectHandleProperty.cpp.

30 { return o << v; }

◆ toStream() [18/35]

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 124 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:93
string s
Definition: gaudirun.py:328

◆ toStream() [19/35]

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.

135  {
136  return toStream( obj.begin(), obj.end(), s, "[ ", " ]", " , " );
137  }
T end(T... args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
T begin(T... args)
string s
Definition: gaudirun.py:328

◆ toStream() [20/35]

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 146 of file ToStream.h.

146  {
147  return toStream( obj.begin(), obj.end(), s, "[ ", " ]", " , " );
148  }
T end(T... args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
T begin(T... args)
string s
Definition: gaudirun.py:328

◆ toStream() [21/35]

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 157 of file ToStream.h.

157  {
158  return toStream( obj.begin(), obj.end(), s, "[ ", " ]", " , " );
159  }
T end(T... args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
T begin(T... args)
string s
Definition: gaudirun.py:328

◆ toStream() [22/35]

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 165 of file ToStream.h.

165  {
166  return toStream( obj.begin(), obj.end(), s, "[", "]", " , " );
167  }
T end(T... args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
T begin(T... args)
string s
Definition: gaudirun.py:328

◆ toStream() [23/35]

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 177 of file ToStream.h.

177  {
179  return ostream_joiner( s << "{ ", obj, " , ",
181  return toStream( i.second, toStream( i.first, os ) << " : " );
182  } )
183  << " }";
184  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:47
string s
Definition: gaudirun.py:328
STL class.

◆ toStream() [24/35]

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 195 of file ToStream.h.

195  {
197  return ostream_joiner( s << "{ ", obj, " , ",
199  return toStream( i.second, toStream( i.first, os ) << " : " );
200  } )
201  << " }";
202  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:47
string s
Definition: gaudirun.py:328
STL class.

◆ toStream() [25/35]

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 66 of file StringKey.cpp.

66  {
67  return Gaudi::Utils::toStream( key.str(), s );
68 }
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:291
const std::string & str() const
the actual string
Definition: StringKey.h:56
string s
Definition: gaudirun.py:328

◆ toStream() [26/35]

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 213 of file ToStream.h.

213  {
215  return ostream_joiner( s << "{ ", obj, " , ",
217  return toStream( i.second, toStream( i.first, os ) << " : " );
218  } )
219  << " }";
220  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:47
string s
Definition: gaudirun.py:328
STL class.

◆ toStream() [27/35]

std::ostream & Gaudi::Utils::toStream ( const Gaudi::XYZPoint obj,
std::ostream s 
)

print XYZ point

Definition at line 116 of file ParsersVct.cpp.

116  {
117  s << "( ";
118  toStream( obj.X(), s );
119  s << " , ";
120  toStream( obj.Y(), s );
121  s << " , ";
122  toStream( obj.Z(), s );
123  s << " )";
124  return s;
125 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
string s
Definition: gaudirun.py:328

◆ toStream() [28/35]

std::ostream & Gaudi::Utils::toStream ( const Gaudi::XYZVector obj,
std::ostream s 
)

print XYZ vector

Definition at line 129 of file ParsersVct.cpp.

129  {
130  s << "( ";
131  toStream( obj.X(), s );
132  s << " , ";
133  toStream( obj.Y(), s );
134  s << " , ";
135  toStream( obj.Z(), s );
136  s << " )";
137 
138  return s;
139 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
string s
Definition: gaudirun.py:328

◆ toStream() [29/35]

std::ostream & Gaudi::Utils::toStream ( const Gaudi::LorentzVector obj,
std::ostream s 
)

print Lorentz vector

Definition at line 143 of file ParsersVct.cpp.

143  {
144 
145  s << "( ";
146  toStream( obj.Px(), s, 12 );
147  s << " , ";
148  toStream( obj.Py(), s, 12 );
149  s << " , ";
150  toStream( obj.Pz(), s, 13 );
151  s << " , ";
152  toStream( obj.E(), s, 14 );
153  s << " )";
154 
155  return s;
156 }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
string s
Definition: gaudirun.py:328

◆ toStream() [30/35]

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 231 of file ToStream.h.

231  {
232  // Copy the hash map into a map to have it ordered by key.
233  return toStream( GaudiUtils::Map<KTYPE, VTYPE>{obj.begin(), obj.end()}, s );
234  }
Extension of the STL map.
Definition: Map.h:91
iterator end()
Definition: Map.h:140
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
iterator begin()
Definition: Map.h:139
string s
Definition: gaudirun.py:328

◆ toStream() [31/35]

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 241 of file ToStream.h.

241  {
242  return toStream( obj, obj + N, s, "( ", " )", " , " );
243  }
int N
Definition: IOTest.py:110
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
string s
Definition: gaudirun.py:328

◆ toStream() [32/35]

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 250 of file ToStream.h.

250  {
251  return toStream( begin( obj ), end( obj ), s, "( ", " )", " , " );
252  }
def end
Definition: IOTest.py:123
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
string s
Definition: gaudirun.py:328
AttribStringParser::Iterator begin(const AttribStringParser &parser)

◆ toStream() [33/35]

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 259 of file ToStream.h.

259  {
260  return toStream( std::string( obj, obj + N ), s );
261  }
STL class.
int N
Definition: IOTest.py:110
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
string s
Definition: gaudirun.py:328

◆ toStream() [34/35]

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 267 of file ToStream.h.

267 { return toStream( std::string( obj ), s ); }
STL class.
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
string s
Definition: gaudirun.py:328

◆ toStream() [35/35]

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 328 of file ToStream.h.

328  {
329  return TuplePrinter<decltype( tuple ), sizeof...( Args )>::toStream( tuple, s << " ( " ) << " ) ";
330  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
string s
Definition: gaudirun.py:328

◆ toString() [1/13]

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 232 of file Histo2String.cpp.

232  {
234  toStream( histo, o, asXML );
235  return o.str();
236 }
T str(T... args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93

◆ toString() [2/13]

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 260 of file Histo2String.cpp.

260  {
262  toStream( histo, o, asXML );
263  return o.str();
264 }
T str(T... args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93

◆ toString() [3/13]

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 246 of file Histo2String.cpp.

246  {
248  toStream( histo, o, asXML );
249  return o.str();
250 }
T str(T... args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93

◆ toString() [4/13]

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 274 of file Histo2String.cpp.

274  {
276  toStream( histo, o, asXML );
277  return o.str();
278 }
T str(T... args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93

◆ toString() [5/13]

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 288 of file Histo2String.cpp.

288  {
290  toStream( histo, o, asXML );
291  return o.str();
292 }
T str(T... args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93

◆ toString() [6/13]

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 302 of file Histo2String.cpp.

302  {
304  toStream( histo, o, asXML );
305  return o.str();
306 }
T str(T... args)
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93

◆ toString() [7/13]

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

316 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:341

◆ toString() [8/13]

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

326 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:341

◆ toString() [9/13]

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

336 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:341

◆ toString() [10/13]

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

356 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:341

◆ toString() [11/13]

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

346 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:341

◆ toString() [12/13]

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 366 of file Histo2String.cpp.

366 { return histo ? toString( *histo ) : "{}"; }
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:341

◆ toString() [13/13]

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 341 of file ToStream.h.

341  {
343  std::ios::fmtflags orig_flags = s.flags();
344  s.setf( std::ios::showpoint ); // to display correctly floats
345  toStream( obj, s );
346  s.flags( orig_flags );
347  return s.str();
348  }
std::ostream & toStream(const DataObjID &d, std::ostream &os)
Definition: DataObjID.cpp:93
string s
Definition: gaudirun.py:328