#include <NtupleCnvSvc.h>
|
| | NtupleCnvSvc (const std::string &name, ISvcLocator *pSvcLocator) |
| | Constructor with parameters:
|
| virtual | ~NtupleCnvSvc () |
| | Destructor:
|
| virtual StatusCode | initialize () |
| | Gaudi Service Implementation.
|
| virtual StatusCode | finalize () |
| virtual StatusCode | updateServiceState (IOpaqueAddress *pAddress) |
| | IConversionSvc and IConverter interfaces
|
| virtual StatusCode | createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) |
| | Implementation of IConverter: Create the transient representation of an object from persistent state.
|
| virtual StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) |
| | Implementation of IConverter: Convert the transient object to the requested representation.
|
| virtual StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
| | Implementation of IConverter: Resolve the references of the converted object.
|
| virtual StatusCode | connectOutput (const std::string &outputConnectionSpec, const std::string &openMode) |
| | Connect the output connection specification to the service with open mode.
|
| virtual StatusCode | connectOutput (const std::string &outputConnectionSpec) |
| | Connect the output connection specification to the service with open mode.
|
| virtual StatusCode | commitOutput (const std::string &outputConnectionSpec, bool doCommit) |
| | Commit pending output.
|
| virtual StatusCode | createAddress (long svcType, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) |
| | IAddressCreator interfaces
|
| virtual StatusCode | convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress) |
| | Convert address to string form.
|
| virtual StatusCode | createAddress (long svcType, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) |
| | Create address from string form.
|
Definition at line 29 of file NtupleCnvSvc.h.
◆ NtupleCnvSvc() [1/2]
| Athena::NtupleCnvSvc::NtupleCnvSvc |
( |
const std::string & | name, |
|
|
ISvcLocator * | pSvcLocator ) |
Constructor with parameters:
Definition at line 35 of file NtupleCnvSvc.cxx.
36 :
37 base_class( name, pSvcLocator, ROOT_StorageType )
38{
39}
◆ ~NtupleCnvSvc()
| Athena::NtupleCnvSvc::~NtupleCnvSvc |
( |
| ) |
|
|
virtual |
◆ NtupleCnvSvc() [2/2]
| Athena::NtupleCnvSvc::NtupleCnvSvc |
( |
| ) |
|
|
private |
◆ commitOutput()
| StatusCode Athena::NtupleCnvSvc::commitOutput |
( |
const std::string & | outputConnectionSpec, |
|
|
bool | doCommit ) |
|
virtual |
Commit pending output.
Definition at line 172 of file NtupleCnvSvc.cxx.
174{
176 << ", " << doCommit << ")...");
177 return StatusCode::SUCCESS;
178}
◆ connectOutput() [1/2]
| StatusCode Athena::NtupleCnvSvc::connectOutput |
( |
const std::string & | outputConnectionSpec | ) |
|
|
virtual |
Connect the output connection specification to the service with open mode.
- Parameters
-
| outputConnectionSpec | [IN] the name of the output connection specification as string. |
Definition at line 158 of file NtupleCnvSvc.cxx.
159{
161 << outputConnectionSpec << ")");
162
163 TFile *
f = TFile::Open(outputConnectionSpec.c_str(),
"recreate");
164 if (f == 0) {
165 return StatusCode::FAILURE;
166 }
167 return StatusCode::SUCCESS;
168}
◆ connectOutput() [2/2]
| StatusCode Athena::NtupleCnvSvc::connectOutput |
( |
const std::string & | outputConnectionSpec, |
|
|
const std::string & | openMode ) |
|
virtual |
Connect the output connection specification to the service with open mode.
- Parameters
-
| outputConnectionSpec | [IN] the name of the output connection specification as string. |
| openMode | [IN] the open mode of the file as string. |
Definition at line 138 of file NtupleCnvSvc.cxx.
140{
142 << outputConnectionSpec << ", "
143 << openMode << ")");
144
145
146 TFile *
f = TFile::Open(outputConnectionSpec.c_str(),
"recreate");
147 if (f == 0) {
148 return StatusCode::FAILURE;
149 }
150
151 return StatusCode::SUCCESS;
152}
◆ convertAddress()
| StatusCode Athena::NtupleCnvSvc::convertAddress |
( |
const IOpaqueAddress * | pAddress, |
|
|
std::string & | refAddress ) |
|
virtual |
Convert address to string form.
- Parameters
-
| pAddress | [IN] address to be converted. |
| refAddress | [OUT] converted string form. |
Definition at line 209 of file NtupleCnvSvc.cxx.
211{
213 << refAddress << ")...");
214 if (pAddress) {
215 refAddress = *pAddress->par();
216 return StatusCode::SUCCESS;
217 }
218 ATH_MSG_ERROR(
"::convertAddress: null pointer to IOpaqueAddress !");
219 return StatusCode::FAILURE;
220}
◆ createAddress() [1/2]
| StatusCode Athena::NtupleCnvSvc::createAddress |
( |
long | svcType, |
|
|
const CLID & | clid, |
|
|
const std::string & | refAddress, |
|
|
IOpaqueAddress *& | refpAddress ) |
|
virtual |
Create address from string form.
- Parameters
-
| svcType | [IN] service type of the address. |
| clid | [IN] class id for the address. |
| refAddress | [IN] string form to be converted. |
| refpAddress | [OUT] converted address. |
Definition at line 228 of file NtupleCnvSvc.cxx.
232{
234 << ", " << refAddress << ", " << refpAddress
235 << ")...");
236 if (svcType != ROOT_StorageType) {
240 return StatusCode::FAILURE;
241 }
242 refpAddress = new GenericAddress(ROOT_StorageType, clid, refAddress);
243 return StatusCode::SUCCESS;
244}
◆ createAddress() [2/2]
| StatusCode Athena::NtupleCnvSvc::createAddress |
( |
long | svcType, |
|
|
const CLID & | clid, |
|
|
const std::string * | par, |
|
|
const unsigned long * | ip, |
|
|
IOpaqueAddress *& | refpAddress ) |
|
virtual |
IAddressCreator interfaces
Create a Generic address using explicit arguments to identify a single object.
- Parameters
-
| svcType | [IN] service type of the address. |
| clid | [IN] class id for the address. |
| par | [IN] string containing the database name. |
| ip | [IN] object identifier. |
| refpAddress | [OUT] converted address. |
Definition at line 193 of file NtupleCnvSvc.cxx.
198{
200 << ", " << par << ", " << ip << ", " << refpAddress
201 << ")...");
202 return ::AthCnvSvc::createAddress(svcType, clid, par, ip, refpAddress);
203}
◆ createConverter()
| IConverter * Athena::NtupleCnvSvc::createConverter |
( |
long | typ, |
|
|
const CLID & | clid, |
|
|
const ICnvFactory * | fac ) |
|
protectedvirtual |
Create new Converter using factory (override AthCnvSvc::createConverter)
Definition at line 261 of file NtupleCnvSvc.cxx.
264{
266 << ", " << fac << ")...");
267 IConverter* cnv = new Athena::LeafCnv(clid, serviceLocator());
268 if (cnv) {
269 return cnv;
270 }
272}
virtual IConverter * createConverter(long typ, const CLID &clid, const ICnvFactory *fac)
Create new Converter using factory.
◆ createObj()
| StatusCode Athena::NtupleCnvSvc::createObj |
( |
IOpaqueAddress * | pAddress, |
|
|
DataObject *& | refpObject ) |
|
virtual |
Implementation of IConverter: Create the transient representation of an object from persistent state.
- Parameters
-
| pAddress | [IN] pointer to IOpaqueAddress of the representation. |
| refpObject | [OUT] pointer to DataObject to be created. |
Definition at line 83 of file NtupleCnvSvc.cxx.
84{
85 ATH_MSG_DEBUG(
"-->createObj(" << pAddress->par()[0] <<
"/" << pAddress->par()[1]
86 << ", " << refpObject << ")...");
87 GenericAddress *addr = dynamic_cast<GenericAddress*>(pAddress);
88 if (!addr) {
90 << " is NOT a GenericAddress!");
91 return StatusCode::FAILURE;
92 }
93 ATH_MSG_DEBUG(
" par: " << pAddress->par()[0] <<
"/" << pAddress->par()[1]
95 " ipar: " << *pAddress->ipar());
97}
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Implementation of IConverter: Create the transient representation of an object.
◆ createRep()
| StatusCode Athena::NtupleCnvSvc::createRep |
( |
DataObject * | pObject, |
|
|
IOpaqueAddress *& | refpAddress ) |
|
virtual |
Implementation of IConverter: Convert the transient object to the requested representation.
- Parameters
-
| pObject | [IN] pointer to DataObject. |
| refpAddress | [OUT] pointer to IOpaqueAddress of the representation to be created. |
Definition at line 105 of file NtupleCnvSvc.cxx.
106{
107 ATH_MSG_DEBUG(
"::createRep(" << refpAddress <<
", " << pObject <<
")...");
108
109 if (0==pObject) {
110 ATH_MSG_ERROR(
"::createRep: received null ptr to DataObject");
111 return StatusCode::FAILURE;
112 }
113 return ::AthCnvSvc::createRep(pObject, refpAddress);
114}
◆ fillRepRefs()
| StatusCode Athena::NtupleCnvSvc::fillRepRefs |
( |
IOpaqueAddress * | pAddress, |
|
|
DataObject * | pObject ) |
|
virtual |
Implementation of IConverter: Resolve the references of the converted object.
- Parameters
-
| pAddress | [IN] pointer to IOpaqueAddress of the representation to be resolved. |
| pObject | [IN] pointer to DataObject to be created. |
Definition at line 122 of file NtupleCnvSvc.cxx.
123{
124 ATH_MSG_DEBUG(
"::fillRepRefs(" << pAddress <<
", " << pObject <<
")...");
125 if (0==pAddress || 0==pObject) {
126 ATH_MSG_ERROR(
"::fillRepRefs: null ptr received! (paddr=" << pAddress
127 << ", pobj=" << pObject << ")");
128 return StatusCode::FAILURE;
129 }
130 return ::AthCnvSvc::fillRepRefs(pAddress, pObject);
131}
◆ finalize()
| StatusCode Athena::NtupleCnvSvc::finalize |
( |
| ) |
|
|
virtual |
Definition at line 57 of file NtupleCnvSvc.cxx.
58{
60
62}
virtual StatusCode finalize() override
◆ initialize()
| StatusCode Athena::NtupleCnvSvc::initialize |
( |
| ) |
|
|
virtual |
◆ updateServiceState()
| StatusCode Athena::NtupleCnvSvc::updateServiceState |
( |
IOpaqueAddress * | pAddress | ) |
|
|
virtual |
IConversionSvc and IConverter interfaces
update the service state (well, just check the IOpaqueAddress is in fact a GenericAddress )
Definition at line 67 of file NtupleCnvSvc.cxx.
68{
70 if (pAddress) {
71 return dynamic_cast<GenericAddress*>(pAddress)
72 ? StatusCode::SUCCESS
74 }
75 return StatusCode::FAILURE;
76}
::StatusCode StatusCode
StatusCode definition for legacy code.
The documentation for this class was generated from the following files: