27{
28 void JobConfig ::
29 testInvariant () const
30 {
32 }
33
34
35
36 JobConfig ::
37 JobConfig () noexcept
38 {
40 }
41
42
43
44 JobConfig ::
46 : TObject (that),
47 m_algorithmCount (that.m_algorithmCount)
48 {
50
51 for (
const auto&
algorithm : that.m_algorithms)
52 {
54 {
55 m_algorithms.push_back (
algorithm->makeClone ());
56 } else
57 {
58 m_algorithms.emplace_back (nullptr);
59 }
60 }
61
63 }
64
65
66
67 JobConfig ::
70 {
71 that.swap (*this);
72
73
74 }
75
76
77
78 JobConfig ::
79 ~JobConfig () noexcept
80 {
82
83
84
85 }
86
87
88
91 {
92
94 return *this;
95 }
96
97
98
101 {
102
103 that.swap (*this);
104 return *this;
105 }
106
107
108
109 void JobConfig ::
111 {
114 std::swap (m_algorithmCount, that.m_algorithmCount);
115 m_algorithms.swap (that.m_algorithms);
116 }
117
118
119
120 ::StatusCode JobConfig ::
121 addAlgorithm (std::unique_ptr<IAlgorithmWrapper>&& val_algorithm)
122 {
123 using namespace msgEventLoop;
124
127
128 if (getAlgorithm (val_algorithm->getName()) != nullptr)
129 {
130 ANA_MSG_ERROR (
"can't have two algorithms with the same name: " << val_algorithm->getName());
131 return ::StatusCode::FAILURE;
132 }
133
134 m_algorithms.push_back (std::move (val_algorithm));
135 ++ m_algorithmCount;
136 return ::StatusCode::SUCCESS;
137 }
138
139
140
141 const IAlgorithmWrapper *JobConfig ::
142 getAlgorithm (std::string_view name) const noexcept
143 {
145 for (
const auto&
algorithm : m_algorithms)
146 {
149 }
150 return nullptr;
151 }
152
153
154
155 std::vector<std::unique_ptr<EL::IAlgorithmWrapper>> JobConfig ::
156 extractAlgorithms ()
157 {
159 if (m_algorithmCount != m_algorithms.size())
160 RCU_THROW_MSG (
"algorithm count missmatch. streaming error?");
161 for (
const auto&
algorithm : m_algorithms)
162 {
165 }
166 m_algorithmCount = 0;
167 return std::move (m_algorithms);
168 }
169
170
171
172 std::size_t JobConfig ::
173 numberOfAlgorithms ()
const noexcept
174 {
176 return m_algorithms.size();
177 }
178}
#define RCU_DESTROY_INVARIANT(x)
#define RCU_CHANGE_INVARIANT(x)
#define RCU_NEW_INVARIANT(x)
#define RCU_READ_INVARIANT(x)
#define RCU_THROW_MSG(message)
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)