ATLAS Offline Software
Loading...
Searching...
No Matches
SH::DiskWriter Class Referenceabstract

an interface that manages writing a single output file More...

#include <DiskWriter.h>

Inheritance diagram for SH::DiskWriter:
Collaboration diagram for SH::DiskWriter:

Public Member Functions

void testInvariant () const
 test the invariant of this object
 DiskWriter ()
 standard constructor
virtual ~DiskWriter ()
 standard destructor
std::string path () const
 the path where this file can be accessed or the empty string if it is not known (yet).
TFile * file ()
 the file we are writing to
void close ()
 closes the file we are writing to

Private Member Functions

virtual std::string getPath () const =0
 the path where this file can be accessed or the empty string if it is not known (yet).
virtual TFile * getFile ()=0
 the file we are writing to
virtual void doClose ()=0
 closes the file we are writing to

Detailed Description

an interface that manages writing a single output file

Rationale
This interface allows to write files to arbitrary storage systems. Most importantly, it allows to execute actions after a file has been closed.
Warning
This interface may still change, if new output types are added that need new functionality.
See also
DiskOutput

Definition at line 28 of file DiskWriter.h.

Constructor & Destructor Documentation

◆ DiskWriter()

SH::DiskWriter::DiskWriter ( )

standard constructor

Guarantee
strong
Failures
out of memory I

Definition at line 29 of file DiskWriter.cxx.

31 {
32 RCU_NEW_INVARIANT (this);
33 }
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:233

◆ ~DiskWriter()

SH::DiskWriter::~DiskWriter ( )
virtual

standard destructor

Guarantee
no-fail
Rationale
virtual destructor for base class

Definition at line 37 of file DiskWriter.cxx.

39 {
41 }
#define RCU_DESTROY_INVARIANT(x)
Definition Assert.h:235

Member Function Documentation

◆ close()

void SH::DiskWriter::close ( )

closes the file we are writing to

Guarantee
basic
Failures
i/o errors
file already closed

Definition at line 66 of file DiskWriter.cxx.

68 {
70
71 doClose ();
72 }
#define RCU_CHANGE_INVARIANT(x)
Definition Assert.h:231
virtual void doClose()=0
closes the file we are writing to

◆ doClose()

virtual void SH::DiskWriter::doClose ( )
privatepure virtual

closes the file we are writing to

Guarantee
basic
Failures
i/o errors
file already closed
Rationale
the virtual part of DiskWriter::close

Implemented in SH::DiskWriterLocal, and SH::DiskWriterXRD.

◆ file()

TFile * SH::DiskWriter::file ( )

the file we are writing to

Guarantee
strong
Failures
file already closed
Postcondition
result != 0

Definition at line 54 of file DiskWriter.cxx.

56 {
58
59 TFile *result = getFile ();
60 RCU_REQUIRE (result != 0);
61 return result;
62 }
#define RCU_REQUIRE(x)
Definition Assert.h:208
virtual TFile * getFile()=0
the file we are writing to

◆ getFile()

virtual TFile * SH::DiskWriter::getFile ( )
privatepure virtual

the file we are writing to

Guarantee
strong
Failures
file already closed
Postcondition
result != 0
Rationale
the virtual part of DiskWriter::file

Implemented in SH::DiskWriterLocal, and SH::DiskWriterXRD.

◆ getPath()

virtual std::string SH::DiskWriter::getPath ( ) const
privatepure virtual

the path where this file can be accessed or the empty string if it is not known (yet).

Rationale
while it is not guaranteed that every writer will know how to handle this, most writers will, and it can be useful. however, not every writer will know this until after the file is closed.
Rationale
the virtual part of DiskWriter::path

Implemented in SH::DiskWriterLocal, and SH::DiskWriterXRD.

◆ path()

std::string SH::DiskWriter::path ( ) const

the path where this file can be accessed or the empty string if it is not known (yet).

Rationale
while it is not guaranteed that every writer will know how to handle this, most writers will, and it can be useful. however, not every writer will know this until after the file is closed.

Definition at line 45 of file DiskWriter.cxx.

47 {
48 RCU_READ_INVARIANT (this);
49 return getPath ();
50 }
#define RCU_READ_INVARIANT(x)
Definition Assert.h:229
virtual std::string getPath() const =0
the path where this file can be accessed or the empty string if it is not known (yet).

◆ testInvariant()

void SH::DiskWriter::testInvariant ( ) const

test the invariant of this object

Guarantee
no-fail

Definition at line 22 of file DiskWriter.cxx.

24 {
25 }

The documentation for this class was generated from the following files: