File indexing completed on 2025-01-30 09:16:56
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DD4hep/Printout.h>
0016 #include <DD4hep/InstanceCount.h>
0017 #include <DD4hep/ConditionsData.h>
0018
0019 using namespace dd4hep::cond;
0020
0021
0022 std::ostream& operator << (std::ostream& s, const AbstractMap& data) {
0023 struct _Print {
0024 void operator()(const AbstractMap::Params::value_type& obj) const {
0025 if ( obj.second.typeInfo() == typeid(AbstractMap) ) {
0026 const AbstractMap& d= obj.second.get<AbstractMap>();
0027 dd4hep::printout(dd4hep::INFO,"Condition","++ %-16s [%d] %-8s -> %s",
0028 obj.first.c_str(), d.classID,
0029 obj.second.dataType().c_str(),
0030 obj.second.str().c_str());
0031 }
0032 else {
0033 dd4hep::printout(dd4hep::INFO,"Condition","++ %-16s %-8s -> %s",
0034 obj.first.c_str(),
0035 obj.second.dataType().c_str(),
0036 obj.second.str().c_str());
0037 }
0038 }
0039 };
0040 if ( !data.params.empty() ) {
0041 for_each(data.params.begin(), data.params.end(), _Print());
0042 }
0043 return s;
0044 }
0045
0046
0047 ClientData::~ClientData() {
0048 }
0049
0050
0051 AbstractMap::AbstractMap() : clientData(0), classID(0) {
0052 InstanceCount::increment(this);
0053 }
0054
0055
0056 AbstractMap::AbstractMap(const AbstractMap& c)
0057 : clientData(c.clientData), params(c.params), classID(c.classID)
0058 {
0059 InstanceCount::increment(this);
0060 }
0061
0062
0063 AbstractMap::~AbstractMap() {
0064 if ( clientData ) clientData->release();
0065 clientData = 0;
0066 InstanceCount::decrement(this);
0067 }
0068
0069
0070 AbstractMap& AbstractMap::operator=(const AbstractMap& c) {
0071 if ( this != &c ) {
0072 clientData = c.clientData;
0073 params = c.params;
0074 classID = c.classID;
0075 }
0076 return *this;
0077 }
0078
0079 #include <DD4hep/GrammarUnparsed.h>
0080 static auto s_registry = dd4hep::GrammarRegistry::pre_note<AbstractMap>(1);