nl::Weave::Profiles::RetainedPacketBuffer

#include <src/lib/profiles/common/WeaveMessage.h>

This is a base class that serves as a convenience object for automatically reference counting a System::PacketBuffer.

Summary

Inheritance

Direct Known Subclasses:
  nl::Weave::Profiles::BDX_Current::BlockSend
  nl::Weave::Profiles::BDX_Development::BlockSend
  nl::Weave::Profiles::BDX_Development::BlockSendV1
  nl::Weave::Profiles::MessageIterator
  nl::Weave::Profiles::ReferencedString
  nl::Weave::Profiles::ReferencedTLVData

Constructors and Destructors

RetainedPacketBuffer(void)
This is the class default (void) constructor.
RetainedPacketBuffer(const RetainedPacketBuffer & aRetainedPacketBuffer)
This is a class copy constructor.
~RetainedPacketBuffer(void)
This is the class destructor.

Protected attributes

mBuffer
A pointer to the retained packet buffer.

Public functions

GetBuffer(void)
IsRetaining(void) const
virtual bool
Verify whether or not this object is retaining a buffer.
Release(void)
virtual void
Remove the strong reference to the buffer associated with the object, making this object available to retain another buffer.
Retain(System::PacketBuffer *aBuffer)
void
Create a strong reference to the specified packet buffer and, if necessary, displace and remove the strong reference to another buffer associated with this object.
operator=(const RetainedPacketBuffer & aRetainedPacketBuffer)
This is a class assignment operator.

Protected attributes

mBuffer

System::PacketBuffer * mBuffer

A pointer to the retained packet buffer.

Public functions

GetBuffer

System::PacketBuffer * GetBuffer(
  void
)

IsRetaining

virtual bool IsRetaining(
  void
) const 

Verify whether or not this object is retaining a buffer.

Details
Returns
true if the object is retaining a buffer; otherwise, false.

Release

virtual void Release(
  void
)

Remove the strong reference to the buffer associated with the object, making this object available to retain another buffer.

Retain

void Retain(
  System::PacketBuffer *aBuffer
)

Create a strong reference to the specified packet buffer and, if necessary, displace and remove the strong reference to another buffer associated with this object.

RetainedPacketBuffer

 RetainedPacketBuffer(
  void
)

This is the class default (void) constructor.

RetainedPacketBuffer

 RetainedPacketBuffer(
  const RetainedPacketBuffer & aRetainedPacketBuffer
)

This is a class copy constructor.

It increases the reference count, creating a strong reference to the buffer associated with the copied object.

Details
Parameters
[in] aRetainedPacketBuffer
A constant reference to the object to be copied.

operator=

RetainedPacketBuffer & operator=(
  const RetainedPacketBuffer & aRetainedPacketBuffer
)

This is a class assignment operator.

As long as the assigned object is not the current object, this creates a strong reference to the buffer associated with the copied object while, if necessary, removing the strong reference to the buffer associated with this object.

Details
Parameters
[in,out] aRetainedPacketBuffer
A read-only reference to the object to assign to this one. If the reference is not this object, the source object's associated buffer is retained, displacing the currently associated buffer.
Returns
a read-only reference to the current object.

~RetainedPacketBuffer

 ~RetainedPacketBuffer(
  void
)

This is the class destructor.

It removes the strong reference to the associated buffer.