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 void readNB(
void*,
const uint64_t )
override { LBDONTCALL; }
59 int64_t
readSync(
void*,
const uint64_t,
const bool )
override
60 { LBDONTCALL;
return -1; }
61 CO_API int64_t
write(
const void* buffer,
62 const uint64_t bytes)
override;
68 detail::BufferConnection*
const _impl;
71 typedef lunchbox::RefPtr< BufferConnection > BufferConnectionPtr;
72 typedef lunchbox::RefPtr< const BufferConnection > ConstBufferConnectionPtr;
75 #endif // CO_BUFFER_CONNECTION_H
Notifier getNotifier() const override
CO_API int64_t write(const void *buffer, const uint64_t bytes) override
Write data to the connection.
int64_t readSync(void *, const uint64_t, const bool) override
Finish reading data from the connection.
CO_API void sendBuffer(ConnectionPtr connection)
Flush the accumulated data, sending it to the given connection.
CO_API BufferConnection()
Construct a new buffer connection.
CO_API uint64_t getSize() const
int Notifier
The Notifier used by the ConnectionSet to detect readiness of a Connection.
CO_API const lunchbox::Bufferb & getBuffer() const
virtual CO_API ~BufferConnection()
Destruct this buffer connection.
An interface definition for communication between hosts.
A proxy connection buffering outgoing data into a memory buffer.
void readNB(void *, const uint64_t) override
Start a read operation on the connection.
lunchbox::RefPtr< Connection > ConnectionPtr
A reference pointer for Connection pointers.