|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
24 PortWriterBufferManager::~PortWriterBufferManager() =
default;
52 int ct = packets.getCount();
59 yCDebug(PORTWRITERBUFFERBASE,
"finishing writes");
63 if (port !=
nullptr) {
64 if (!port->isOpen()) {
74 completionSema.wait();
77 yCDebug(PORTWRITERBUFFERBASE,
"finished writes");
82 if (callback !=
nullptr) {
86 yCDebug(PORTWRITERBUFFERBASE,
"releasing unused buffer");
91 yCAssert(PORTWRITERBUFFERBASE, packet !=
nullptr);
93 yCDebug(PORTWRITERBUFFERBASE,
"creating a writer buffer");
95 yarp::os::PortWriterWrapper* wrapper = owner.create(*
this, packet);
97 packet->
setContent(wrapper->getInternal(),
false, wrapper,
true);
113 if (cback !=
nullptr) {
119 return cback !=
nullptr;
125 yCDebug(PORTWRITERBUFFERBASE,
"freeing up a writer buffer");
128 bool sig = finishing;
132 completionSema.post();
161 if (active !=
nullptr && port !=
nullptr) {
165 port->
write(*active, cback);
201 return mPriv->release();
207 return mPriv->getCount();
222 mPriv->write(strict);
227 mPriv->finishWrites();
const void * getContent() const
A class for thread synchronization and mutual exclusion.
const yarp::os::PortWriter * getContent()
virtual ~PortWriterBufferBase()
const yarp::os::PortWriter * getCallback()
virtual void onCompletion() const
This is called when the port has finished all writing operations.
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
A mini-server for network communication.
A single message, potentially being transmitted on multiple connections.
void enableBackgroundWrite(bool backgroundFlag)
control whether writing from this port is done in the background.
Private(PortWriterBufferBase &owner)
virtual bool write(ConnectionWriter &writer) const =0
Write this object to a network connection.
#define yCAssert(component, x)
void onCompletion(void *tracker) override
An interface to the operating system, including Port based communication.
#define yCDebug(component,...)
void setContent(const yarp::os::PortWriter *writable, bool owned=false, const yarp::os::PortWriter *callback=nullptr, bool ownedCallback=false)
Configure the object being sent and where to send notifications.
A collection of messages being transmitted over connections.
#define YARP_OS_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.