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*/
6// C/C++
7#include <algorithm>
8#include <sstream>
9#include <iostream>
10
11
12//--------------------------------------------------------------------------------------
14 const uint32_t position,
15 const std::string& name,
16 const std::string& type,
17 const uint32_t name_id,
18 const uint32_t type_id)
19 :m_index(index),
20 m_position(position),
21 m_name_id(name_id),
22 m_type_id(type_id),
23 m_name(name),
25{
26 if(position >= 128) {
27 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "TrigConfAlg") << "Position is too large";
28 }
29 if(index >= 65535) {
30 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "TrigConfAlg") << "Index is too large";
31 }
32}
33
34//--------------------------------------------------------------------------------------
36{
37 //
38 // Clear all string variables
39 //
40 m_name.clear();
41 m_type.clear();
42}
43
44//--------------------------------------------------------------------------------------
45void TrigConfAlg::print(std::ostream &os) const
46{
47 os << str(*this) << std::endl;
48}
49
51{
52 std::cout << str(*this) << std::endl;
53}
54
55
56//--------------------------------------------------------------------------------------
57std::string str(const TrigConfAlg &o)
58{
59 std::stringstream s;
60 s << "TrigConfAlg: " << o.getPosition() << " "
61 << o.getName() << "/" << o.getType() << " = "
62 << o.getNameId() << "/" << o.getTypeId();
63
64 return s.str();
65}
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:53
const std::string & getType() const
Definition TrigConfAlg.h:40
uint16_t m_index
Definition TrigConfAlg.h:52
std::string m_type
Definition TrigConfAlg.h:58
TrigConfAlg()=default
std::string m_name
Definition TrigConfAlg.h:57
uint8_t getPosition() const
Definition TrigConfAlg.h:43
uint32_t m_type_id
Definition TrigConfAlg.h:55
void print() const
uint32_t m_name_id
Definition TrigConfAlg.h:54
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