• 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
  • NodeStream
  • 5.0.0

NodeStream Class

(CDP::StudioAPI::NodeStream)

The NodeStream is helper class abstracting node serialization. More...

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

Public Functions

NodeStream(ICDPNode *owner)
virtual ~NodeStream()
void StdContainerStreamer(TContainer &container)
NodeStream &operator<<(const ICDPNode &node)
NodeStream &operator<<(const ICDPNode *node)
NodeStream &operator<<(const std::unique_ptr<T> &node)
NodeStream &operator<<(const AdoptedChild &node)
NodeStream &operator<<(const AbsorbedChild &node)

Detailed Description

The NodeStream is helper class abstracting node serialization.

NodeStream is a class that implements stream operators for CDPNode based classes, AdoptedChild, AbsorbedChild and provides helper template call StdContainerStreamer() that takes as argument any std container reference that is iterable by const_iterator.

Member Function Documentation

NodeStream::NodeStream(ICDPNode *owner)

Default constructs an instance of NodeStream.

[virtual] NodeStream::~NodeStream()

Destroys the instance of NodeStream. The destructor is virtual.

void NodeStream::StdContainerStreamer(TContainer &container)

Serializes the CDPNode based pointers in std container provided as an argument container

The provided std container must be iterable by a const_iterator like std::vector or std::list.

void MyNode::FillNodeChildren(NodeStream& serializer) const
{
  serializer << nodeNotInContainer;
  serializer.StdContainerStreamer(childNodesContainer);
  CDPNode::FillNodeChildren(serializer); //Always call direct base class implementation
}

NodeStream &NodeStream::operator<<(const ICDPNode &node)

Defines a stream operator that accepts const ICDPNode& as its argument.

NodeStream &NodeStream::operator<<(const ICDPNode *node)

Defines a stream operator that accepts const ICDPNode* as its argument.

NodeStream &NodeStream::operator<<(const std::unique_ptr<T> &node)

NodeStream &NodeStream::operator<<(const AdoptedChild &node)

Defines a stream operator that accepts const AdoptedChild& as its argument.

AdoptedChild is used as a wrapper class to relocate a node in logical tree from its parent under this node.

void MyNode::FillNodeChildren(NodeStream& serializer) const
{
  serializer << AdoptedChild(parentsNode);
  CDPNode::FillNodeChildren(serializer); //Always call direct base class implementation
}

NodeStream &NodeStream::operator<<(const AbsorbedChild &node)

Defines a stream operator that accepts const AbsorbedChild& as its argument.

AbsorbedChild is used as a wrapper class to absorb the children of a composited node, collapsing the node level that would occur otherwize during composition. Name of the absorbed node is ignored.

void MyNode::FillNodeChildren(NodeStream& serializer) const
{
  serializer << AbsorbedChild(compositedNode);
  CDPNode::FillNodeChildren(serializer); //Always call direct base class implementation
}

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