7#ifndef YARP_OS_PORTWRITERBUFFER_H
8#define YARP_OS_PORTWRITERBUFFER_H
17#ifndef DOXYGEN_SHOULD_SKIP_THIS
20class PortWriterBufferAdaptor :
public PortWriterWrapper
23 PortWriterBufferManager& creator;
27 PortWriterBufferAdaptor(PortWriterBufferManager& creator,
34 bool write(ConnectionWriter& connection)
const override
36 return writer.write(connection);
39 void onCompletion()
const override
41 writer.onCompletion();
42 creator.onCompletion(tracker);
45 void onCommencement()
const override
47 writer.onCommencement();
50 PortWriter* getInternal()
override
100 PortWriterBufferAdaptor<T>* content = (PortWriterBufferAdaptor<T>*)
getContent();
101 return content->writer;
129 void write(
bool forceStrict =
false)
142 virtual PortWriterWrapper*
create(PortWriterBufferManager& man,
143 void* tracker)
override
145 return new PortWriterBufferAdaptor<T>(man, tracker);
const void * getContent() const
Buffer outgoing data to a port.
bool unprepare()
Give the last prepared object back to YARP without writing it.
T & get()
A synonym of PortWriterBuffer::prepare.
void write(bool forceStrict=false)
Try to write the last buffer returned by PortWriterBuffer::get.
void waitForWrite()
Wait until any pending writes are done.
int getCount()
Check the number of buffers currently in use for communication.
T & prepare()
Access the object which will be transmitted by the next call to PortWriterBuffer::write.
void attach(Port &port)
Set the Port to which objects will be written.
virtual PortWriterWrapper * create(PortWriterBufferManager &man, void *tracker) override
A mini-server for network communication.
An interface to the operating system, including Port based communication.
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)