eq::net::DataOStream Class Reference

#include <dataOStream.h>

Inheritance diagram for eq::net::DataOStream:

[legend]

List of all members.


Detailed Description

A std::ostream buffering and/or retaining data in a binary format.

Derived classes send the data using command packets.

Definition at line 25 of file dataOStream.h.


Basic data output

ConnectionVector _connections
 Locked connections to the receivers, if _enabled.
template<typename T>
DataOStreamoperator<< (const T &value)
template<typename T>
DataOStreamoperator<< (const std::vector< T > &value)
void write (const void *data, uint64_t size)
void writeOnce (const void *data, uint64_t size)
virtual void sendHeader (const void *buffer, const uint64_t size)=0
 Send the leading data (packet) to the receivers.
virtual void sendBuffer (const void *buffer, const uint64_t size)=0
 Send a data buffer (packet) to the receivers.
virtual void sendFooter (const void *buffer, const uint64_t size)=0
 Send the trailing data (packet) to the receivers.
virtual void sendSingle (const void *buffer, const uint64_t size)
 Send only one data item (packet) to the receivers.

Public Member Functions

void enable (const NodeVector &receivers)
 Enable output, locks the connections to the receivers.
void enable (const ConnectionVector &receivers)
void enable (const NodePtr node)
void enable ()
void resend (const NodePtr node)
 Resend the saved buffer.
void disable ()
 Disable, flush and unlock the output to the current receivers.
void flush ()
 Flush the buffer.
void enableBuffering ()
 Enable aggregation/copy of data before sending it.
void disableBuffering ()
 Disable aggregation/copy of data before sending it.
void enableSave ()
 Enable copying of all data into a saved buffer.
void disableSave ()
 Disable copying of all data into a saved buffer.
template<>
DataOStreamoperator<< (const std::string &str)
template<>
DataOStreamoperator<< (const NodeID &nodeID)
Data Access.
bool hasSentData () const
const base::BufferbgetSaveBuffer () const

Member Function Documentation

void eq::net::DataOStream::resend ( const NodePtr  node  ) 

Resend the saved buffer.

Definition at line 83 of file dataOStream.cpp.

References _connections, eq::base::Buffer< T >::data, sendSingle(), and eq::base::Buffer< T >::size.

Referenced by eq::net::DeltaMasterCM::addSlave().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::net::DataOStream::disable (  ) 

Disable, flush and unlock the output to the current receivers.

Definition at line 99 of file dataOStream.cpp.

References _connections, eq::base::Buffer< T >::data, sendFooter(), sendSingle(), and eq::base::Buffer< T >::size.

Referenced by eq::net::UnbufferedMasterCM::addSlave(), and eq::net::StaticMasterCM::addSlave().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::net::DataOStream::flush (  ) 

Flush the buffer.

Definition at line 199 of file dataOStream.cpp.

References eq::base::Buffer< T >::data, and eq::base::Buffer< T >::size.

Referenced by disableBuffering().

Here is the caller graph for this function:

void eq::net::DataOStream::enableBuffering (  ) 

Enable aggregation/copy of data before sending it.

Definition at line 137 of file dataOStream.cpp.

void eq::net::DataOStream::disableBuffering (  ) 

Disable aggregation/copy of data before sending it.

Definition at line 142 of file dataOStream.cpp.

References flush().

Here is the call graph for this function:

void eq::net::DataOStream::enableSave (  ) 

Enable copying of all data into a saved buffer.

Definition at line 151 of file dataOStream.cpp.

References eq::base::Buffer< T >::size.

void eq::net::DataOStream::disableSave (  ) 

Disable copying of all data into a saved buffer.

Definition at line 158 of file dataOStream.cpp.

References eq::base::Buffer< T >::size.

bool eq::net::DataOStream::hasSentData (  )  const [inline]

Returns:
if data was sent since the last enable()

Definition at line 59 of file dataOStream.h.

Referenced by eq::net::UnbufferedMasterCM::addSlave().

Here is the caller graph for this function:

const base::Bufferb& eq::net::DataOStream::getSaveBuffer (  )  const [inline]

Returns:
the buffer with the saved data.

Definition at line 62 of file dataOStream.h.

virtual void eq::net::DataOStream::sendBuffer ( const void *  buffer,
const uint64_t  size 
) [protected, pure virtual]

Send a data buffer (packet) to the receivers.

Implemented in eq::net::ObjectDeltaDataOStream, and eq::net::ObjectInstanceDataOStream.


The documentation for this class was generated from the following files:
Generated on Sat Dec 6 12:01:51 2008 for Equalizer 0.6 by  1.5.5