7#include <boost/tokenizer.hpp>
10#include "GaudiKernel/System.h"
32 if( ( ti ==
typeid(
char* ) ) ||
33 ( ti ==
typeid(
char ) ) ||
34 ( ti ==
typeid(
unsigned char ) ) ||
35 ( ti ==
typeid(
short ) ) ||
36 ( ti ==
typeid(
unsigned short ) ) ||
37 ( ti ==
typeid(
int ) ) ||
38 ( ti ==
typeid(
unsigned int ) ) ||
39 ( ti ==
typeid(
float ) ) ||
40 ( ti ==
typeid(
double ) ) ||
41 ( ti ==
typeid(
long long ) ) ||
42 ( ti ==
typeid(
unsigned long long ) ) ||
43 ( ti ==
typeid(
bool ) ) ) {
75 if (&parent !=
this) {
110 const std::type_info& ti,
112 const std::string& docstring,
120 <<
"Specified variable name (" <<
name <<
") doesn't have the "
121 <<
"expected prefix (" <<
m_prefix <<
")";
122 return StatusCode::RECOVERABLE;
133 return StatusCode::SUCCESS;
137 var.setType( System::typeinfoName( ti.name() ) );
143 var.setDoc( docstring );
148 return StatusCode::SUCCESS;
158 const std::type_info& ,
165 <<
"addDimensionedVariable(...) not implemented";
167 return StatusCode::FAILURE;
194 static size_t objectCounter = 0;
195 std::string name = m_name;
198 name =
"D3PDObject" + std::to_string( objectCounter );
200 return name +
"_" + genSuffix (name, RANDOM_NAME_POSTFIX_LENGTH);
215 return metaName.substr( 0, metaName.size() -
258 std::set< Variable >::const_iterator itr =
m_variables.begin();
259 std::set< Variable >::const_iterator end =
m_variables.end();
260 for( ; itr != end; ++itr ) {
282 boost::keep_empty_tokens );
283 boost::tokenizer< boost::char_separator< char > > tokens(
data,
285 boost::tokenizer< boost::char_separator< char > >
::const_iterator itr = tokens.begin();
286 boost::tokenizer< boost::char_separator< char > >
::const_iterator end = tokens.end();
291 <<
"The received data can not be parsed successfully: "
293 return StatusCode::FAILURE;
301 <<
"Version mismatch! The metadata was saved with a different "
302 <<
"serialization version (" << *itr <<
") than the code used ("
304 return StatusCode::FAILURE;
312 <<
"The received data can not be parsed successfully: "
314 return StatusCode::FAILURE;
323 <<
"The received data can not be parsed successfully: "
325 return StatusCode::FAILURE;
331 }
else if( *itr ==
"1" ) {
335 <<
"The received data can not be parsed successfully: "
337 return StatusCode::FAILURE;
343 for( ; itr != end; ++itr ) {
345 CHECK( var.read( *itr ) );
349 return StatusCode::SUCCESS;
365 return this->
merge( obj );
378 if(
name() != obj.name() ) {
380 <<
"Can't merge object with name \"" << obj.name()
381 <<
"\" into another object with name \"" <<
name() <<
"\"";
386 std::set< Variable >::const_iterator itr = obj.variables().begin();
387 std::set< Variable >::const_iterator end = obj.variables().end();
388 for( ; itr != end; ++itr ) {
412 static std::unordered_map<std::string, size_t> namecount;
414 const size_t count = ++namecount[name];
415 std::ostringstream os;
416 os << std::setw(
length) << std::setprecision(
length) << std::setfill(
'0')
501 boost::keep_empty_tokens );
502 boost::tokenizer< boost::char_separator< char > > tokens(
data,
504 boost::tokenizer< boost::char_separator< char > >
::const_iterator itr = tokens.begin();
507 if( itr == tokens.end() ) {
509 <<
"The received data can not be parsed successfully: "
511 return StatusCode::FAILURE;
518 if( itr == tokens.end() ) {
520 <<
"The received data can not be parsed successfully: "
522 return StatusCode::FAILURE;
529 if( itr == tokens.end() ) {
531 <<
"The received data can not be parsed successfully: "
533 return StatusCode::FAILURE;
540 if( itr == tokens.end() ) {
542 <<
"The received data can not be parsed successfully: "
544 return StatusCode::FAILURE;
550 }
else if( *itr ==
"1" ) {
554 <<
"The received data can not be parsed successfully: "
556 return StatusCode::FAILURE;
559 return StatusCode::SUCCESS;
564 return ( (
name() == var.name() ) &&
565 (
type() == var.type() ) );
570 if(
name() != var.name() ) {
571 return (
name() < var.name() );
573 return (
type() < var.type() );
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
#define CHECK(...)
Evaluate an expression and check for errors.
char data[hepevt_bytes_allocation_ATLAS]
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Block filler tool for noisy FEB information.
bool isPrimitive(const std::string &type)
This function is used in the code generator to determine from a type name if it's a primitive type or...
StatusCode DummyInitAlg::initialize ATLAS_NOT_THREAD_SAFE()
Standard Gaudi initialize method.
ObjectMetadata operator+(const ObjectMetadata &obj1, const ObjectMetadata &obj2)
Operator for creating the sum of two metadata objects.