|
ATLAS Offline Software
|
Go to the documentation of this file.
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 ) ) ) {
62 : m_variables(), m_name(
"" ), m_prefix(
"" ),
63 m_container( false ) {
68 : m_variables(
parent.m_variables ), m_name(
parent.m_name ),
69 m_prefix(
parent.m_prefix ), m_container(
parent.m_container ) {
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;
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();
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 ) {
349 return StatusCode::SUCCESS;
365 return this->
merge( obj );
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;
415 std::ostringstream
os;
416 os << std::setw(
length) << std::setprecision(
length) << std::setfill(
'0')
423 :
m_type(
"" ), m_name(
"" ), m_doc(
"" ), m_primitive( true ) {
467 m_primitive = primitive;
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() ) &&
571 return (
name() <
var.name() );
573 return (
type() <
var.type() );
char data[hepevt_bytes_allocation_ATLAS]
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...
Block filler tool for noisy FEB information.
ObjectMetadata operator+(const ObjectMetadata &obj1, const ObjectMetadata &obj2)
Operator for creating the sum of two metadata objects.
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
StatusCode DummyInitAlg::initialize ATLAS_NOT_THREAD_SAFE()
Standard Gaudi initialize method.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
std::string to_string(const DetectorType &type)
Helpers for checking error return status codes and reporting errors.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...