ATLAS Offline Software
Loading...
Searching...
No Matches
Connector.cxx
Go to the documentation of this file.
1// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
4
9
13
14using namespace std;
15using namespace TCS;
16
17TCS::Connector::Connector( const std::string & name,
18 const std::vector<std::string> & inputs,
19 const std::string & algorithm,
20 const std::vector<std::string> & outputs,
21 ConnectorType conntype ) :
22 m_name(name),
24 m_inputNames(inputs),
25 m_outputNames(outputs),
26 m_conntype(conntype)
27{}
28
29
30
31TCS::Connector::Connector( const std::string & name,
32 ConnectorType conntype ) :
33 m_name(name),
34 m_conntype(conntype)
35{}
36
37
39
40
41void
42TCS::Connector::setAlgorithm(TCS::ConfigurableAlg* alg) { // alg ownership is with the factory
43 m_algorithm = alg;
44}
45
46
50
51 // clear the output data
52 sc &= clearOutput();
53 m_hasInputOverflow = false;
54 m_hasAmbiguity = false;
55
56 // reset the algorithm
57 if(m_algorithm)
58 sc &= m_algorithm->reset();
59
60 // reset the execution flags
61 m_isExecuted = false;
63
64 return sc;
65}
66
67unsigned int
70 return (static_cast<const DecisionAlg*>(algorithm()))->numberOutputBits();
71 } else {
72 return 0;
73 }
74}
75
77{
78 m_hasInputOverflow = value;
79}
80
81void TCS::Connector::toggleAmbiguity(const bool value)
82{
83 m_hasAmbiguity = value;
84}
85
86ostream &
87operator<<(ostream &o, const TCS::Connector & conn) {
88 try {
89 o << dynamic_cast<const TCS::DecisionConnector&>(conn);
90 return o;
91 } catch(...) {}
92 try {
93 o << dynamic_cast<const TCS::SortingConnector&>(conn);
94 return o;
95 } catch(...) {}
96 try {
97 o << dynamic_cast<const TCS::InputConnector&>(conn);
98 return o;
99 } catch(...) {}
100
101 return o;
102}
static Double_t sc
StatusCode reset()
Definition Connector.cxx:48
std::string m_algorithmName
Definition Connector.h:93
void toggleInputOverflow(const bool value)
to be toggled after 'attachOutputData' is called.
Definition Connector.cxx:76
std::string m_name
Definition Connector.h:92
virtual StatusCode clearOutput()=0
Connector(const std::string &name, ConnectorType conntype)
Definition Connector.cxx:31
StatusCode m_executionStatusCode
Definition Connector.h:107
void toggleAmbiguity(const bool value)
Definition Connector.cxx:81
bool isDecisionConnector() const
Definition Connector.h:41
unsigned int numberOutputBits() const
Definition Connector.cxx:68
ConnectorType m_conntype
Definition Connector.h:117
bool m_hasAmbiguity
Definition Connector.h:113
bool m_hasInputOverflow
whether the input data came with an overflow bit
Definition Connector.h:111
std::vector< std::string > m_inputNames
Definition Connector.h:94
const std::string & name() const
Definition Connector.h:44
virtual void setAlgorithm(TCS::ConfigurableAlg *)
Definition Connector.cxx:42
const TCS::ConfigurableAlg * algorithm() const
Definition Connector.h:50
virtual ~Connector()
Definition Connector.cxx:38
std::vector< std::string > m_outputNames
Definition Connector.h:95
TCS::ConfigurableAlg * m_algorithm
the algorithm that belongs to this connector
Definition Connector.h:102
std::string algorithm
Definition hcg.cxx:85
std::ostream & operator<<(std::ostream &os, const TCS::Bin &bin)
STL namespace.