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
ConditionsData.cpp
Go to the documentation of this file.
1 // $Id$
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 
15 // Framework includes
16 #include "DD4hep/Printout.h"
17 #include "DD4hep/InstanceCount.h"
18 #include "DD4hep/ConditionsData.h"
19 #include <sstream>
20 
21 using namespace DD4hep::Conditions;
22 
24 std::ostream& operator << (std::ostream& s, const AbstractMap& data) {
25  struct _Print {
26  void operator()(const AbstractMap::Params::value_type& obj) const {
27  const AbstractMap& d= obj.second.get<AbstractMap>();
28  DD4hep::printout(DD4hep::INFO,"Condition","++ %-16s [%d] %-8s -> %s",
29  obj.first.c_str(), d.classID,
30  obj.second.dataType().c_str(),
31  obj.second.str().c_str());
32  }
33  };
34  if ( !data.params.empty() ) {
35  for_each(data.params.begin(), data.params.end(),_Print());
36  }
37  return s;
38 }
39 
42 }
43 
46  : clientData(c.clientData), params(c.params), classID(c.classID)
47 {
49 }
50 
52 AbstractMap::AbstractMap() : clientData(0) {
54 }
55 
58  if ( clientData ) clientData->release();
59  clientData = 0;
61 }
62 
65  if ( this != &c ) {
67  params = c.params;
68  classID = c.classID;
69  }
70  return *this;
71 }
72 
73 #include "DD4hep/ToStream.h"
76 
77 #include "DD4hep/BasicGrammar_inl.h"
78 DD4HEP_DEFINE_PARSER_GRAMMAR(AbstractMap,eval_none<AbstractMap>)
79 
std::ostream & operator<<(std::ostream &os, const DetType &t)
Definition: DetType.h:98
virtual ~ClientData()
Default destructor.
static void decrement(T *)
Decrement count according to type information.
TGeoShape * s
Definition: Volumes.cpp:294
AbstractMap & operator=(const AbstractMap &c)
Assignment operator.
#define DD4HEP_DEFINE_PARSER_GRAMMAR(x, func)
static void increment(T *)
Increment count according to type information.
Definition: InstanceCount.h:98
virtual ~AbstractMap()
Default destructor.
Conditions data block. Internally maps other objects to abstract data blocks.
int printout(PrintLevel severity, const char *src, const char *fmt,...)
Calls the display action with a given severity level.
Definition: Printout.cpp:111
AbstractMap()
Default constructor.
#define DD4HEP_DEFINE_CONDITIONS_TYPE_DUMMY(x)