![]() |
DD4hep
1.33.0
Detector Description Toolkit for High Energy Physics
|
dd4hep file handling extension to boost::iostreams More...
#include <IoStreams.h>
Classes | |
| struct | category |
| Helper structure to define boost::iostreams. More... | |
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 ()=default | |
| Default constructor. More... | |
| dd4hep_file (handle_type fd, dd4hep_file_flags) | |
| Constructors taking file desciptors. More... | |
| dd4hep_file (const char *fname, BOOST_IOS::openmode mode) | |
| Constructors taking file desciptors. More... | |
| void | open (handle_type fd, dd4hep_file_flags flags) |
| Default destructor. More... | |
| void | open (const char *path, BOOST_IOS::openmode mode=BOOST_IOS::in|BOOST_IOS::out) |
| open overload taking C-style string More... | |
| void | close () |
| Close the file stream. More... | |
| std::streamsize | read (char_type *s, std::streamsize n) |
| Read from input stream. More... | |
| std::streamsize | write (const char_type *s, std::streamsize n) |
| Write to output stream. More... | |
| std::streampos | seek (stream_offset off, BOOST_IOS::seekdir way) |
| Direct access: set file pointer of the stream. More... | |
| bool | is_open () const |
| Check if the file stream is opened. More... | |
| handle_type | handle () const |
| Access to native stream handle. More... | |
| void | open (const char *path, BOOST_IOS::openmode mode) |
| Specialization for standard file descriptor files according to the posix standard. More... | |
| dd4hep_file (handle_type fd, dd4hep_file_flags flags) | |
| Specialization for standard file descriptor files according to the posix standard. More... | |
| dd4hep_file (const char *fn, BOOST_IOS::openmode mode) | |
| Specialization for standard file descriptor files according to the posix standard. More... | |
| std::streamsize | read (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 standard file descriptor files according to the posix standard. More... | |
| std::streampos | seek (stream_offset off, BOOST_IOS::seekdir way) |
| Specialization for standard file descriptor files according to the posix standard. More... | |
| void | close () |
| Specialization for standard file descriptor files according to the posix standard. More... | |
| void | open (const char *path, BOOST_IOS::openmode mode) |
| Specialization for the usage of TFile structures. More... | |
| dd4hep_file (handle_type fd, dd4hep_file_flags flags) | |
| Specialization for the usage of TFile structures. More... | |
| dd4hep_file (const char *fname, BOOST_IOS::openmode mode) | |
| Specialization for the usage of TFile structures. More... | |
| std::streamsize | read (char_type *s, std::streamsize n) |
| Specialization for the usage of TFile structures. 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) |
| Specialization for the usage of TFile structures. More... | |
| void | close () |
| Specialization for the usage of TFile structures. More... | |
Private Attributes | |
| handle_type | m_handle = 0 |
| Native stream handle. More... | |
| dd4hep_file_flags | m_flag = close_handle |
| Stream flag(s) More... | |
Friends | |
| class | dd4hep_file_source< T > |
| class | dd4hep_file_sink< 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!
Definition at line 73 of file IoStreams.h.
| typedef char dd4hep::dd4hep_file< T >::char_type |
Definition at line 78 of file IoStreams.h.
| typedef boost::iostreams::detail::path dd4hep::dd4hep_file< T >::detail_path |
Definition at line 80 of file IoStreams.h.
| typedef T dd4hep::dd4hep_file< T >::handle_type |
Definition at line 77 of file IoStreams.h.
| typedef boost::iostreams::stream_offset dd4hep::dd4hep_file< T >::stream_offset |
Definition at line 79 of file IoStreams.h.
|
default |
Default constructor.
| dd4hep::dd4hep_file< T >::dd4hep_file | ( | handle_type | fd, |
| dd4hep_file_flags | |||
| ) |
Constructors taking file desciptors.
| dd4hep::dd4hep_file< T >::dd4hep_file | ( | const char * | fname, |
| BOOST_IOS::openmode | mode | ||
| ) |
Constructors taking file desciptors.
| dd4hep::dd4hep_file< int >::dd4hep_file | ( | handle_type | fd, |
| dd4hep_file_flags | flags | ||
| ) |
Specialization for standard file descriptor files according to the posix standard.
Definition at line 51 of file IoStreams.cpp.
| dd4hep::dd4hep_file< int >::dd4hep_file | ( | const char * | fn, |
| BOOST_IOS::openmode | mode | ||
| ) |
Specialization for standard file descriptor files according to the posix standard.
Definition at line 55 of file IoStreams.cpp.
| dd4hep::dd4hep_file< TFile * >::dd4hep_file | ( | handle_type | fd, |
| dd4hep_file_flags | flags | ||
| ) |
Specialization for the usage of TFile structures.
Definition at line 97 of file IoStreams.cpp.
| dd4hep::dd4hep_file< TFile * >::dd4hep_file | ( | const char * | fname, |
| BOOST_IOS::openmode | mode | ||
| ) |
Specialization for the usage of TFile structures.
Definition at line 101 of file IoStreams.cpp.
| 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.
| void dd4hep::dd4hep_file< T >::close | ( | ) |
Close the file stream.
| void dd4hep::dd4hep_file< TFile * >::close | ( | ) |
Specialization for the usage of TFile structures.
Definition at line 126 of file IoStreams.cpp.
|
inline |
Access to native stream handle.
Definition at line 107 of file IoStreams.h.
|
inline |
Check if the file stream is opened.
Definition at line 105 of file IoStreams.h.
| void dd4hep::dd4hep_file< int >::open | ( | const char * | path, |
| BOOST_IOS::openmode | mode | ||
| ) |
Specialization for standard file descriptor files according to the posix standard.
Definition at line 45 of file IoStreams.cpp.
| void dd4hep::dd4hep_file< TFile * >::open | ( | const char * | path, |
| BOOST_IOS::openmode | mode | ||
| ) |
Specialization for the usage of TFile structures.
Definition at line 77 of file IoStreams.cpp.
| void dd4hep::dd4hep_file< T >::open | ( | const char * | path, |
| BOOST_IOS::openmode | mode = BOOST_IOS::in|BOOST_IOS::out |
||
| ) |
open overload taking C-style string
| void dd4hep::dd4hep_file< T >::open | ( | handle_type | fd, |
| dd4hep_file_flags | flags | ||
| ) |
Default destructor.
open overloads taking file descriptors
| std::streamsize dd4hep::dd4hep_file< int >::read | ( | char_type * | s, |
| std::streamsize | n | ||
| ) |
Specialization for standard file descriptor files according to the posix standard.
Definition at line 59 of file IoStreams.cpp.
| std::streamsize dd4hep::dd4hep_file< T >::read | ( | char_type * | s, |
| std::streamsize | n | ||
| ) |
Read from input stream.
| std::streamsize dd4hep::dd4hep_file< TFile * >::read | ( | char_type * | s, |
| std::streamsize | n | ||
| ) |
Specialization for the usage of TFile structures.
Definition at line 105 of file IoStreams.cpp.
| std::streampos dd4hep::dd4hep_file< int >::seek | ( | stream_offset | off, |
| BOOST_IOS::seekdir | way | ||
| ) |
Specialization for standard file descriptor files according to the posix standard.
Definition at line 67 of file IoStreams.cpp.
| std::streampos dd4hep::dd4hep_file< T >::seek | ( | stream_offset | off, |
| BOOST_IOS::seekdir | way | ||
| ) |
Direct access: set file pointer of the stream.
| std::streampos dd4hep::dd4hep_file< TFile * >::seek | ( | stream_offset | off, |
| BOOST_IOS::seekdir | way | ||
| ) |
Specialization for the usage of TFile structures.
Definition at line 122 of file IoStreams.cpp.
| std::streamsize dd4hep::dd4hep_file< int >::write | ( | const char_type * | s, |
| std::streamsize | n | ||
| ) |
Specialization for standard file descriptor files according to the posix standard.
Definition at line 63 of file IoStreams.cpp.
| std::streamsize dd4hep::dd4hep_file< T >::write | ( | const char_type * | s, |
| std::streamsize | n | ||
| ) |
Write to output stream.
| std::streamsize dd4hep::dd4hep_file< TFile * >::write | ( | const char_type * | s, |
| std::streamsize | n | ||
| ) |
Specialization for the usage of TFile structures.
Definition at line 118 of file IoStreams.cpp.
|
friend |
Definition at line 1 of file IoStreams.h.
|
friend |
Definition at line 1 of file IoStreams.h.
|
private |
Stream flag(s)
Definition at line 113 of file IoStreams.h.
|
private |
Native stream handle.
Definition at line 111 of file IoStreams.h.
1.8.18