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

dd4hep file sink 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_sink ()
 Default constructor. More...
 
 dd4hep_file_sink (const dd4hep_file_sink< T > &other)
 Copy constructor. More...
 
 dd4hep_file_sink (handle_type fd, dd4hep_file_flags flags)
 Constructors taking file desciptors. More...
 
 dd4hep_file_sink (const std::string &path, BOOST_IOS::openmode mode=BOOST_IOS::out)
 Constructor taking a std::string. More...
 
 dd4hep_file_sink (const char *path, BOOST_IOS::openmode mode=BOOST_IOS::out)
 Constructor taking a C-style string. More...
 
template<typename Path >
 dd4hep_file_sink (const Path &path, BOOST_IOS::openmode mode=BOOST_IOS::out)
 Constructor taking a Boost.Filesystem path. More...
 
void open (handle_type fd, dd4hep_file_flags flags)
 open overloads taking file descriptors More...
 
void open (const std::string &path, BOOST_IOS::openmode mode=BOOST_IOS::out)
 open overload taking a std::string More...
 
void open (const char *path, BOOST_IOS::openmode mode=BOOST_IOS::out)
 open overload taking C-style string More...
 
template<typename Path >
void open (const Path &path, BOOST_IOS::openmode mode=BOOST_IOS::out)
 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 write (const char_type *s, std::streamsize n)
 Write to output stream. More...
 
std::streamsize write (const char_type *s, std::streamsize n)
 Specialization for standard file descriptor files according to the posix standard. More...
 
std::streamsize write (const 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>
class dd4hep::dd4hep_file_sink< T >

dd4hep file sink extension to boost::iostreams

Basic data sink 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 48 of file IoStreams.h.

Member Typedef Documentation

◆ char_type

template<typename T >
typedef descriptor::char_type dd4hep::dd4hep_file_sink< T >::char_type

Definition at line 209 of file IoStreams.h.

◆ descriptor

template<typename T >
typedef dd4hep_file<T> dd4hep::dd4hep_file_sink< T >::descriptor

Definition at line 203 of file IoStreams.h.

◆ handle_type

template<typename T >
typedef descriptor::handle_type dd4hep::dd4hep_file_sink< T >::handle_type

Definition at line 208 of file IoStreams.h.

Constructor & Destructor Documentation

◆ dd4hep_file_sink() [1/6]

template<typename T >
dd4hep::dd4hep_file_sink< T >::dd4hep_file_sink ( )
inline

Default constructor.

Definition at line 217 of file IoStreams.h.

◆ dd4hep_file_sink() [2/6]

template<typename T >
dd4hep::dd4hep_file_sink< T >::dd4hep_file_sink ( const dd4hep_file_sink< T > &  other)
inline

Copy constructor.

Definition at line 220 of file IoStreams.h.

◆ dd4hep_file_sink() [3/6]

template<typename T >
dd4hep::dd4hep_file_sink< T >::dd4hep_file_sink ( handle_type  fd,
dd4hep_file_flags  flags 
)
inlineexplicit

Constructors taking file desciptors.

Definition at line 224 of file IoStreams.h.

◆ dd4hep_file_sink() [4/6]

template<typename T >
dd4hep::dd4hep_file_sink< T >::dd4hep_file_sink ( const std::string &  path,
BOOST_IOS::openmode  mode = BOOST_IOS::out 
)
inlineexplicit

Constructor taking a std::string.

Definition at line 228 of file IoStreams.h.

◆ dd4hep_file_sink() [5/6]

template<typename T >
dd4hep::dd4hep_file_sink< T >::dd4hep_file_sink ( const char *  path,
BOOST_IOS::openmode  mode = BOOST_IOS::out 
)
inlineexplicit

Constructor taking a C-style string.

Definition at line 232 of file IoStreams.h.

◆ dd4hep_file_sink() [6/6]

template<typename T >
template<typename Path >
dd4hep::dd4hep_file_sink< T >::dd4hep_file_sink ( const Path path,
BOOST_IOS::openmode  mode = BOOST_IOS::out 
)
inlineexplicit

Constructor taking a Boost.Filesystem path.

Definition at line 237 of file IoStreams.h.

Member Function Documentation

◆ close() [1/3]

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

Close the file stream.

◆ close() [2/3]

template<typename T >
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 >
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 >
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 >
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 >
void dd4hep::dd4hep_file_sink< T >::open ( const char *  path,
BOOST_IOS::openmode  mode = BOOST_IOS::out 
)
inline

open overload taking C-style string

Definition at line 249 of file IoStreams.h.

◆ open() [2/4]

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

open overload taking a Boost.Filesystem path

Definition at line 253 of file IoStreams.h.

◆ open() [3/4]

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

open overload taking a std::string

Definition at line 245 of file IoStreams.h.

◆ open() [4/4]

template<typename T >
void dd4hep::dd4hep_file_sink< T >::open ( handle_type  fd,
dd4hep_file_flags  flags 
)
inline

open overloads taking file descriptors

Definition at line 241 of file IoStreams.h.

◆ seek() [1/3]

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

Specialization for the usage of TFile structures.

Definition at line 122 of file IoStreams.cpp.

◆ seek() [2/3]

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

Direct access: set file pointer of the stream.

◆ seek() [3/3]

template<typename T >
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.

◆ write() [1/3]

template<typename T >
std::streamsize dd4hep::dd4hep_file< int >::write

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

Definition at line 63 of file IoStreams.cpp.

◆ write() [2/3]

template<typename T >
std::streamsize dd4hep::dd4hep_file< TFile * >::write

Specialization for the usage of TFile structures.

Definition at line 118 of file IoStreams.cpp.

◆ write() [3/3]

template<typename T >
std::streamsize dd4hep::dd4hep_file< T >::write

Write to output stream.


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