ATLAS Offline Software
Loading...
Searching...
No Matches
OutputStream.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7//
8// includes
9//
10
12
13#include <EventLoop/Algorithm.h>
16
17//
18// method implementations
19//
20
22
23namespace EL
24{
25 const std::string OutputStream::optType = "EventLoop_OutputStreamType";
26 const std::string OutputStream::optMergeCmd = "EventLoop_MergeCmd";
27 const std::string OutputStream::optContainerSuffix = "EventLoop_DSSuffix";
28
29 void OutputStream ::
30 testInvariant () const
31 {
32 RCU_INVARIANT (this);
33 RCU_INVARIANT (!m_label.empty());
34 }
35
36
37
38 OutputStream ::
39 OutputStream ()
40 : m_label ("out"), m_output (0)
41 {
42 RCU_NEW_INVARIANT (this);
43 }
44
45
46
47 OutputStream ::
48 OutputStream (const std::string& val_label)
49 : m_label (val_label), m_output (0)
50 {
51 RCU_REQUIRE_SOFT (!val_label.empty());
52
53 RCU_NEW_INVARIANT (this);
54 }
55
56
57
58 OutputStream ::
59 OutputStream (const std::string& val_label, const std::string& val_type)
60 : m_label (val_label), m_output (0)
61 {
62 RCU_REQUIRE_SOFT (!val_label.empty());
63
64 m_options.setString(optType, val_type);
65
66 RCU_NEW_INVARIANT (this);
67 }
68
69
70
71 OutputStream ::
72 OutputStream (const OutputStream& that)
73 : TObject (that), m_label (that.m_label),
74 m_options (that.m_options), m_output (0)
75 {
76 RCU_READ_INVARIANT (&that);
77
78 if (that.m_output != 0)
79 {
80 m_output = dynamic_cast<SH::DiskOutput*>(that.m_output->Clone ());
81 RCU_ASSERT (m_output != 0);
82 }
83 }
84
85
86
87 OutputStream ::
88 ~OutputStream ()
89 {
91
92 delete m_output;
93 }
94
95
96
97 OutputStream& OutputStream ::
98 operator = (OutputStream that)
99 {
100 // no invariant used
101 that.swap (*this);
102 return *this;
103 }
104
105
106
107 void OutputStream ::
108 swap (OutputStream& that)
109 {
111 RCU_CHANGE_INVARIANT (&that);
112
113 m_label.swap (that.m_label);
114 m_options.swap (that.m_options);
115
116 SH::DiskOutput *tmp_output = m_output;
117 m_output = that.m_output;
118 that.m_output = tmp_output;
119 }
120
121
122
123 const std::string& OutputStream ::
124 label () const
125 {
126 RCU_READ_INVARIANT (this);
127 return m_label;
128 }
129
130
131
132 void OutputStream ::
133 label (const std::string& val_label)
134 {
136 RCU_REQUIRE_SOFT (!val_label.empty());
137 m_label = val_label;
138 }
139
140
141
142 SH::MetaObject *OutputStream ::
143 options ()
144 {
145 RCU_READ_INVARIANT (this);
146 return &m_options;
147 }
148
149
150
151 const SH::MetaObject *OutputStream ::
152 options () const
153 {
154 RCU_READ_INVARIANT (this);
155 return &m_options;
156 }
157
158
159
160 const SH::DiskOutput *OutputStream ::
161 output() const
162 {
163 RCU_READ_INVARIANT (this);
164 return m_output;
165 }
166
167
168
169 void OutputStream ::
170 output (SH::DiskOutput *output_swallow)
171 {
173 delete m_output;
174 m_output = output_swallow;
175 }
176}
#define RCU_INVARIANT(x)
Definition Assert.h:196
#define RCU_ASSERT(x)
Definition Assert.h:217
#define RCU_DESTROY_INVARIANT(x)
Definition Assert.h:230
#define RCU_CHANGE_INVARIANT(x)
Definition Assert.h:226
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:228
#define RCU_REQUIRE_SOFT(x)
Definition Assert.h:148
#define RCU_READ_INVARIANT(x)
Definition Assert.h:224
ClassImp(EL::OutputStream) namespace EL
static const std::string optContainerSuffix
static const std::string optType
static const std::string optMergeCmd
a class/interface representing an output location for files
Definition DiskOutput.h:46
A class that manages meta-data to be associated with an object.
Definition MetaObject.h:48
This module defines the arguments passed from the BATCH driver to the BATCH worker.