• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - CDP Core
  • MessagePacketHandle
  • 5.0.0

MessagePacketHandle Class

The MessagePacketHandle class represents a handle to a message packet. More...

Header: #include <MessagePacketHandle>
  • List of all members, including inherited members

Public Functions

MessagePacketHandle()
MessagePacketHandle(const std::shared_ptr<MessageReusePool> &customPool)
MessagePacketHandle(const MessagePacketHandle &other)
MessagePacketHandle(const T &customMessage)
MessagePacketHandle(const Message &customMessage)
~MessagePacketHandle()
unsigned int Destination() const
MessagePacket &Packet()
const MessagePacket &Packet() const
void SetDestination(unsigned int destination) const
MessagePacketHandle &operator=(const MessagePacketHandle &other)

Detailed Description

The MessagePacketHandle class represents a handle to a message packet.

The MessagePacketHandle provides a way to manage the lifetime and access to a message packet.

Member Function Documentation

MessagePacketHandle::MessagePacketHandle()

Default constructs an instance of MessagePacketHandle.

MessagePacketHandle::MessagePacketHandle(const std::shared_ptr<MessageReusePool> &customPool)

Constructor for the MessagePacketHandle using a Custom packet pool for packet reuse.

MessagePacketHandle::MessagePacketHandle(const MessagePacketHandle &other)

Copy constructor for the MessagePacketHandle class.

This constructor creates a new MessagePacketHandle instance as a copy of an existing instance, but does not copy any data.

It takes care of properly managing the reference count to the MessagePacket instance to ensure that it is not prematurely released.

other The source MessagePacketHandle instance to duplicate.

MessagePacketHandle::MessagePacketHandle(const T &customMessage)

Default constructs an instance of MessagePacketHandle.

MessagePacketHandle::MessagePacketHandle(const Message &customMessage)

Data copy constructor for the MessagePacketHandle class.

This method provides a way to copy the payload data of one MessagePacketHandle instance to another, making a modifiable copy of a MessagePacketHandle instance. This is useful when different destinations are used for the same but slightly altered message.

customMessage the source message to copy, typically from handle.Packet().GetMessage()

MessagePacketHandle::~MessagePacketHandle()

Destructor for MessagePacketHandle.

unsigned int MessagePacketHandle::Destination() const

Gets the destination of the message packet handle.

Returns the destination of the message packet handle.

MessagePacket &MessagePacketHandle::Packet()

Gets modifiable message packet when possible associated with the handle.

Returns the reference to the message packet.

const MessagePacket &MessagePacketHandle::Packet() const

Gets const message packet reference associated with the handle.

Returns the const reference to the message packet.

void MessagePacketHandle::SetDestination(unsigned int destination) const

Sets the destination of the message packet.

MessagePacketHandle &MessagePacketHandle::operator=(const MessagePacketHandle &other)

Overloads the assignment operator for the MessagePacketHandle class.

This method provides a way to assign the contents of one MessagePacketHandle instance to another making a copy of a MessagePacketHandle instance, but does not copy any data.

other The source MessagePacketHandle instance from which to copy. Returns a reference to the current instance, to allow for chained assignment operations.

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top