DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
DD4hep::Utils Namespace Reference

Utility namespace to support boost::spirit. More...

Functions

std::ostream & toStream (const Property &result, std::ostream &os)
 
template<class TYPE >
std::ostream & toStream (const TYPE &obj, std::ostream &s)
 
template<class ITERATOR >
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 More...
 
std::ostream & toStream (const std::string &obj, std::ostream &s)
 the printtout of the strings. More...
 
std::ostream & toStream (const bool obj, std::ostream &s)
 the printout of boolean values "a'la Python" More...
 
std::ostream & toStream (const float obj, std::ostream &s, const int prec=6)
 the printout of float values with the reasonable precision More...
 
std::ostream & toStream (const double obj, std::ostream &s, const int prec=8)
 the printout of double values with the reasonable precision More...
 
std::ostream & toStream (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::ostream & toStream (const std::pair< KTYPE, VTYPE > &obj, std::ostream &s)
 
template<class TYPE , class ALLOCATOR >
std::ostream & toStream (const std::vector< TYPE, ALLOCATOR > &obj, std::ostream &s)
 
template<class TYPE , class ALLOCATOR >
std::ostream & toStream (const std::list< TYPE, ALLOCATOR > &obj, std::ostream &s)
 
template<class TYPE , class ALLOCATOR >
std::ostream & toStream (const std::deque< TYPE, ALLOCATOR > &obj, std::ostream &s)
 
template<class TYPE , class CMP , class ALLOCATOR >
std::ostream & toStream (const std::set< TYPE, CMP, ALLOCATOR > &obj, std::ostream &s)
 
template<class KTYPE , class VTYPE , class CMP , class ALLOCATOR >
std::ostream & toStream (const std::map< KTYPE, VTYPE, CMP, ALLOCATOR > &obj, std::ostream &s)
 
template<class TYPE , unsigned int N>
std::ostream & toStream (TYPE(&obj)[N], std::ostream &s)
 
template<class TYPE , unsigned int N>
std::ostream & toStream (const TYPE(&obj)[N], std::ostream &s)
 
template<unsigned int N>
std::ostream & toStream (char(&obj)[N], std::ostream &s)
 
template<unsigned int N>
std::ostream & toStream (const char(&obj)[N], std::ostream &s)
 
std::ostream & toStream (const char *obj, std::ostream &s)
 
template<class TYPE >
std::string toString (const TYPE &obj)
 
std::ostream & toStream (const ROOT::Math::XYZPoint &obj, std::ostream &s)
 print XYZ point More...
 
std::ostream & toStream (const ROOT::Math::XYZVector &obj, std::ostream &s)
 
std::ostream & toStream (const ROOT::Math::PxPyPzEVector &obj, std::ostream &s)
 print Lorentz vector More...
 

Detailed Description

Utility namespace to support boost::spirit.

Function Documentation

template<class TYPE >
std::ostream & DD4hep::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 254 of file ToStream.h.

template<class ITERATOR >
std::ostream & DD4hep::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

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

References s, and toStream().

std::ostream& DD4hep::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 81 of file ToStream.h.

References s.

std::ostream& DD4hep::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 94 of file ToStream.h.

std::ostream& DD4hep::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 101 of file ToStream.h.

std::ostream& DD4hep::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 109 of file ToStream.h.

std::ostream& DD4hep::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 117 of file ToStream.h.

template<class KTYPE , class VTYPE >
std::ostream& DD4hep::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 130 of file ToStream.h.

References toStream().

template<class TYPE , class ALLOCATOR >
std::ostream& DD4hep::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 145 of file ToStream.h.

References s, and toStream().

template<class TYPE , class ALLOCATOR >
std::ostream& DD4hep::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 156 of file ToStream.h.

References s, and toStream().

template<class TYPE , class ALLOCATOR >
std::ostream& DD4hep::Utils::toStream ( const std::deque< TYPE, ALLOCATOR > &  obj,
std::ostream &  s 
)
inline

the partial template specialization of std::deque<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 167 of file ToStream.h.

References s, and toStream().

template<class TYPE , class CMP , class ALLOCATOR >
std::ostream& DD4hep::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 178 of file ToStream.h.

References s, and toStream().

template<class KTYPE , class VTYPE , class CMP , class ALLOCATOR >
std::ostream& DD4hep::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 190 of file ToStream.h.

References toStream().

template<class TYPE , unsigned int N>
std::ostream& DD4hep::Utils::toStream ( 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.nf.nl
Date
2009-10-05

Definition at line 209 of file ToStream.h.

References toStream().

template<class TYPE , unsigned int N>
std::ostream& DD4hep::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.nf.nl
Date
2009-10-05

Definition at line 218 of file ToStream.h.

References toStream().

std::ostream& DD4hep::Utils::toStream ( const Property result,
std::ostream &  os 
)
template<unsigned int N>
std::ostream& DD4hep::Utils::toStream ( 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.nf.nl
Date
2009-10-05

Definition at line 227 of file ToStream.h.

References toStream().

template<unsigned int N>
std::ostream& DD4hep::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.nf.nl
Date
2009-10-05

Definition at line 236 of file ToStream.h.

References toStream().

std::ostream& DD4hep::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.nf.nl
Date
2009-10-05

Definition at line 244 of file ToStream.h.

References toStream().

std::ostream & DD4hep::Utils::toStream ( const ROOT::Math::XYZPoint &  obj,
std::ostream &  s 
)

print XYZ point

Definition at line 33 of file ToStream.cpp.

References s, and toStream().

std::ostream & DD4hep::Utils::toStream ( const ROOT::Math::XYZVector &  obj,
std::ostream &  s 
)

Definition at line 45 of file ToStream.cpp.

References s, and toStream().

std::ostream & DD4hep::Utils::toStream ( const ROOT::Math::PxPyPzEVector &  obj,
std::ostream &  s 
)

print Lorentz vector

Definition at line 57 of file ToStream.cpp.

References s, and toStream().

template<class TYPE >
std::string DD4hep::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
DD4hep::Utils::toStream
Todo:
need to be compared with boost::lexical_cast

Definition at line 297 of file ToStream.h.

References s, and toStream().