Implements evioChannel functionality for I/O to and from files. More...
#include <evioFileChannel.hxx>
Public Member Functions | |
evioFileChannel (const string &fileName, const string &mode="r", int size=1000000) throw (evioException) | |
Constructor opens channel for reading or writing. | |
evioFileChannel (const string &fileName, evioDictionary *dict, const string &mode="r", int size=1000000) throw (evioException) | |
Constructor opens channel for reading or writing, dictionary specified. | |
virtual | ~evioFileChannel (void) |
Destructor closes file, deletes internal buffer, deletes dictionary one created from file. | |
void | open (void) throw (evioException) |
Opens channel for reading or writing. | |
bool | read (void) throw (evioException) |
Reads from file into internal buffer. | |
bool | read (uint32_t *myEventBuf, int length) throw (evioException) |
Reads from file into user-supplied buffer. | |
bool | readAlloc (uint32_t **buffer, uint32_t *bufLen) throw (evioException) |
Reads from file and allocates buffer as needed. | |
bool | readNoCopy (void) throw (evioException) |
Reads from file using no copy mechanism. | |
bool | readRandom (uint32_t bufferNumber) throw (evioException) |
Reads buffer from file given buffer number. | |
void | write (void) throw (evioException) |
Writes to file from internal buffer. | |
void | write (const uint32_t *myEventBuf) throw (evioException) |
Writes to file from user-supplied buffer. | |
void | write (const evioChannel &channel) throw (evioException) |
Writes to file from internal buffer of another evioChannel object. | |
void | write (const evioChannel *channel) throw (evioException) |
Writes from internal buffer of another evioChannel object. | |
void | write (const evioChannelBufferizable &o) throw (evioException) |
Writes from contents of evioChannelBufferizable object. | |
void | write (const evioChannelBufferizable *o) throw (evioException) |
Writes from contents of evioChannelBufferizable object. | |
void | close (void) throw (evioException) |
Closes channel. | |
int | ioctl (const string &request, void *argp) throw (evioException) |
For getting and setting evIoctl parameters. | |
const uint32_t * | getBuffer (void) const throw (evioException) |
Returns pointer to internal channel buffer. | |
int | getBufSize (void) const |
Returns internal channel buffer size. | |
const uint32_t * | getNoCopyBuffer (void) const throw (evioException) |
Returns pointer to no copy buffer. | |
const uint32_t * | getRandomBuffer (void) const throw (evioException) |
Returns pointer to random buffer. | |
void | getRandomAccessTable (const uint32_t ***table, uint32_t *len) const throw (evioException) |
Returns random access table. | |
string | getFileName (void) const |
Returns channel file name. | |
string | getMode (void) const |
Returns channel I/O mode. | |
string | getFileXMLDictionary (void) const |
Returns XML dictionary read in from file. |
Implements evioChannel functionality for I/O to and from files.
Basically a wrapper around the original evio C library.
evioFileChannel::evioFileChannel | ( | const string & | f, | |
const string & | m = "r" , |
|||
int | size = 1000000 | |||
) | throw (evioException) |
Constructor opens channel for reading or writing.
f | File name | |
m | I/O mode, "r" or "ra" or "w" or "a" | |
size | Internal buffer size |
evioFileChannel::evioFileChannel | ( | const string & | f, | |
evioDictionary * | dict, | |||
const string & | m = "r" , |
|||
int | size = 1000000 | |||
) | throw (evioException) |
Constructor opens channel for reading or writing, dictionary specified.
f | File name | |
dict | Dictionary | |
m | I/O mode, "r" or "ra" or "w" or "a" | |
size | Internal buffer size |
evioFileChannel::~evioFileChannel | ( | void | ) | [virtual] |
Destructor closes file, deletes internal buffer, deletes dictionary one created from file.
References close(), and evio::evioChannel::dictionary.
void evioFileChannel::close | ( | void | ) | throw (evioException) [virtual] |
const uint32_t * evioFileChannel::getBuffer | ( | void | ) | const throw (evioException) [virtual] |
Returns pointer to internal channel buffer.
Implements evio::evioChannel.
int evioFileChannel::getBufSize | ( | void | ) | const [virtual] |
Returns internal channel buffer size.
Implements evio::evioChannel.
string evioFileChannel::getFileName | ( | void | ) | const |
Returns channel file name.
string evioFileChannel::getFileXMLDictionary | ( | void | ) | const |
Returns XML dictionary read in from file.
string evioFileChannel::getMode | ( | void | ) | const |
Returns channel I/O mode.
const uint32_t * evioFileChannel::getNoCopyBuffer | ( | void | ) | const throw (evioException) [virtual] |
void evioFileChannel::getRandomAccessTable | ( | const uint32_t *** | table, | |
uint32_t * | len | |||
) | const throw (evioException) [virtual] |
Returns random access table.
table | Pointer to table | |
len | Length of table |
Reimplemented from evio::evioChannel.
const uint32_t * evioFileChannel::getRandomBuffer | ( | void | ) | const throw (evioException) [virtual] |
Returns pointer to random buffer.
Reimplemented from evio::evioChannel.
int evioFileChannel::ioctl | ( | const string & | request, | |
void * | argp | |||
) | throw (evioException) [virtual] |
For getting and setting evIoctl parameters.
request | String containing evIoctl parameters | |
argp | Additional evIoctl parameter |
Implements evio::evioChannel.
void evioFileChannel::open | ( | void | ) | throw (evioException) [virtual] |
Opens channel for reading or writing.
For read, user-supplied dictionary overrides one found in file.
Implements evio::evioChannel.
References evio::evioChannel::dictionary, and evio::evioDictionary::getDictionaryXML().
bool evioFileChannel::read | ( | uint32_t * | myBuf, | |
int | length | |||
) | throw (evioException) [virtual] |
Reads from file into user-supplied buffer.
myBuf | User-supplied buffer. length Length of buffer in 4-byte words. |
Implements evio::evioChannel.
bool evioFileChannel::read | ( | void | ) | throw (evioException) [virtual] |
Reads from file into internal buffer.
Implements evio::evioChannel.
bool evioFileChannel::readAlloc | ( | uint32_t ** | buffer, | |
uint32_t * | bufLen | |||
) | throw (evioException) [virtual] |
Reads from file and allocates buffer as needed.
buffer | Pointer to pointer to allocated buffer. | |
len | Length of allocated buffer in 4-byte words. |
Note: user MUST free the allocated buffer!
Implements evio::evioChannel.
bool evioFileChannel::readNoCopy | ( | void | ) | throw (evioException) [virtual] |
Reads from file using no copy mechanism.
Implements evio::evioChannel.
bool evioFileChannel::readRandom | ( | uint32_t | bufferNumber | ) | throw (evioException) [virtual] |
Reads buffer from file given buffer number.
bufferNumber | Buffer to return |
Reimplemented from evio::evioChannel.
void evioFileChannel::write | ( | const evioChannelBufferizable * | o | ) | throw (evioException) [virtual] |
Writes from contents of evioChannelBufferizable object.
o | Pointer to evioChannelBufferizable object that can serialize to buffer |
Implements evio::evioChannel.
References write().
void evioFileChannel::write | ( | const evioChannelBufferizable & | o | ) | throw (evioException) [virtual] |
Writes from contents of evioChannelBufferizable object.
o | evioChannelBufferizable object that can serialze to buffer |
Implements evio::evioChannel.
References write().
void evioFileChannel::write | ( | const evioChannel * | channel | ) | throw (evioException) |
Writes from internal buffer of another evioChannel object.
channel | Pointer to channel object |
References write().
void evioFileChannel::write | ( | const evioChannel & | channel | ) | throw (evioException) |
Writes to file from internal buffer of another evioChannel object.
channel | Channel object |
void evioFileChannel::write | ( | const uint32_t * | myBuf | ) | throw (evioException) [virtual] |
Writes to file from user-supplied buffer.
myBuf | Buffer containing event |
Implements evio::evioChannel.
void evioFileChannel::write | ( | void | ) | throw (evioException) [virtual] |