20 #ifndef CO_BUFFER_CONNECTION_H
21 #define CO_BUFFER_CONNECTION_H
23 #include <co/connection.h>
24 #include <lunchbox/types.h>
28 namespace detail {
class BufferConnection; }
47 CO_API
const lunchbox::Bufferb&
getBuffer()
const;
53 CO_API uint64_t
getSize()
const;
58 virtual void readNB(
void*,
const uint64_t ) { LBDONTCALL; }
59 virtual int64_t
readSync(
void*,
const uint64_t,
const bool )
60 { LBDONTCALL;
return -1; }
61 CO_API
virtual int64_t
write(
const void* buffer,
const uint64_t bytes);
67 detail::BufferConnection*
const _impl;
70 typedef lunchbox::RefPtr< BufferConnection > BufferConnectionPtr;
71 typedef lunchbox::RefPtr< const BufferConnection > ConstBufferConnectionPtr;
74 #endif // CO_BUFFER_CONNECTION_H
CO_API BufferConnection()
Construct a new buffer connection.
virtual int64_t readSync(void *, const uint64_t, const bool)
Finish reading data from the connection.
An interface definition for communication between hosts.
CO_API const lunchbox::Bufferb & getBuffer() const
CO_API void sendBuffer(ConnectionPtr connection)
Flush the accumulated data, sending it to the given connection.
A proxy connection buffering outgoing data into a memory buffer.
CO_API uint64_t getSize() const
int Notifier
The Notifier used by the ConnectionSet to detect readiness of a Connection.
virtual CO_API ~BufferConnection()
Destruct this buffer connection.
virtual void readNB(void *, const uint64_t)
Start a read operation on the connection.
virtual Notifier getNotifier() const
virtual CO_API int64_t write(const void *buffer, const uint64_t bytes)
Write data to the connection.
lunchbox::RefPtr< Connection > ConnectionPtr
A reference pointer for Connection pointers.