ATLAS Offline Software
Public Member Functions | Private Member Functions | List of all members
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 More...
 
 DiskWriter ()
 standard constructor More...
 
virtual ~DiskWriter ()
 standard destructor More...
 
std::string path () const
 the path where this file can be accessed or the empty string if it is not known (yet). More...
 
TFile * file ()
 the file we are writing to More...
 
void close ()
 closes the file we are writing to More...
 

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). More...
 
virtual TFile * getFile ()=0
 the file we are writing to More...
 
virtual void doClose ()=0
 closes the file we are writing to More...
 

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  }

◆ ~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  {
40  RCU_DESTROY_INVARIANT (this);
41  }

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  {
69  RCU_CHANGE_INVARIANT (this);
70 
71  doClose ();
72  }

◆ 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::DiskWriterXRD, and SH::DiskWriterLocal.

◆ 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  {
57  RCU_CHANGE_INVARIANT (this);
58 
59  TFile *result = getFile ();
60  RCU_REQUIRE (result != 0);
61  return result;
62  }

◆ 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::DiskWriterXRD, and SH::DiskWriterLocal.

◆ 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::DiskWriterXRD, and SH::DiskWriterLocal.

◆ 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  }

◆ 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:
get_generator_info.result
result
Definition: get_generator_info.py:21
RCU_REQUIRE
#define RCU_REQUIRE(x)
Definition: Assert.h:208
SH::DiskWriter::getPath
virtual std::string getPath() const =0
the path where this file can be accessed or the empty string if it is not known (yet).
SH::DiskWriter::getFile
virtual TFile * getFile()=0
the file we are writing to
RCU_DESTROY_INVARIANT
#define RCU_DESTROY_INVARIANT(x)
Definition: Assert.h:235
SH::DiskWriter::doClose
virtual void doClose()=0
closes the file we are writing to
RCU_CHANGE_INVARIANT
#define RCU_CHANGE_INVARIANT(x)
Definition: Assert.h:231
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition: Assert.h:229
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition: Assert.h:233