#include <dataOStream.h>


Public Member Functions | |
Internal | |
| DataOStream () | |
| virtual | ~DataOStream () |
| 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 | 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. | |
| bool | hasSentData () const |
| const base::Bufferb & | getSaveBuffer () const |
Data output | |
| void | flush () |
| Flush remaining data in the buffer. | |
| template<typename T > | |
| DataOStream & | operator<< (const T &value) |
| Write a plain data item by copying it to the stream. | |
| template<typename T > | |
| DataOStream & | operator<< (const std::vector< T > &value) |
| Write a std::vector of serializable items. | |
| void | write (const void *data, uint64_t size) |
| Write a number of bytes from data into the stream. | |
| void | writeOnce (const void *data, uint64_t size) |
| Write one block of data into the stream and close it immediately. | |
Specialized output operators | |
| template<> | |
| DataOStream & | operator<< (const std::string &str) |
| Write a std::string. | |
| template<> | |
| DataOStream & | operator<< (const base::UUID &id) |
| Write a base::UUID. | |
| template<> | |
| DataOStream & | operator<< (const std::vector< uint8_t > &value) |
| Optimized specialization to write a std::vector of uint8_t. | |
| template<> | |
| DataOStream & | operator<< (const std::vector< uint32_t > &value) |
| Optimized specialization to write a std::vector of uint32_t. | |
| template<> | |
| DataOStream & | operator<< (const std::vector< int32_t > &value) |
| Optimized specialization to write a std::vector of int32_t. | |
| template<> | |
| DataOStream & | operator<< (const std::vector< uint64_t > &value) |
| Optimized specialization to write a std::vector of uint64_t. | |
| template<> | |
| DataOStream & | operator<< (const std::vector< int64_t > &value) |
| Optimized specialization to write a std::vector of int64_t. | |
| template<> | |
| DataOStream & | operator<< (const std::vector< float > &value) |
| Optimized specialization to write a std::vector of float. | |
| template<> | |
| DataOStream & | operator<< (const std::vector< double > &value) |
| Optimized specialization to write a std::vector of double. | |
Protected Member Functions | |
Packet sending, implemented by the subclasses | |
| 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. | |
Protected Attributes | |
| ConnectionVector | _connections |
| Locked connections to the receivers, if _enabled. | |
Derived classes send the data using the appropriate command packets.
Definition at line 38 of file dataOStream.h.
| void eq::net::DataOStream::resend | ( | const NodePtr | node | ) |
Resend the saved buffer.
Definition at line 96 of file dataOStream.cpp.
References _connections, eq::base::Buffer< T >::getData(), eq::base::Buffer< T >::getSize(), and sendSingle().
Referenced by eq::net::DeltaMasterCM::addSlave().


| void eq::net::DataOStream::disable | ( | ) |
Disable, flush and unlock the output to the current receivers.
Definition at line 112 of file dataOStream.cpp.
References _connections, eq::base::Buffer< T >::getData(), eq::base::Buffer< T >::getSize(), sendFooter(), and sendSingle().
Referenced by eq::net::UnbufferedMasterCM::addSlave(), and eq::net::StaticMasterCM::addSlave().


| void eq::net::DataOStream::enableBuffering | ( | ) |
| void eq::net::DataOStream::disableBuffering | ( | ) |
Disable aggregation/copy of data before sending it.
Definition at line 155 of file dataOStream.cpp.
References flush().

| void eq::net::DataOStream::enableSave | ( | ) |
Enable copying of all data into a saved buffer.
Definition at line 164 of file dataOStream.cpp.
References eq::base::Buffer< T >::getSize().

| void eq::net::DataOStream::disableSave | ( | ) |
Disable copying of all data into a saved buffer.
Definition at line 171 of file dataOStream.cpp.
References eq::base::Buffer< T >::getSize().

| bool eq::net::DataOStream::hasSentData | ( | ) | const [inline] |
Definition at line 69 of file dataOStream.h.
Referenced by eq::net::UnbufferedMasterCM::addSlave().

| const base::Bufferb& eq::net::DataOStream::getSaveBuffer | ( | ) | const [inline] |
| void eq::net::DataOStream::flush | ( | ) |
Flush remaining data in the buffer.
Definition at line 212 of file dataOStream.cpp.
References eq::base::Buffer< T >::getData(), and eq::base::Buffer< T >::getSize().
Referenced by disableBuffering(), and write().


| DataOStream& eq::net::DataOStream::operator<< | ( | const T & | value | ) | [inline] |
Write a plain data item by copying it to the stream.
Definition at line 83 of file dataOStream.h.
References write().

| DataOStream& eq::net::DataOStream::operator<< | ( | const std::vector< T > & | value | ) | [inline] |
Write a std::vector of serializable items.
Definition at line 88 of file dataOStream.h.
References write().

| void eq::net::DataOStream::write | ( | const void * | data, | |
| uint64_t | size | |||
| ) |
Write a number of bytes from data into the stream.
Definition at line 178 of file dataOStream.cpp.
References eq::base::Buffer< T >::append(), flush(), and eq::base::Buffer< T >::getSize().
Referenced by operator<<().


| void eq::net::DataOStream::writeOnce | ( | const void * | data, | |
| uint64_t | size | |||
| ) |
Write one block of data into the stream and close it immediately.
Definition at line 194 of file dataOStream.cpp.
References _connections, eq::base::Buffer< T >::append(), and sendSingle().
Referenced by eq::net::UnbufferedMasterCM::addSlave().


| 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.
| DataOStream& eq::net::DataOStream::operator<< | ( | const std::string & | str | ) | [inline] |
Write a std::string.
Definition at line 171 of file dataOStream.h.
References write().

| DataOStream& eq::net::DataOStream::operator<< | ( | const base::UUID & | id | ) | [inline] |
Write a base::UUID.
Definition at line 183 of file dataOStream.h.
References eq::base::UUID::convertToNetwork(), and write().

| DataOStream& eq::net::DataOStream::operator<< | ( | const std::vector< uint8_t > & | value | ) | [inline] |
Optimized specialization to write a std::vector of uint8_t.
Definition at line 193 of file dataOStream.h.
| DataOStream& eq::net::DataOStream::operator<< | ( | const std::vector< uint32_t > & | value | ) | [inline] |
Optimized specialization to write a std::vector of uint32_t.
Definition at line 201 of file dataOStream.h.
| DataOStream& eq::net::DataOStream::operator<< | ( | const std::vector< int32_t > & | value | ) | [inline] |
Optimized specialization to write a std::vector of int32_t.
Definition at line 209 of file dataOStream.h.
| DataOStream& eq::net::DataOStream::operator<< | ( | const std::vector< uint64_t > & | value | ) | [inline] |
Optimized specialization to write a std::vector of uint64_t.
Definition at line 217 of file dataOStream.h.
| DataOStream& eq::net::DataOStream::operator<< | ( | const std::vector< int64_t > & | value | ) | [inline] |
Optimized specialization to write a std::vector of int64_t.
Definition at line 225 of file dataOStream.h.
| DataOStream& eq::net::DataOStream::operator<< | ( | const std::vector< float > & | value | ) | [inline] |
Optimized specialization to write a std::vector of float.
Definition at line 233 of file dataOStream.h.
| DataOStream& eq::net::DataOStream::operator<< | ( | const std::vector< double > & | value | ) | [inline] |
Optimized specialization to write a std::vector of double.
Definition at line 241 of file dataOStream.h.
0.9 by
1.5.8