21PortWriterBufferManager::~PortWriterBufferManager() =
default;
52 if (port !=
nullptr) {
63 completionSema.
wait();
71 if (callback !=
nullptr) {
102 if (
cback !=
nullptr) {
106 cback->onCompletion();
108 return cback !=
nullptr;
117 bool sig = finishing;
121 completionSema.
post();
150 if (active !=
nullptr && port !=
nullptr) {
161 std::mutex stateMutex;
163 Port* port {
nullptr};
166 bool finishing {
false};
196 return mPriv->getCount();
216 mPriv->finishWrites();
void onCompletion(void *tracker) override
Private(PortWriterBufferBase &owner)
A mini-server for performing network communication in the background.
void release(void *handle) override
Return control to YARP of an object previously taken control of with the acquire() method.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
const void * getContent() const
virtual ~PortWriterBufferBase()
virtual PortWriterWrapper * create(PortWriterBufferManager &man, void *tracker)=0
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
A mini-server for network communication.
void enableBackgroundWrite(bool backgroundFlag)
control whether writing from this port is done in the background.
bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const override
Write an object to the port.
bool isOpen() const
Check if the port has been opened.
A class for thread synchronization and mutual exclusion.
void wait()
Decrement the counter, even if we must wait to do that.
void post()
Increment the counter.
A single message, potentially being transmitted on multiple connections.
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.
const yarp::os::PortWriter * getContent()
const yarp::os::PortWriter * getCallback()
A collection of messages being transmitted over connections.
PortCorePacket * getFreePacket()
Get a packet that we can prepare for sending.
void freePacket(PortCorePacket *packet, bool clear=true)
Force the given packet into an inactive state.
#define yCAssert(component, x)
#define yCDebug(component,...)
#define YARP_OS_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.