ATLAS Offline Software
Functions
OutputStream.cxx File Reference
#include <EventLoop/OutputStream.h>
#include <EventLoop/Algorithm.h>
#include <RootCoreUtils/Assert.h>
#include <SampleHandler/DiskOutput.h>
Include dependency graph for OutputStream.cxx:

Go to the source code of this file.

Functions

 ClassImp (EL::OutputStream) namespace EL
 

Function Documentation

◆ ClassImp()

ClassImp ( EL::OutputStream  )

Definition at line 28 of file OutputStream.cxx.

31 {
32  const std::string OutputStream::optType = "EventLoop_OutputStreamType";
33  const std::string OutputStream::optMergeCmd = "EventLoop_MergeCmd";
34  const std::string OutputStream::optContainerSuffix = "EventLoop_DSSuffix";
35 
36  void OutputStream ::
37  testInvariant () const
38  {
39  RCU_INVARIANT (this);
40  RCU_INVARIANT (!m_label.empty());
41  }
42 
43 
44 
47  : m_label ("out"), m_output (0)
48  {
49  RCU_NEW_INVARIANT (this);
50  }
51 
52 
53 
55  OutputStream (const std::string& val_label)
56  : m_label (val_label), m_output (0)
57  {
58  RCU_REQUIRE_SOFT (!val_label.empty());
59 
60  RCU_NEW_INVARIANT (this);
61  }
62 
63 
64 
66  OutputStream (const std::string& val_label, const std::string& val_type)
67  : m_label (val_label), m_output (0)
68  {
69  RCU_REQUIRE_SOFT (!val_label.empty());
70 
71  m_options.setString(optType, val_type);
72 
73  RCU_NEW_INVARIANT (this);
74  }
75 
76 
77 
79  OutputStream (const OutputStream& that)
80  : TObject (that), m_label (that.m_label),
81  m_options (that.m_options), m_output (0)
82  {
83  RCU_READ_INVARIANT (&that);
84 
85  if (that.m_output != 0)
86  {
87  m_output = dynamic_cast<SH::DiskOutput*>(that.m_output->Clone ());
88  RCU_ASSERT (m_output != 0);
89  }
90  }
91 
92 
93 
94  OutputStream ::
95  ~OutputStream ()
96  {
97  RCU_DESTROY_INVARIANT (this);
98 
99  delete m_output;
100  }
101 
102 
103 
104  OutputStream& OutputStream ::
105  operator = (OutputStream that)
106  {
107  // no invariant used
108  that.swap (*this);
109  return *this;
110  }
111 
112 
113 
114  void OutputStream ::
115  swap (OutputStream& that)
116  {
117  RCU_CHANGE_INVARIANT (this);
118  RCU_CHANGE_INVARIANT (&that);
119 
120  m_label.swap (that.m_label);
121  m_options.swap (that.m_options);
122 
123  SH::DiskOutput *tmp_output = m_output;
124  m_output = that.m_output;
125  that.m_output = tmp_output;
126  }
127 
128 
129 
130  const std::string& OutputStream ::
131  label () const
132  {
133  RCU_READ_INVARIANT (this);
134  return m_label;
135  }
136 
137 
138 
139  void OutputStream ::
140  label (const std::string& val_label)
141  {
142  RCU_CHANGE_INVARIANT (this);
143  RCU_REQUIRE_SOFT (!val_label.empty());
144  m_label = val_label;
145  }
146 
147 
148 
150  options ()
151  {
152  RCU_READ_INVARIANT (this);
153  return &m_options;
154  }
155 
156 
157 
159  options () const
160  {
161  RCU_READ_INVARIANT (this);
162  return &m_options;
163  }
164 
165 
166 
168  output() const
169  {
170  RCU_READ_INVARIANT (this);
171  return m_output;
172  }
173 
174 
175 
176  void OutputStream ::
177  output (SH::DiskOutput *output_swallow)
178  {
179  RCU_CHANGE_INVARIANT (this);
180  delete m_output;
181  m_output = output_swallow;
182  }
183 }
SH::MetaObject
A class that manages meta-data to be associated with an object.
Definition: MetaObject.h:56
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
SH::DiskOutput
a class/interface representing an output location for files
Definition: DiskOutput.h:46
RCU_REQUIRE_SOFT
#define RCU_REQUIRE_SOFT(x)
Definition: Assert.h:153
python.AtlRunQueryLib.options
options
Definition: AtlRunQueryLib.py:379
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition: Assert.h:201
INav4MomDumper_jobOptions.OutputStream
OutputStream
Definition: INav4MomDumper_jobOptions.py:20
merge.output
output
Definition: merge.py:17
RCU_DESTROY_INVARIANT
#define RCU_DESTROY_INVARIANT(x)
Definition: Assert.h:235
RCU_CHANGE_INVARIANT
#define RCU_CHANGE_INVARIANT(x)
Definition: Assert.h:231
RCU_ASSERT
#define RCU_ASSERT(x)
Definition: Assert.h:222
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition: Assert.h:229
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition: Assert.h:233