ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConfAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5// C/C++
6#include <algorithm>
7#include <sstream>
8
11
12
13//--------------------------------------------------------------------------------------
15 :m_index(0),
16 m_position(0),
17 m_name_id(0),
18 m_type_id(0),
19 m_name(),
20 m_type()
21{
22}
23
24//--------------------------------------------------------------------------------------
26 const uint32_t position,
27 const std::string& name,
28 const std::string& type,
29 const uint32_t name_id,
30 const uint32_t type_id)
31 :m_index(index),
32 m_position(position),
33 m_name_id(name_id),
34 m_type_id(type_id),
35 m_name(name),
37{
38 if(position >= 128) {
39 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "TrigConfAlg") << "Position is too large";
40 }
41 if(index >= 65535) {
42 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "TrigConfAlg") << "Index is too large";
43 }
44}
45
46//--------------------------------------------------------------------------------------
48{
49 //
50 // Clear all string variables
51 //
52 m_name.clear();
53 m_type.clear();
54}
55
56//--------------------------------------------------------------------------------------
57void TrigConfAlg::print(std::ostream &os) const
58{
59 os << str(*this) << std::endl;
60}
61
62//--------------------------------------------------------------------------------------
63std::string str(const TrigConfAlg &o)
64{
65 std::stringstream s;
66 s << "TrigConfAlg: " << o.getPosition() << " "
67 << o.getName() << "/" << o.getType() << " = "
68 << o.getNameId() << "/" << o.getTypeId();
69
70 return s.str();
71}
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.
uint8_t m_position
Definition TrigConfAlg.h:52
const std::string & getType() const
Definition TrigConfAlg.h:40
uint16_t m_index
Definition TrigConfAlg.h:51
std::string m_type
Definition TrigConfAlg.h:57
std::string m_name
Definition TrigConfAlg.h:56
uint8_t getPosition() const
Definition TrigConfAlg.h:43
uint32_t m_type_id
Definition TrigConfAlg.h:54
void print(std::ostream &os=std::cout) const
uint32_t m_name_id
Definition TrigConfAlg.h:53
uint32_t getNameId() const
Definition TrigConfAlg.h:44
void clearStrings()
const std::string & getName() const
Definition TrigConfAlg.h:39
uint32_t getTypeId() const
Definition TrigConfAlg.h:45
Definition index.py:1