13 #ifndef DD4HEP_PRINTOUT_H
14 #define DD4HEP_PRINTOUT_H
34 template <
typename T>
class Handle;
35 typedef Handle<NamedObject>
Ref_t;
68 std::string
arguments(
int argc,
char** argv);
95 int printout(
PrintLevel severity,
const std::string& src,
const std::string& fmt, ...);
124 int printout(
PrintLevel severity,
const std::string& src,
const char* fmt, va_list& args);
134 int printout(
PrintLevel severity,
const std::string& src,
const std::string& fmt, va_list& args);
144 int printout(
PrintLevel severity,
const char* src,
const std::string& fmt, va_list& args);
152 int except(
const std::string& src,
const std::string& fmt, ...);
160 int except(
const char* src,
const char* fmt, ...);
169 int except(
const std::string& src,
const std::string& fmt, va_list& args);
178 int except(
const char* src,
const char* fmt, va_list& args);
186 std::string
format(
const std::string& src,
const std::string& fmt, ...);
194 std::string
format(
const char* src,
const char* fmt, ...);
203 std::string
format(
const std::string& src,
const std::string& fmt, va_list& args);
212 std::string
format(
const char* src,
const char* fmt, va_list& args);
260 template <
typename T>
inline std::ostream&
print(
const T&
object, std::ostream& os = std::cout,
261 const std::string& indent =
"") {
296 return value ?
"YES" :
"NO ";
300 return value ?
"true " :
"false";
void operator()() const
Callback operator to be specialized depending on the element type.
Printer(const Geometry::LCDD *l, std::ostream &stream, const std::string &p="")
Initializing constructor of the functor.
void setPrinter2(void *print_arg, output_function2_t fcn)
Customize printer function.
Helper class template to implement ASCII dumps of named objects maps.
const char * true_false(bool value)
Helper function to print booleans in format true/false.
const char * yes_no(bool value)
Helper function to print booleans in format YES/NO.
cont_type & cont
Reference to the container data of the map.
Helper class template to implement ASCII object dumps.
const Geometry::LCDD * lcdd
Reference to the detector description object.
void operator()(const T &value) const
Callback operator to be specialized depending on the element type.
PrintLevel printLevel()
Access the current printer level.
int except(const std::string &src, const std::string &fmt,...)
Calls the display action with ERROR and throws an std::runtime_error exception.
std::ostream & os
Reference to the output stream object, the Printer object should write.
DD4hep::Geometry::DetElement DetElement
std::string format(const std::string &src, const std::string &fmt,...)
Build formatted string.
size_t(* output_function1_t)(void *, PrintLevel severity, const char *, const char *)
const std::map< std::string, Ref_t > cont_type
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
std::string text
Optional text prefix when formatting the output.
void setPrinter(void *print_arg, output_function1_t fcn)
Customize printer function.
size_t(* output_function2_t)(void *, PrintLevel severity, const char *, const char *, va_list &args)
std::string setPrintFormat(const std::string &new_format)
Set new printout format for the 3 fields: source-level-message. All 3 are strings.
Handle< NamedObject > Ref_t
Default Ref_t definition describing named objects.
std::ostream & os
Reference to the output stream object, the Printer object should write.
The main interface to the DD4hep detector description package.
std::string prefix
Optional text prefix when formatting the output.
PrintMap(const Geometry::LCDD *l, std::ostream &stream, cont_type &c, const std::string &t="")
Initializing constructor of the functor.
const Geometry::LCDD * lcdd
Reference to the detector description object.
int printout(PrintLevel severity, const char *src, const char *fmt,...)
Calls the display action with a given severity level.
PrintLevel setPrintLevel(PrintLevel new_level)
Set new print level. Returns the old print level.
std::ostream & print(const T &object, std::ostream &os=std::cout, const std::string &indent="")
std::string arguments(int argc, char **argv)
Helper function to serialize argument list to a single string.