YARP
Yet Another Robot Platform
yarp::os::impl::PortCorePacket Class Reference

A single message, potentially being transmitted on multiple connections. More...

#include <yarp/os/impl/PortCorePacket.h>

Public Member Functions

 PortCorePacket ()
 Constructor. More...
 
virtual ~PortCorePacket ()
 Destructor. More...
 
int getCount ()
 
void inc ()
 Increment the usage count for this messagae. More...
 
void dec ()
 Decrement the usage count for this messagae. More...
 
const yarp::os::PortWritergetContent ()
 
const yarp::os::PortWritergetCallback ()
 
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. More...
 
void reset ()
 Delete anything we own and enter a clean state, as if freshly created. More...
 
void complete ()
 Send a completion notification if we haven't already, and there's somewhere to send it to. More...
 

Public Attributes

PortCorePacketprev_
 this packet will be in a list of active packets More...
 
PortCorePacketnext_
 this packet will be in a list of active packets More...
 
const yarp::os::PortWritercontent
 the object being sent More...
 
const yarp::os::PortWritercallback
 where to send event notifications More...
 
int ct
 number of uses of the messagae More...
 
bool owned
 should we memory-manage the content object More...
 
bool ownedCallback
 should we memory-manage the callback object More...
 
bool completed
 has a notification of completion been sent More...
 

Detailed Description

A single message, potentially being transmitted on multiple connections.

This tracks uses of the message for memory management purposes.

Definition at line 19 of file PortCorePacket.h.

Constructor & Destructor Documentation

◆ PortCorePacket()

yarp::os::impl::PortCorePacket::PortCorePacket ( )
inline

Constructor.

Definition at line 34 of file PortCorePacket.h.

◆ ~PortCorePacket()

virtual yarp::os::impl::PortCorePacket::~PortCorePacket ( )
inlinevirtual

Destructor.

Destroy any owned objects unconditionally.

Definition at line 50 of file PortCorePacket.h.

Member Function Documentation

◆ complete()

void yarp::os::impl::PortCorePacket::complete ( )
inline

Send a completion notification if we haven't already, and there's somewhere to send it to.

Definition at line 140 of file PortCorePacket.h.

◆ dec()

void yarp::os::impl::PortCorePacket::dec ( )
inline

Decrement the usage count for this messagae.

Definition at line 75 of file PortCorePacket.h.

◆ getCallback()

const yarp::os::PortWriter * yarp::os::impl::PortCorePacket::getCallback ( )
inline
Returns
the object to which notifications should be sent.

Definition at line 91 of file PortCorePacket.h.

◆ getContent()

const yarp::os::PortWriter * yarp::os::impl::PortCorePacket::getContent ( )
inline
Returns
the object being sent.

Definition at line 83 of file PortCorePacket.h.

◆ getCount()

int yarp::os::impl::PortCorePacket::getCount ( )
inline
Returns
number of users of this message.

Definition at line 59 of file PortCorePacket.h.

◆ inc()

void yarp::os::impl::PortCorePacket::inc ( )
inline

Increment the usage count for this messagae.

Definition at line 67 of file PortCorePacket.h.

◆ reset()

void yarp::os::impl::PortCorePacket::reset ( )
inline

Delete anything we own and enter a clean state, as if freshly created.

Definition at line 120 of file PortCorePacket.h.

◆ setContent()

void yarp::os::impl::PortCorePacket::setContent ( const yarp::os::PortWriter writable,
bool  owned = false,
const yarp::os::PortWriter callback = nullptr,
bool  ownedCallback = false 
)
inline

Configure the object being sent and where to send notifications.

Parameters
writablethe object being sent
ownedshould we memory-manage writable
callbackwhere to send notifications
ownedCallbackshould we memory-manage callback

Definition at line 104 of file PortCorePacket.h.

Member Data Documentation

◆ callback

const yarp::os::PortWriter* yarp::os::impl::PortCorePacket::callback

where to send event notifications

Definition at line 25 of file PortCorePacket.h.

◆ completed

bool yarp::os::impl::PortCorePacket::completed

has a notification of completion been sent

Definition at line 29 of file PortCorePacket.h.

◆ content

const yarp::os::PortWriter* yarp::os::impl::PortCorePacket::content

the object being sent

Definition at line 24 of file PortCorePacket.h.

◆ ct

int yarp::os::impl::PortCorePacket::ct

number of uses of the messagae

Definition at line 26 of file PortCorePacket.h.

◆ next_

PortCorePacket* yarp::os::impl::PortCorePacket::next_

this packet will be in a list of active packets

Definition at line 23 of file PortCorePacket.h.

◆ owned

bool yarp::os::impl::PortCorePacket::owned

should we memory-manage the content object

Definition at line 27 of file PortCorePacket.h.

◆ ownedCallback

bool yarp::os::impl::PortCorePacket::ownedCallback

should we memory-manage the callback object

Definition at line 28 of file PortCorePacket.h.

◆ prev_

PortCorePacket* yarp::os::impl::PortCorePacket::prev_

this packet will be in a list of active packets

Definition at line 22 of file PortCorePacket.h.


The documentation for this class was generated from the following file: