evio  5.3
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
evio::evioBufferChannel Class Reference

Implements evioChannel functionality for I/O to and from user-supplied evio buffer. More...

#include <evioBufferChannel.hxx>

Inheritance diagram for evio::evioBufferChannel:
evio::evioChannel

Public Member Functions

 evioBufferChannel (uint32_t *streamBuf, int bufLen, const string &mode="r", int size=100000)
 Constructor opens buffer for reading or writing. More...
 
 evioBufferChannel (uint32_t *streamBuf, int bufLen, evioDictionary *dict, const string &mode="r", int size=100000)
 Constructor opens buffer for reading or writing. More...
 
virtual ~evioBufferChannel ()
 Destructor closes buffer, deletes internal buffer and dictionary. More...
 
void open ()
 Opens channel for reading or writing. More...
 
bool read ()
 Reads from buffer. More...
 
bool read (uint32_t *myEventBuf, int length)
 Reads from buffer into user-supplied event buffer. More...
 
bool readAlloc (uint32_t **buffer, uint32_t *bufLen)
 Reads from file and allocates buffer as needed. More...
 
bool readNoCopy ()
 Get const pointer to next event in stream buffer. More...
 
bool readRandom (uint32_t bufferNumber)
 Reads buffer from file given buffer number. More...
 
void write ()
 Writes to buffer from internal buffer. More...
 
void write (const uint32_t *myEventBuf)
 Writes to buffer from user-supplied buffer. More...
 
void write (const evioChannel &channel)
 Writes to buffer from internal buffer of another evioChannel object. More...
 
void write (const evioChannel *channel)
 Writes from internal buffer of another evioChannel object. More...
 
void write (const evioChannelBufferizable &o)
 Writes from contents of evioChannelBufferizable object. More...
 
void write (const evioChannelBufferizable *o)
 Writes from contents of evioChannelBufferizable object. More...
 
void close ()
 Closes channel. More...
 
int ioctl (const string &request, void *argp)
 For getting and setting evIoctl parameters. More...
 
const uint32_t * getBuffer () const
 Returns pointer to internal channel buffer. More...
 
int getBufSize () const
 Returns internal channel buffer size. More...
 
const uint32_t * getNoCopyBuffer () const
 Returns pointer to no copy buffer. More...
 
const uint32_t * getRandomBuffer () const
 Returns pointer to random buffer. More...
 
void getRandomAccessTable (uint32_t ***const table, uint32_t *len) const
 Returns random access table. More...
 
const uint32_t * getStreamBuffer () const
 Returns pointer to stream buffer. More...
 
int getStreamBufSize () const
 Returns internal channel buffer size. More...
 
string getMode () const
 Returns channel I/O mode. More...
 
uint32_t getEVIOBufferLength () const
 Returns length of event record in stream buffer in 4-byte words. More...
 
string getBufferXMLDictionary () const
 Returns XML dictionary read in from buffer. More...
 
- Public Member Functions inherited from evio::evioChannel
 evioChannel ()
 
 evioChannel (evioDictionary *dict)
 
virtual ~evioChannel ()
 
virtual const evioDictionarygetDictionary () const
 

Additional Inherited Members

- Protected Attributes inherited from evio::evioChannel
evioDictionarydictionary
 

Detailed Description

Implements evioChannel functionality for I/O to and from user-supplied evio buffer.

Constructor & Destructor Documentation

◆ evioBufferChannel() [1/2]

evioBufferChannel::evioBufferChannel ( uint32_t *  streamBuf,
int  bufLen,
const string &  m = "r",
int  size = 100000 
)

Constructor opens buffer for reading or writing.

Parameters
streamBufStream buffer specified by the user
bufLensize of the stream buffer
mI/O mode, "r", "ra", "w", or "a"
sizeInternal event buffer size

◆ evioBufferChannel() [2/2]

evioBufferChannel::evioBufferChannel ( uint32_t *  streamBuf,
int  bufLen,
evioDictionary dict,
const string &  m = "r",
int  size = 100000 
)

Constructor opens buffer for reading or writing.

Parameters
streamBufStream buffer specified by the user
bufLensize of the stream buffer
dictDictionary
mI/O mode, "r", "ra", "w", or "a"
sizeInternal event buffer size

◆ ~evioBufferChannel()

evioBufferChannel::~evioBufferChannel ( )
virtual

Destructor closes buffer, deletes internal buffer and dictionary.

References close(), and evio::evioChannel::dictionary.

Member Function Documentation

◆ close()

void evioBufferChannel::close ( )
virtual

Closes channel.

Implements evio::evioChannel.

Referenced by ~evioBufferChannel().

◆ getBuffer()

const uint32_t * evioBufferChannel::getBuffer ( ) const
virtual

Returns pointer to internal channel buffer.

Returns
Pointer to internal buffer

Implements evio::evioChannel.

◆ getBufferXMLDictionary()

string evioBufferChannel::getBufferXMLDictionary ( ) const

Returns XML dictionary read in from buffer.

Returns
XML dictionary read in from buffer

◆ getBufSize()

int evioBufferChannel::getBufSize ( ) const
virtual

Returns internal channel buffer size.

Returns
Internal buffer size in 4-byte words

Implements evio::evioChannel.

◆ getEVIOBufferLength()

uint32_t evioBufferChannel::getEVIOBufferLength ( ) const

Returns length of event record in stream buffer in 4-byte words.

Returns
Length of event record in stream buffer 4-byte words

◆ getMode()

string evioBufferChannel::getMode ( ) const

Returns channel I/O mode.

Returns
String containing I/O mode

◆ getNoCopyBuffer()

const uint32_t * evioBufferChannel::getNoCopyBuffer ( ) const
virtual

Returns pointer to no copy buffer.

Returns
Pointer to no copy buffer

Implements evio::evioChannel.

◆ getRandomAccessTable()

void evioBufferChannel::getRandomAccessTable ( uint32_t ***const  table,
uint32_t *  len 
) const
virtual

Returns random access table.

Parameters
tablePointer to table
lenLength of table

Reimplemented from evio::evioChannel.

◆ getRandomBuffer()

const uint32_t * evioBufferChannel::getRandomBuffer ( ) const
virtual

Returns pointer to random buffer.

Returns
Pointer to random buffer

Reimplemented from evio::evioChannel.

◆ getStreamBuffer()

const uint32_t * evioBufferChannel::getStreamBuffer ( ) const

Returns pointer to stream buffer.

Returns
Pointer to stream buffer

◆ getStreamBufSize()

int evioBufferChannel::getStreamBufSize ( ) const

Returns internal channel buffer size.

Returns
Internal buffer size in 4-byte words

◆ ioctl()

int evioBufferChannel::ioctl ( const string &  request,
void *  argp 
)
virtual

For getting and setting evIoctl parameters.

Parameters
requestString containing evIoctl parameters
argpAdditional evIoctl parameter

Implements evio::evioChannel.

◆ open()

void evioBufferChannel::open ( )
virtual

Opens channel for reading or writing.

For read, user-supplied dictionary overrides one found in buffer.

Implements evio::evioChannel.

References evio::evioChannel::dictionary, and evio::evioDictionary::getDictionaryXML().

◆ read() [1/2]

bool evioBufferChannel::read ( )
virtual

Reads from buffer.

Returns
true if successful, false on EOF or other evRead error condition

Implements evio::evioChannel.

◆ read() [2/2]

bool evioBufferChannel::read ( uint32_t *  myBuf,
int  length 
)
virtual

Reads from buffer into user-supplied event buffer.

Parameters
myBufUser-supplied buffer. @parem length Length of buffer in 4-byte words.
Returns
true if successful, false on EOF or other evRead error condition

Implements evio::evioChannel.

◆ readAlloc()

bool evioBufferChannel::readAlloc ( uint32_t **  buffer,
uint32_t *  bufLen 
)
virtual

Reads from file and allocates buffer as needed.

Parameters
bufferPointer to pointer to allocated buffer.
lenLength of allocated buffer in 4-byte words.
Returns
true if successful, false on EOF, throws exception for other error.

Note: user MUST free the allocated buffer!

Implements evio::evioChannel.

◆ readNoCopy()

bool evioBufferChannel::readNoCopy ( )
virtual

Get const pointer to next event in stream buffer.

Returns
true if successful, false on EOF, throws exception for other error.

Implements evio::evioChannel.

◆ readRandom()

bool evioBufferChannel::readRandom ( uint32_t  bufferNumber)
virtual

Reads buffer from file given buffer number.

Parameters
bufferNumberBuffer to return
Returns
true if successful, false on EOF, throws exception for other error.

Reimplemented from evio::evioChannel.

◆ write() [1/6]

void evioBufferChannel::write ( )
virtual

Writes to buffer from internal buffer.

Implements evio::evioChannel.

Referenced by write().

◆ write() [2/6]

void evioBufferChannel::write ( const evioChannel channel)
virtual

Writes to buffer from internal buffer of another evioChannel object.

Parameters
channelChannel object

Implements evio::evioChannel.

References evio::evioChannel::getBuffer().

◆ write() [3/6]

void evioBufferChannel::write ( const evioChannel channel)
virtual

Writes from internal buffer of another evioChannel object.

Parameters
channelPointer to channel object

Implements evio::evioChannel.

References write().

◆ write() [4/6]

void evioBufferChannel::write ( const evioChannelBufferizable o)
virtual

Writes from contents of evioChannelBufferizable object.

Parameters
oevioChannelBufferizable object that can serialze to buffer

Implements evio::evioChannel.

References evio::evioChannelBufferizable::toEVIOBuffer(), and write().

◆ write() [5/6]

void evioBufferChannel::write ( const evioChannelBufferizable o)
virtual

Writes from contents of evioChannelBufferizable object.

Parameters
oPointer to evioChannelBufferizable object that can serialize to buffer

Implements evio::evioChannel.

References write().

◆ write() [6/6]

void evioBufferChannel::write ( const uint32_t *  myBuf)
virtual

Writes to buffer from user-supplied buffer.

Parameters
myBufBuffer containing event

Implements evio::evioChannel.


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