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

Implements evioChannel functionality for I/O to and from socket. More...

#include <evioSocketChannel.hxx>

Inheritance diagram for evio::evioSocketChannel:
evio::evioChannel

Public Member Functions

 evioSocketChannel (int socFd, const string &mode="r", int size=100000) throw (evioException)
 Constructor opens socket for reading or writing. More...
 
 evioSocketChannel (int socFd, evioDictionary *dict, const string &mode="r", int size=100000) throw (evioException)
 Constructor opens socket for reading or writing. More...
 
virtual ~evioSocketChannel (void)
 Destructor closes socket, deletes internal buffer. More...
 
void open (void) throw (evioException)
 Opens channel for reading or writing. More...
 
bool read (void) throw (evioException)
 Reads from socket. More...
 
bool read (uint32_t *myEventBuf, int length) throw (evioException)
 Reads from socket into user-supplied event buffer. More...
 
bool readAlloc (uint32_t **buffer, uint32_t *bufLen) throw (evioException)
 Reads from socket and allocates buffer as needed. More...
 
bool readNoCopy (void) throw (evioException)
 Reads from socket using no copy mechanism. More...
 
void write (void) throw (evioException)
 Writes to socket from internal buffer. More...
 
void write (const uint32_t *myEventBuf) throw (evioException)
 Writes to socket from user-supplied buffer. More...
 
void write (const evioChannel &channel) throw (evioException)
 Writes to socket from internal buffer of another evioChannel object. More...
 
void write (const evioChannel *channel) throw (evioException)
 Writes from internal buffer of another evioChannel object. More...
 
void write (const evioChannelBufferizable &o) throw (evioException)
 Writes from contents of evioChannelBufferizable object. More...
 
void write (const evioChannelBufferizable *o) throw (evioException)
 Writes from contents of evioChannelBufferizable object. More...
 
void close (void) throw (evioException)
 Closes channel. More...
 
int ioctl (const string &request, void *argp) throw (evioException)
 For getting and setting evIoctl parameters. More...
 
const uint32_t * getBuffer (void) const throw (evioException)
 Returns pointer to internal channel buffer. More...
 
int getBufSize (void) const
 Returns internal channel buffer size. More...
 
const uint32_t * getNoCopyBuffer (void) const throw (evioException)
 Returns pointer to no copy buffer. More...
 
string getMode (void) const
 Returns channel I/O mode. More...
 
int getSocketFD (void) const throw (evioException)
 Returns socket file descriptor. More...
 
string getSocketXMLDictionary (void) const
 Returns XML dictionary read in from socket. More...
 
- Public Member Functions inherited from evio::evioChannel
 evioChannel (void)
 
 evioChannel (evioDictionary *dict)
 
virtual ~evioChannel (void)
 
virtual bool readRandom (uint32_t eventNumber) throw (evioException)
 
virtual const evioDictionarygetDictionary (void) const
 
virtual const uint32_t * getRandomBuffer (void) const throw (evioException)
 
virtual void getRandomAccessTable (uint32_t ***const table, uint32_t *len) const throw (evioException)
 

Additional Inherited Members

- Protected Attributes inherited from evio::evioChannel
evioDictionarydictionary
 

Detailed Description

Implements evioChannel functionality for I/O to and from socket.

Constructor & Destructor Documentation

evioSocketChannel::evioSocketChannel ( int  sockFD,
const string &  m = "r",
int  size = 100000 
)
throw (evioException
)

Constructor opens socket for reading or writing.

Parameters
sockFDSocket file descriptor
mI/O mode, "r" or "w"
sizeInternal event buffer size
evioSocketChannel::evioSocketChannel ( int  sockFD,
evioDictionary dict,
const string &  m = "r",
int  size = 100000 
)
throw (evioException
)

Constructor opens socket for reading or writing.

Parameters
sockFDSocket file descriptor
dictDictionary
mI/O mode, "r" or "w"
sizeInternal event buffer size
evioSocketChannel::~evioSocketChannel ( void  )
virtual

Destructor closes socket, deletes internal buffer.

Member Function Documentation

void evioSocketChannel::close ( void  )
throw (evioException
)
virtual

Closes channel.

Implements evio::evioChannel.

const uint32_t * evioSocketChannel::getBuffer ( void  ) const
throw (evioException
)
virtual

Returns pointer to internal channel buffer.

Returns
Pointer to internal buffer

Implements evio::evioChannel.

int evioSocketChannel::getBufSize ( void  ) const
virtual

Returns internal channel buffer size.

Returns
Internal buffer size in 4-byte words

Implements evio::evioChannel.

string evioSocketChannel::getMode ( void  ) const

Returns channel I/O mode.

Returns
String containing I/O mode
const uint32_t * evioSocketChannel::getNoCopyBuffer ( void  ) const
throw (evioException
)
virtual

Returns pointer to no copy buffer.

Returns
Returs pointer to internal buffer since there is noCopy buffer does not exist

Implements evio::evioChannel.

int evioSocketChannel::getSocketFD ( void  ) const
throw (evioException
)

Returns socket file descriptor.

Returns
socket file descriptor
string evioSocketChannel::getSocketXMLDictionary ( void  ) const

Returns XML dictionary read in from socket.

Returns
XML dictionary read in from socket
int evioSocketChannel::ioctl ( const string &  request,
void *  argp 
)
throw (evioException
)
virtual

For getting and setting evIoctl parameters.

Parameters
requestString containing evIoctl parameters
argpAdditional evIoctl parameter

Implements evio::evioChannel.

void evioSocketChannel::open ( void  )
throw (evioException
)
virtual

Opens channel for reading or writing.

For read, user-supplied dictionary overrides one received from socket.

Implements evio::evioChannel.

bool evioSocketChannel::read ( void  )
throw (evioException
)
virtual

Reads from socket.

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

Implements evio::evioChannel.

bool evioSocketChannel::read ( uint32_t *  myBuf,
int  length 
)
throw (evioException
)
virtual

Reads from socket into user-supplied event buffer.

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

Implements evio::evioChannel.

bool evioSocketChannel::readAlloc ( uint32_t **  buffer,
uint32_t *  bufLen 
)
throw (evioException
)
virtual

Reads from socket 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.

bool evioSocketChannel::readNoCopy ( void  )
throw (evioException
)
virtual

Reads from socket using no copy mechanism.

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

Implements evio::evioChannel.

void evioSocketChannel::write ( void  )
throw (evioException
)
virtual

Writes to socket from internal buffer.

Implements evio::evioChannel.

void evioSocketChannel::write ( const uint32_t *  myBuf)
throw (evioException
)
virtual

Writes to socket from user-supplied buffer.

Parameters
myBufBuffer containing event

Implements evio::evioChannel.

void evioSocketChannel::write ( const evioChannel channel)
throw (evioException
)
virtual

Writes to socket from internal buffer of another evioChannel object.

Parameters
channelChannel object

Implements evio::evioChannel.

void evioSocketChannel::write ( const evioChannel channel)
throw (evioException
)
virtual

Writes from internal buffer of another evioChannel object.

Parameters
channelPointer to channel object

Implements evio::evioChannel.

void evioSocketChannel::write ( const evioChannelBufferizable o)
throw (evioException
)
virtual

Writes from contents of evioChannelBufferizable object.

Parameters
oevioChannelBufferizable object that can serialize to socket

Implements evio::evioChannel.

void evioSocketChannel::write ( const evioChannelBufferizable o)
throw (evioException
)
virtual

Writes from contents of evioChannelBufferizable object.

Parameters
oPointer to evioChannelBufferizable object that can serialize to socket

Implements evio::evioChannel.


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