7 #ifndef YARP_OS_PORTWRITERBUFFER_H
8 #define YARP_OS_PORTWRITERBUFFER_H
18 #ifndef DOXYGEN_SHOULD_SKIP_THIS
21 class PortWriterBufferAdaptor :
public PortWriterWrapper
24 PortWriterBufferManager& creator;
28 PortWriterBufferAdaptor(PortWriterBufferManager& creator,
35 bool write(ConnectionWriter& connection)
const override
37 return writer.write(connection);
40 void onCompletion()
const override
42 writer.onCompletion();
43 creator.onCompletion(tracker);
46 void onCommencement()
const override
48 writer.onCommencement();
51 PortWriter* getInternal()
override
101 PortWriterBufferAdaptor<T>* content = (PortWriterBufferAdaptor<T>*)
getContent();
102 return content->writer;
130 void write(
bool forceStrict =
false)
143 virtual PortWriterWrapper*
create(PortWriterBufferManager& man,
144 void* tracker)
override
146 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.
virtual PortWriterWrapper * create(PortWriterBufferManager &man, void *tracker) override
void write(bool forceStrict=false)
Try to write the last buffer returned by PortWriterBuffer::get.
void waitForWrite()
Wait until any pending writes are done.
T & prepare()
Access the object which will be transmitted by the next call to PortWriterBuffer::write.
int getCount()
Check the number of buffers currently in use for communication.
T & get()
A synonym of PortWriterBuffer::prepare.
void attach(Port &port)
Set the Port to which objects will be written.
A mini-server for network communication.
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
The main, catch-all namespace for YARP.