DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Attributes | Friends | List of all members
DD4hep::dd4hep_file< T > Class Template Reference

DD4hep file handling extension to boost::iostreams. More...

#include <IoStreams.h>

Inheritance diagram for DD4hep::dd4hep_file< T >:
DD4hep::dd4hep_file_sink< T > DD4hep::dd4hep_file_source< T >

Classes

struct  category
 

Public Types

typedef T handle_type
 
typedef char char_type
 
typedef
boost::iostreams::stream_offset 
stream_offset
 
typedef
boost::iostreams::detail::path 
detail_path
 

Public Member Functions

 dd4hep_file ()
 
 dd4hep_file (handle_type fd, dd4hep_file_flags)
 
 dd4hep_file (const char *fname, BOOST_IOS::openmode mode)
 
void open (handle_type fd, dd4hep_file_flags flags)
 
void open (const char *path, BOOST_IOS::openmode mode=BOOST_IOS::in|BOOST_IOS::out)
 
bool is_open () const
 
void close ()
 
std::streamsize read (char_type *s, std::streamsize n)
 
std::streamsize write (const char_type *s, std::streamsize n)
 
std::streampos seek (stream_offset off, BOOST_IOS::seekdir way)
 
handle_type handle () const
 
template<>
void open (const char *path, BOOST_IOS::openmode mode)
 
template<>
 dd4hep_file (handle_type fd, dd4hep_file_flags flags)
 
template<>
 dd4hep_file (const char *fn, BOOST_IOS::openmode mode)
 
template<>
std::streamsize read (char_type *s, std::streamsize n)
 
template<>
std::streamsize write (const char_type *s, std::streamsize n)
 
template<>
std::streampos seek (stream_offset off, BOOST_IOS::seekdir way)
 
template<>
void close ()
 
template<>
void open (const char *path, BOOST_IOS::openmode mode)
 
template<>
 dd4hep_file (handle_type fd, dd4hep_file_flags flags)
 
template<>
 dd4hep_file (const char *fname, BOOST_IOS::openmode mode)
 
template<>
std::streamsize read (char_type *s, std::streamsize n)
 
template<>
std::streamsize write (const char_type *s, std::streamsize n)
 
template<>
std::streampos seek (stream_offset off, BOOST_IOS::seekdir way)
 
template<>
void close ()
 

Private Attributes

handle_type m_handle
 
dd4hep_file_flags m_flag
 

Friends

class dd4hep_file_source< T >
 
class dd4hep_file_sink< T >
 

Detailed Description

template<typename T>
class DD4hep::dd4hep_file< T >

DD4hep file handling extension to boost::iostreams.

Basic file handling for data sources and data sinks. 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 74 of file IoStreams.h.

Member Typedef Documentation

template<typename T >
typedef char DD4hep::dd4hep_file< T >::char_type

Definition at line 79 of file IoStreams.h.

template<typename T >
typedef boost::iostreams::detail::path DD4hep::dd4hep_file< T >::detail_path

Definition at line 81 of file IoStreams.h.

template<typename T >
typedef T DD4hep::dd4hep_file< T >::handle_type

Definition at line 78 of file IoStreams.h.

template<typename T >
typedef boost::iostreams::stream_offset DD4hep::dd4hep_file< T >::stream_offset

Definition at line 80 of file IoStreams.h.

Constructor & Destructor Documentation

template<typename T >
DD4hep::dd4hep_file< T >::dd4hep_file ( )
inline

Definition at line 85 of file IoStreams.h.

template<typename T >
DD4hep::dd4hep_file< T >::dd4hep_file ( handle_type  fd,
dd4hep_file_flags   
)
template<typename T >
DD4hep::dd4hep_file< T >::dd4hep_file ( const char *  fname,
BOOST_IOS::openmode  mode 
)
template<>
DD4hep::dd4hep_file< int >::dd4hep_file ( handle_type  fd,
dd4hep_file_flags  flags 
)

Definition at line 54 of file IoStreams.cpp.

template<>
DD4hep::dd4hep_file< int >::dd4hep_file ( const char *  fn,
BOOST_IOS::openmode  mode 
)

Definition at line 58 of file IoStreams.cpp.

References DD4hep::dd4hep_file< T >::open().

template<>
DD4hep::dd4hep_file< TFile * >::dd4hep_file ( handle_type  fd,
dd4hep_file_flags  flags 
)

Definition at line 100 of file IoStreams.cpp.

template<>
DD4hep::dd4hep_file< TFile * >::dd4hep_file ( const char *  fname,
BOOST_IOS::openmode  mode 
)

Definition at line 104 of file IoStreams.cpp.

References DD4hep::dd4hep_file< T >::open().

Member Function Documentation

template<>
void DD4hep::dd4hep_file< int >::close ( )

Definition at line 74 of file IoStreams.cpp.

template<typename T >
void DD4hep::dd4hep_file< T >::close ( )
template<>
void DD4hep::dd4hep_file< TFile * >::close ( )

Definition at line 129 of file IoStreams.cpp.

template<typename T >
handle_type DD4hep::dd4hep_file< T >::handle ( ) const
inline

Definition at line 102 of file IoStreams.h.

References DD4hep::dd4hep_file< T >::m_handle.

template<typename T >
bool DD4hep::dd4hep_file< T >::is_open ( ) const
inline

Definition at line 97 of file IoStreams.h.

References DD4hep::dd4hep_file< T >::m_handle.

template<>
void DD4hep::dd4hep_file< int >::open ( const char *  path,
BOOST_IOS::openmode  mode 
)

Definition at line 48 of file IoStreams.cpp.

template<>
void DD4hep::dd4hep_file< TFile * >::open ( const char *  path,
BOOST_IOS::openmode  mode 
)

Definition at line 80 of file IoStreams.cpp.

template<typename T >
void DD4hep::dd4hep_file< T >::open ( handle_type  fd,
dd4hep_file_flags  flags 
)
template<typename T >
void DD4hep::dd4hep_file< T >::open ( const char *  path,
BOOST_IOS::openmode  mode = BOOST_IOS::in|BOOST_IOS::out 
)
template<>
std::streamsize DD4hep::dd4hep_file< int >::read ( char_type s,
std::streamsize  n 
)

Definition at line 62 of file IoStreams.cpp.

template<typename T >
std::streamsize DD4hep::dd4hep_file< T >::read ( char_type s,
std::streamsize  n 
)
template<>
std::streamsize DD4hep::dd4hep_file< TFile * >::read ( char_type s,
std::streamsize  n 
)

Definition at line 108 of file IoStreams.cpp.

References _p.

template<>
std::streampos DD4hep::dd4hep_file< int >::seek ( stream_offset  off,
BOOST_IOS::seekdir  way 
)

Definition at line 70 of file IoStreams.cpp.

template<typename T >
std::streampos DD4hep::dd4hep_file< T >::seek ( stream_offset  off,
BOOST_IOS::seekdir  way 
)
template<>
std::streampos DD4hep::dd4hep_file< TFile * >::seek ( stream_offset  off,
BOOST_IOS::seekdir  way 
)

Definition at line 125 of file IoStreams.cpp.

References _p.

template<>
std::streamsize DD4hep::dd4hep_file< int >::write ( const char_type s,
std::streamsize  n 
)

Definition at line 66 of file IoStreams.cpp.

template<typename T >
std::streamsize DD4hep::dd4hep_file< T >::write ( const char_type s,
std::streamsize  n 
)
template<>
std::streamsize DD4hep::dd4hep_file< TFile * >::write ( const char_type s,
std::streamsize  n 
)

Definition at line 121 of file IoStreams.cpp.

References _p, and s.

Friends And Related Function Documentation

template<typename T >
friend class dd4hep_file_sink< T >
friend

Definition at line 77 of file IoStreams.h.

template<typename T >
friend class dd4hep_file_source< T >
friend

Definition at line 76 of file IoStreams.h.

Member Data Documentation

template<typename T >
dd4hep_file_flags DD4hep::dd4hep_file< T >::m_flag
private

Definition at line 105 of file IoStreams.h.

template<typename T >
handle_type DD4hep::dd4hep_file< T >::m_handle
private

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