DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Classes | Public Types | Public Member Functions | List of all members
dd4hep::dd4hep_file_source< T > Class Template Reference

dd4hep file source extension to boost::iostreams More...

#include <IoStreams.h>

Classes

struct  category
 Helper structure to define boost::iostreams. More...
 

Public Types

typedef dd4hep_file< T > descriptor
 
typedef descriptor::handle_type handle_type
 
typedef descriptor::char_type char_type
 

Public Member Functions

 dd4hep_file_source ()
 Default Constructor. More...
 
 dd4hep_file_source (const dd4hep_file_source< T > &other)
 Copy constructor. More...
 
 dd4hep_file_source (handle_type h, dd4hep_file_flags flags)
 Constructors taking file desciptors. More...
 
 dd4hep_file_source (const char *name, BOOST_IOS::openmode mode=BOOST_IOS::in)
 Constructors taking file desciptors. More...
 
void open (handle_type h, dd4hep_file_flags flags)
 open overload taking file desciptors More...
 
void open (const char *path, BOOST_IOS::openmode mode=BOOST_IOS::in)
 open overload taking C-style string More...
 
void open (const std::string &path, BOOST_IOS::openmode mode=BOOST_IOS::in)
 open overload taking a std::string More...
 
template<typename Path >
void open (const Path &path, BOOST_IOS::openmode mode=BOOST_IOS::in)
 open overload taking a Boost.Filesystem path More...
 
bool is_open () const
 Check if the file stream is opened. More...
 
void close ()
 Close the file stream. More...
 
void close ()
 Specialization for standard file descriptor files according to the posix standard. More...
 
void close ()
 Specialization for the usage of TFile structures. More...
 
std::streamsize read (char_type *s, std::streamsize n)
 Read from input stream. More...
 
std::streamsize read (char_type *s, std::streamsize n)
 Specialization for standard file descriptor files according to the posix standard. More...
 
std::streamsize read (char_type *s, std::streamsize n)
 Specialization for the usage of TFile structures. More...
 
std::streampos seek (stream_offset off, BOOST_IOS::seekdir way)
 Direct access: set file pointer of the stream. More...
 
std::streampos seek (stream_offset off, BOOST_IOS::seekdir way)
 Specialization for standard file descriptor files according to the posix standard. More...
 
std::streampos seek (stream_offset off, BOOST_IOS::seekdir way)
 Specialization for the usage of TFile structures. More...
 
handle_type handle () const
 Access to native stream handle. More...
 

Detailed Description

template<typename T = int>
class dd4hep::dd4hep_file_source< T >

dd4hep file source extension to boost::iostreams

Basic data sources implementation. Please see boost::iostreams for details. This got inspired by boost::iostreams::device::file_descriptor

The final aim is to hide all this behind a TFile object, so that we get the entire network file handling for free!

Note: Credits go to a large extend to the authors of boost::iostreams. Without their work I could not have done this!

Author
M.Frank
Version
1.0
See also
http://www.boost.org/libs/iostreams for further documentation.

Definition at line 47 of file IoStreams.h.

Member Typedef Documentation

◆ char_type

template<typename T = int>
typedef descriptor::char_type dd4hep::dd4hep_file_source< T >::char_type

Definition at line 143 of file IoStreams.h.

◆ descriptor

template<typename T = int>
typedef dd4hep_file<T> dd4hep::dd4hep_file_source< T >::descriptor

Definition at line 137 of file IoStreams.h.

◆ handle_type

template<typename T = int>
typedef descriptor::handle_type dd4hep::dd4hep_file_source< T >::handle_type

Definition at line 142 of file IoStreams.h.

Constructor & Destructor Documentation

◆ dd4hep_file_source() [1/4]

template<typename T = int>
dd4hep::dd4hep_file_source< T >::dd4hep_file_source ( )
inline

Default Constructor.

Definition at line 151 of file IoStreams.h.

◆ dd4hep_file_source() [2/4]

template<typename T = int>
dd4hep::dd4hep_file_source< T >::dd4hep_file_source ( const dd4hep_file_source< T > &  other)
inline

Copy constructor.

Definition at line 154 of file IoStreams.h.

◆ dd4hep_file_source() [3/4]

template<typename T = int>
dd4hep::dd4hep_file_source< T >::dd4hep_file_source ( handle_type  h,
dd4hep_file_flags  flags 
)
inlineexplicit

Constructors taking file desciptors.

Definition at line 158 of file IoStreams.h.

◆ dd4hep_file_source() [4/4]

template<typename T = int>
dd4hep::dd4hep_file_source< T >::dd4hep_file_source ( const char *  name,
BOOST_IOS::openmode  mode = BOOST_IOS::in 
)
inlineexplicit

Constructors taking file desciptors.

Definition at line 162 of file IoStreams.h.

Member Function Documentation

◆ close() [1/3]

template<typename T = int>
void dd4hep::dd4hep_file< T >::close

Close the file stream.

◆ close() [2/3]

template<typename T = int>
void dd4hep::dd4hep_file< TFile * >::close

Specialization for the usage of TFile structures.

Definition at line 126 of file IoStreams.cpp.

◆ close() [3/3]

template<typename T = int>
void dd4hep::dd4hep_file< int >::close

Specialization for standard file descriptor files according to the posix standard.

Definition at line 71 of file IoStreams.cpp.

◆ handle()

template<typename T = int>
handle_type dd4hep::dd4hep_file< T >::handle
inline

Access to native stream handle.

Definition at line 107 of file IoStreams.h.

◆ is_open()

template<typename T = int>
bool dd4hep::dd4hep_file< T >::is_open
inline

Check if the file stream is opened.

Definition at line 105 of file IoStreams.h.

◆ open() [1/4]

template<typename T = int>
void dd4hep::dd4hep_file_source< T >::open ( const char *  path,
BOOST_IOS::openmode  mode = BOOST_IOS::in 
)
inline

open overload taking C-style string

Definition at line 170 of file IoStreams.h.

◆ open() [2/4]

template<typename T = int>
template<typename Path >
void dd4hep::dd4hep_file_source< T >::open ( const Path path,
BOOST_IOS::openmode  mode = BOOST_IOS::in 
)
inline

open overload taking a Boost.Filesystem path

Definition at line 178 of file IoStreams.h.

◆ open() [3/4]

template<typename T = int>
void dd4hep::dd4hep_file_source< T >::open ( const std::string &  path,
BOOST_IOS::openmode  mode = BOOST_IOS::in 
)
inline

open overload taking a std::string

Definition at line 174 of file IoStreams.h.

◆ open() [4/4]

template<typename T = int>
void dd4hep::dd4hep_file_source< T >::open ( handle_type  h,
dd4hep_file_flags  flags 
)
inline

open overload taking file desciptors

Definition at line 166 of file IoStreams.h.

◆ read() [1/3]

template<typename T = int>
std::streamsize dd4hep::dd4hep_file< int >::read

Specialization for standard file descriptor files according to the posix standard.

Definition at line 59 of file IoStreams.cpp.

◆ read() [2/3]

template<typename T = int>
std::streamsize dd4hep::dd4hep_file< TFile * >::read

Specialization for the usage of TFile structures.

Definition at line 105 of file IoStreams.cpp.

◆ read() [3/3]

template<typename T = int>
std::streamsize dd4hep::dd4hep_file< T >::read

Read from input stream.

◆ seek() [1/3]

template<typename T = int>
std::streampos dd4hep::dd4hep_file< T >::seek

Direct access: set file pointer of the stream.

◆ seek() [2/3]

template<typename T = int>
std::streampos dd4hep::dd4hep_file< TFile * >::seek

Specialization for the usage of TFile structures.

Definition at line 122 of file IoStreams.cpp.

◆ seek() [3/3]

template<typename T = int>
std::streampos dd4hep::dd4hep_file< int >::seek

Specialization for standard file descriptor files according to the posix standard.

Definition at line 67 of file IoStreams.cpp.


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