ATLAS Offline Software
Loading...
Searching...
No Matches
RootConnection.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7// RootConnection.h
8// Header file for class Athena::RootConnection
9// Author: Peter van Gemmeren <gemmeren@anl.gov>
11#ifndef ATHENAROOTCOMPS_ROOTCONNECTION_H
12#define ATHENAROOTCOMPS_ROOTCONNECTION_H 1
13
18
19// STL includes
20#include <string>
21
22// fwk includes
23#include "GaudiKernel/StatusCode.h"
24
25// fwd declares
26class IInterface;
27class TFile;
28class TTree;
29class TBranch;
30
31namespace Athena {
36{
37public:
39 RootConnection(const IInterface* own, const std::string& pfn);
41 virtual ~RootConnection();
42
44 // Public methods:
46
48 StatusCode connectRead();
50 StatusCode connectWrite(const std::string& mode);
52 StatusCode commit();
54 StatusCode disconnect();
56 bool isConnected() const;
58 StatusCode read(void* const data, size_t len);
60 StatusCode write(const void* data, unsigned long& len);
62 StatusCode setContainer(const std::string& container, const std::string& type);
63
65 // Private data:
67private:
69 std::string m_fid;
71 std::string m_pfn;
73 //int m_age;
75 //const IInterface* m_owner;
76
78 TFile* m_file;
80 TTree* m_tree;
82 TBranch* m_branch;
85
86 //FIXME: use a RootConnectionSetup class to
87 // gather this kind of configuration
88 // -> autoflush, split, buffersize,...
89};
90
91} //> namespace Athena
92
93#endif /* !ATHENAROOTCOMPS_ROOTCONNECTION_H */
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
StatusCode disconnect()
Release data stream and release implementation dependent resources.
StatusCode connectRead()
Open data stream in read mode.
TFile * m_file
Age counter.
bool isConnected() const
Check if connected to data source.
StatusCode write(const void *data, unsigned long &len)
Write root byte buffer to output stream.
virtual ~RootConnection()
Standard destructor.
std::string m_fid
File ID of the connection.
StatusCode connectWrite(const std::string &mode)
Open data stream in write mode.
std::string m_pfn
Physical file name of the connection.
StatusCode read(void *const data, size_t len)
Read root byte buffer from input stream.
char m_branchTypeCode
Branch typecode for branch we are asked to write out.
StatusCode setContainer(const std::string &container, const std::string &type)
Set the container name and type, creating TTree and TBranch as needed.
RootConnection(const IInterface *own, const std::string &pfn)
Standard constructor.
StatusCode commit()
Commit data stream to ROOT.
TTree * m_tree
Pointer to the main event data tree.
TBranch * m_branch
Pointer to the current data branch.
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....