CMS 3D CMS Logo

Public Member Functions | Private Attributes

fwlite::TFileService Class Reference

#include <TFileService.h>

Inheritance diagram for fwlite::TFileService:
TFileDirectory

List of all members.

Public Member Functions

TFile & file () const
 return opened TFile
 TFileService (TFile *aFile)
 constructor with external TFile
 TFileService (const std::string &fileName)
 constructor
 ~TFileService ()
 destructor

Private Attributes

TFile * file_
 pointer to opened TFile
std::string fileName_

Detailed Description

Definition at line 12 of file TFileService.h.


Constructor & Destructor Documentation

TFileService::TFileService ( const std::string &  fileName)

constructor

Definition at line 7 of file TFileService.cc.

                                                    :
  TFileDirectory("", "", TFile::Open(fileName.c_str() , "RECREATE"), ""),
  file_(TFileDirectory::file_),
  fileName_(fileName)
{
}
TFileService::TFileService ( TFile *  aFile)

constructor with external TFile

Definition at line 15 of file TFileService.cc.

                                        :
  TFileDirectory("", "", aFile, ""),
  file_(TFileDirectory::file_),
  fileName_(aFile->GetName())
{
}
TFileService::~TFileService ( )

destructor

Definition at line 22 of file TFileService.cc.

References file_.

                            {
  file_->Write();
  file_->Close();
  delete file_;
}

Member Function Documentation

TFile& fwlite::TFileService::file ( ) const [inline]

return opened TFile

Definition at line 24 of file TFileService.h.

References file_.

{ return * file_; }

Member Data Documentation

TFile* fwlite::TFileService::file_ [private]

pointer to opened TFile

Reimplemented from TFileDirectory.

Definition at line 28 of file TFileService.h.

Referenced by file(), and ~TFileService().

std::string fwlite::TFileService::fileName_ [private]

Definition at line 29 of file TFileService.h.