ATLAS Offline Software
Loading...
Searching...
No Matches
SortingConnector.cxx
Go to the documentation of this file.
1// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2
4
6
10
11using namespace std;
12using namespace TCS;
13
15 const string & algorithm,
16 const string & output) :
17 Connector(output, {input}, algorithm, {output}, SORT)
18{}
19
20
24
25
32
33
36 return dynamic_cast<InputConnector*>(m_inputConnectors[0]);
37}
38
39
40void
43 m_sortingAlgorithm = dynamic_cast<SortingAlg*>(alg); // set a local copy
44 if(m_sortingAlgorithm == nullptr && alg != nullptr) {
45 TCS_EXCEPTION("Error: algorithm" << alg->name() << " is not a sorting alg");
46 }
47}
48
49
50// attaches the sorted data to the connector (does take ownership)
51void
53 if(m_outputData != 0) {
54 TCS_EXCEPTION("Trying to attach data to input connector '" << name() << "' which has already data attached");
55 }
57}
58
59
60namespace TCS {
61
62
63ostream &
64operator<<(ostream &o, const TCS::SortingConnector & conn) {
65 o << conn.inputNames()[0] << " ---[ " << conn.algorithmName() << " ]---> " << conn.outputNames()[0];
66 return o;
67}
68
69
70}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Connector(const std::string &name, ConnectorType conntype)
Definition Connector.cxx:31
std::vector< TCS::Connector * > m_inputConnectors
Definition Connector.h:98
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
void attachOutputData(const TOBArray *data)
SortingConnector(const std::string &input, const std::string &algorithm, const std::string &output)
SortingAlg * m_sortingAlgorithm
InputConnector * inputConnector() const
TOBArray const * m_outputData
void setAlgorithm(ConfigurableAlg *alg)
std::string algorithm
Definition hcg.cxx:85
std::ostream & operator<<(std::ostream &os, const TCS::Bin &bin)
STL namespace.