10 #ifndef YARP_OS_PORTWRITERBUFFER_H
11 #define YARP_OS_PORTWRITERBUFFER_H
21 #ifndef DOXYGEN_SHOULD_SKIP_THIS
24 class PortWriterBufferAdaptor :
public PortWriterWrapper
27 PortWriterBufferManager& creator;
31 PortWriterBufferAdaptor(PortWriterBufferManager& creator,
38 bool write(ConnectionWriter& connection)
const override
40 return writer.write(connection);
43 void onCompletion()
const override
45 writer.onCompletion();
46 creator.onCompletion(tracker);
49 void onCommencement()
const override
51 writer.onCommencement();
54 PortWriter* getInternal()
override
104 PortWriterBufferAdaptor<T>* content = (PortWriterBufferAdaptor<T>*)
getContent();
105 return content->writer;
133 void write(
bool forceStrict =
false)
146 virtual PortWriterWrapper*
create(PortWriterBufferManager& man,
147 void* tracker)
override
149 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.