ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
TCS::SortingConnector Class Reference

#include <SortingConnector.h>

Inheritance diagram for TCS::SortingConnector:
Collaboration diagram for TCS::SortingConnector:

Public Types

enum  ConnectorType {
  NONE =0, INPUT, SORT, DECISION,
  COUNT
}
 

Public Member Functions

 SortingConnector (const std::string &input, const std::string &algorithm, const std::string &output)
 
virtual ~SortingConnector ()
 
InputConnectorinputConnector () const
 
std::string inputName () const
 
std::string outputName () const
 
void attachOutputData (const TOBArray *data)
 
const TOBArrayoutputData () const
 
void setAlgorithm (ConfigurableAlg *alg)
 
SortingAlgsortingAlgorithm ()
 
StatusCode clearOutput ()
 
bool isInputConnector () const
 
bool isSortingConnector () const
 
bool isDecisionConnector () const
 
bool isCountingConnector () const
 
const std::string & name () const
 
const std::string & algorithmName () const
 
const std::vector< std::string > & inputNames () const
 
const std::vector< std::string > & outputNames () const
 
const std::vector< TCS::Connector * > & inputConnectors () const
 
const TCS::ConfigurableAlgalgorithm () const
 
StatusCode reset ()
 
bool isExecuted () const
 
StatusCode executionStatusCode () const
 
unsigned int numberOutputBits () const
 
void toggleInputOverflow (const bool value)
 to be toggled after 'attachOutputData' is called. More...
 
bool hasInputOverflow () const
 
void toggleAmbiguity (const bool value)
 
bool hasAmbiguity () const
 

Protected Member Functions

std::vector< TCS::Connector * > & inputConnectors ()
 
TCS::ConfigurableAlgalgorithm ()
 
void setIsExecuted (bool isExecuted)
 
void setExecutionStatusCode (StatusCode statusCode)
 

Protected Attributes

std::string m_name {""}
 
std::string m_algorithmName {""}
 
std::vector< std::string > m_inputNames
 
std::vector< std::string > m_outputNames
 
std::vector< TCS::Connector * > m_inputConnectors
 
TCS::ConfigurableAlgm_algorithm { nullptr }
 the algorithm that belongs to this connector More...
 
bool m_isExecuted {false}
 
StatusCode m_executionStatusCode {StatusCode::SUCCESS}
 
bool m_hasInputOverflow
 whether the input data came with an overflow bit More...
 
bool m_hasAmbiguity
 

Private Attributes

SortingAlgm_sortingAlgorithm
 
TOBArray constm_outputData { nullptr }
 
ConnectorType m_conntype { NONE }
 

Detailed Description

Definition at line 24 of file SortingConnector.h.

Member Enumeration Documentation

◆ ConnectorType

Enumerator
NONE 
INPUT 
SORT 
DECISION 
COUNT 

Definition at line 25 of file Connector.h.

25 { NONE=0, INPUT, SORT, DECISION, COUNT };

Constructor & Destructor Documentation

◆ SortingConnector()

SortingConnector::SortingConnector ( const std::string &  input,
const std::string &  algorithm,
const std::string &  output 
)

Definition at line 14 of file SortingConnector.cxx.

16  :
18 {}

◆ ~SortingConnector()

SortingConnector::~SortingConnector ( )
virtual

Definition at line 21 of file SortingConnector.cxx.

21  {
22  clearOutput();
23 }

Member Function Documentation

◆ algorithm() [1/2]

TCS::ConfigurableAlg* TCS::Connector::algorithm ( )
inlineprotectedinherited

Definition at line 87 of file Connector.h.

87 { return m_algorithm; }

◆ algorithm() [2/2]

const TCS::ConfigurableAlg* TCS::Connector::algorithm ( ) const
inlineinherited

Definition at line 50 of file Connector.h.

50 { return m_algorithm; }

◆ algorithmName()

const std::string& TCS::Connector::algorithmName ( ) const
inlineinherited

Definition at line 45 of file Connector.h.

45 { return m_algorithmName; }

◆ attachOutputData()

void SortingConnector::attachOutputData ( const TOBArray data)

Definition at line 52 of file SortingConnector.cxx.

52  {
53  if(m_outputData != 0) {
54  TCS_EXCEPTION("Trying to attach data to input connector '" << name() << "' which has already data attached");
55  }
57 }

◆ clearOutput()

TCS::StatusCode TCS::SortingConnector::clearOutput ( )
virtual

Implements TCS::Connector.

Definition at line 27 of file SortingConnector.cxx.

27  {
28  delete m_outputData;
29  m_outputData = 0;
30  return StatusCode::SUCCESS;
31 }

◆ executionStatusCode()

StatusCode TCS::Connector::executionStatusCode ( ) const
inlineinherited

Definition at line 61 of file Connector.h.

61 { return m_executionStatusCode; }

◆ hasAmbiguity()

bool TCS::Connector::hasAmbiguity ( ) const
inlineinherited

Definition at line 73 of file Connector.h.

73 { return m_hasAmbiguity; }

◆ hasInputOverflow()

bool TCS::Connector::hasInputOverflow ( ) const
inlineinherited

Definition at line 70 of file Connector.h.

70 { return m_hasInputOverflow; }

◆ inputConnector()

InputConnector * SortingConnector::inputConnector ( ) const

Definition at line 35 of file SortingConnector.cxx.

35  {
36  return dynamic_cast<InputConnector*>(m_inputConnectors[0]);
37 }

◆ inputConnectors() [1/2]

std::vector<TCS::Connector*>& TCS::Connector::inputConnectors ( )
inlineprotectedinherited

Definition at line 85 of file Connector.h.

85 { return m_inputConnectors; }

◆ inputConnectors() [2/2]

const std::vector<TCS::Connector*>& TCS::Connector::inputConnectors ( ) const
inlineinherited

Definition at line 49 of file Connector.h.

49 { return m_inputConnectors; }

◆ inputName()

std::string TCS::SortingConnector::inputName ( ) const
inline

Definition at line 35 of file SortingConnector.h.

35 { return m_inputNames.size()>0 ? m_inputNames[0] : ""; }

◆ inputNames()

const std::vector<std::string>& TCS::Connector::inputNames ( ) const
inlineinherited

Definition at line 46 of file Connector.h.

46 { return m_inputNames; }

◆ isCountingConnector()

bool TCS::Connector::isCountingConnector ( ) const
inlineinherited

Definition at line 42 of file Connector.h.

42 { return m_conntype == COUNT; }

◆ isDecisionConnector()

bool TCS::Connector::isDecisionConnector ( ) const
inlineinherited

Definition at line 41 of file Connector.h.

41 { return m_conntype == DECISION; }

◆ isExecuted()

bool TCS::Connector::isExecuted ( ) const
inlineinherited

Definition at line 59 of file Connector.h.

59 { return m_isExecuted; }

◆ isInputConnector()

bool TCS::Connector::isInputConnector ( ) const
inlineinherited

Definition at line 39 of file Connector.h.

39 { return m_conntype == INPUT; }

◆ isSortingConnector()

bool TCS::Connector::isSortingConnector ( ) const
inlineinherited

Definition at line 40 of file Connector.h.

40 { return m_conntype == SORT; }

◆ name()

const std::string& TCS::Connector::name ( ) const
inlineinherited

Definition at line 44 of file Connector.h.

44 { return m_name; }

◆ numberOutputBits()

unsigned int TCS::Connector::numberOutputBits ( ) const
inherited

Definition at line 68 of file Connector.cxx.

68  {
69  if(isDecisionConnector()) {
70  return ((DecisionAlg*) algorithm())->numberOutputBits();
71  } else {
72  return 0;
73  }
74 }

◆ outputData()

const TOBArray* TCS::SortingConnector::outputData ( ) const
inline

Definition at line 41 of file SortingConnector.h.

41 { return m_outputData; }

◆ outputName()

std::string TCS::SortingConnector::outputName ( ) const
inline

Definition at line 37 of file SortingConnector.h.

37 { return m_outputNames.size()>0 ? m_outputNames[0] : ""; }

◆ outputNames()

const std::vector<std::string>& TCS::Connector::outputNames ( ) const
inlineinherited

Definition at line 47 of file Connector.h.

47 { return m_outputNames; }

◆ reset()

TCS::StatusCode TCS::Connector::reset ( )
inherited

Definition at line 48 of file Connector.cxx.

48  {
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 }

◆ setAlgorithm()

void SortingConnector::setAlgorithm ( TCS::ConfigurableAlg alg)
virtual

Reimplemented from TCS::Connector.

Definition at line 41 of file SortingConnector.cxx.

41  {
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 }

◆ setExecutionStatusCode()

void TCS::Connector::setExecutionStatusCode ( StatusCode  statusCode)
inlineprotectedinherited

Definition at line 83 of file Connector.h.

◆ setIsExecuted()

void TCS::Connector::setIsExecuted ( bool  isExecuted)
inlineprotectedinherited

Definition at line 81 of file Connector.h.

◆ sortingAlgorithm()

SortingAlg* TCS::SortingConnector::sortingAlgorithm ( )
inline

Definition at line 45 of file SortingConnector.h.

45 { return m_sortingAlgorithm; }

◆ toggleAmbiguity()

void TCS::Connector::toggleAmbiguity ( const bool  value)
inherited

Definition at line 81 of file Connector.cxx.

82 {
84 }

◆ toggleInputOverflow()

void TCS::Connector::toggleInputOverflow ( const bool  value)
inherited

to be toggled after 'attachOutputData' is called.

This flag is reset with reset().

Definition at line 76 of file Connector.cxx.

77 {
79 }

Member Data Documentation

◆ m_algorithm

TCS::ConfigurableAlg* TCS::Connector::m_algorithm { nullptr }
protectedinherited

the algorithm that belongs to this connector

Definition at line 102 of file Connector.h.

◆ m_algorithmName

std::string TCS::Connector::m_algorithmName {""}
protectedinherited

Definition at line 93 of file Connector.h.

◆ m_conntype

ConnectorType TCS::Connector::m_conntype { NONE }
privateinherited

Definition at line 117 of file Connector.h.

◆ m_executionStatusCode

StatusCode TCS::Connector::m_executionStatusCode {StatusCode::SUCCESS}
protectedinherited

Definition at line 107 of file Connector.h.

◆ m_hasAmbiguity

bool TCS::Connector::m_hasAmbiguity
protectedinherited

Definition at line 113 of file Connector.h.

◆ m_hasInputOverflow

bool TCS::Connector::m_hasInputOverflow
protectedinherited

whether the input data came with an overflow bit

Definition at line 111 of file Connector.h.

◆ m_inputConnectors

std::vector<TCS::Connector*> TCS::Connector::m_inputConnectors
protectedinherited

Definition at line 98 of file Connector.h.

◆ m_inputNames

std::vector<std::string> TCS::Connector::m_inputNames
protectedinherited

Definition at line 94 of file Connector.h.

◆ m_isExecuted

bool TCS::Connector::m_isExecuted {false}
protectedinherited

Definition at line 105 of file Connector.h.

◆ m_name

std::string TCS::Connector::m_name {""}
protectedinherited

Definition at line 92 of file Connector.h.

◆ m_outputData

TOBArray const* TCS::SortingConnector::m_outputData { nullptr }
private

Definition at line 54 of file SortingConnector.h.

◆ m_outputNames

std::vector<std::string> TCS::Connector::m_outputNames
protectedinherited

Definition at line 95 of file Connector.h.

◆ m_sortingAlgorithm

SortingAlg* TCS::SortingConnector::m_sortingAlgorithm
private

Definition at line 51 of file SortingConnector.h.


The documentation for this class was generated from the following files:
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::Connector::m_executionStatusCode
StatusCode m_executionStatusCode
Definition: Connector.h:107
SGout2dot.alg
alg
Definition: SGout2dot.py:243
TCS::Connector::m_inputConnectors
std::vector< TCS::Connector * > m_inputConnectors
Definition: Connector.h:98
TCS::Connector::m_algorithm
TCS::ConfigurableAlg * m_algorithm
the algorithm that belongs to this connector
Definition: Connector.h:102
TCS::Connector::m_hasAmbiguity
bool m_hasAmbiguity
Definition: Connector.h:113
athena.value
value
Definition: athena.py:124
TCS::Connector::COUNT
@ COUNT
Definition: Connector.h:25
TCS::Connector::m_name
std::string m_name
Definition: Connector.h:92
TCS::Connector::INPUT
@ INPUT
Definition: Connector.h:25
dumpTruth.statusCode
statusCode
Definition: dumpTruth.py:85
TCS::SortingConnector::m_outputData
TOBArray const * m_outputData
Definition: SortingConnector.h:54
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TCS::DecisionAlg
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:22
TCS::Connector::m_algorithmName
std::string m_algorithmName
Definition: Connector.h:93
TCS::InputConnector
Definition: InputConnector.h:22
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TCS::Connector::m_conntype
ConnectorType m_conntype
Definition: Connector.h:117
TCS::Connector::Connector
Connector(const std::string &name, ConnectorType conntype)
Definition: Connector.cxx:31
TCS::ConfigurableAlg::reset
StatusCode reset()
Definition: ConfigurableAlg.h:58
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:14
TCS::Connector::isExecuted
bool isExecuted() const
Definition: Connector.h:59
merge.output
output
Definition: merge.py:17
TCS::Connector::algorithm
const TCS::ConfigurableAlg * algorithm() const
Definition: Connector.h:50
TCS::Connector::name
const std::string & name() const
Definition: Connector.h:44
TCS::Connector::m_outputNames
std::vector< std::string > m_outputNames
Definition: Connector.h:95
TCS::Connector::m_inputNames
std::vector< std::string > m_inputNames
Definition: Connector.h:94
TCS::Connector::DECISION
@ DECISION
Definition: Connector.h:25
TCS::SortingAlg
Definition: SortingAlg.h:18
TCS::Connector::SORT
@ SORT
Definition: Connector.h:25
TCS::Connector::m_isExecuted
bool m_isExecuted
Definition: Connector.h:105
TCS::Connector::isDecisionConnector
bool isDecisionConnector() const
Definition: Connector.h:41
TCS::Connector::NONE
@ NONE
Definition: Connector.h:25
TCS::SortingConnector::clearOutput
StatusCode clearOutput()
Definition: SortingConnector.cxx:27
TCS::Connector::clearOutput
virtual StatusCode clearOutput()=0
TCS::SortingConnector::m_sortingAlgorithm
SortingAlg * m_sortingAlgorithm
Definition: SortingConnector.h:51
TCS::Connector::m_hasInputOverflow
bool m_hasInputOverflow
whether the input data came with an overflow bit
Definition: Connector.h:111
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::Connector::setAlgorithm
virtual void setAlgorithm(TCS::ConfigurableAlg *)
Definition: Connector.cxx:42