CDPPort Class

The CDPPort bulk connects a list of values. This can be used to define "ports" that allow plugging one component into another without manually connecting a large number of signals and properties. More...

Header: #include <CDPSystem/Base/CDPPort.h>
Inherits: CDPObject

Public Functions

CDPPort()
virtual ~CDPPort()
void AddInput(const std::string &name, const std::string &localName, const std::string &remoteName)
void AddOutput(const std::string &name, const std::string &localName, const std::string &remoteName)
void Connect(const std::string &routing)
void Disconnect()
bool IsConnected() const
void Reconnect()
void RemoveInput(const std::string &name)
void RemoveOutput(const std::string &name)
void SetDataConsistency(bool dataConsistency)

Reimplemented Public Functions

virtual void Activate() override
virtual void Configure(XMLElementEx *xml) override
virtual void Create(const char *shortName, CDPComponent *parent) override
virtual void CreateModel() override
virtual void Destroy() override
virtual void FillNodeChildren(CDP::StudioAPI::NodeStream &serializer) const override
virtual void Suspend() override

Protected Functions

virtual int MessageConnectPortFailed(void *message)
virtual int MessageConnectPortOK(void *message)

Reimplemented Protected Functions

virtual void SetPropertyHandler(CDPPropertyBase *property) override

Additional Inherited Members

Detailed Description

The CDPPort bulk connects a list of values. This can be used to define "ports" that allow plugging one component into another without manually connecting a large number of signals and properties.

For detailed CDPPort usage see Advanced: CDP Port and Port Usage Tutorial

Member Function Documentation

CDPPort::CDPPort()

Default constructs an instance of CDPPort.

[virtual] CDPPort::~CDPPort()

Destroys the instance of CDPPort. The destructor is virtual.

[override virtual] void CDPPort::Activate()

Reimplemented from CDPBaseObject::Activate().

Establishes connection to remote object. Called automatically by parent component on startup.

void CDPPort::AddInput(const std::string &name, const std::string &localName, const std::string &remoteName)

Adds a input in addition to those specified in configuration.

If port was connected when this method was called, a reconnect sequence will be triggered. For bulk modifications first call Disconnect(), then do modifications and finally call Reconnect().

void CDPPort::AddOutput(const std::string &name, const std::string &localName, const std::string &remoteName)

Adds a output in addition to those specified in configuration.

If port was connected when this method was called, a reconnect sequence will be triggered. For bulk modifications first call Disconnect(), then do modifications and finally call Reconnect().

[override virtual] void CDPPort::Configure(XMLElementEx *xml)

Reimplemented from CDPObject::Configure().

void CDPPort::Connect(const std::string &routing)

Connects the port to specified remote node

[override virtual] void CDPPort::Create(const char *shortName, CDPComponent *parent)

Reimplemented from CDPObject::Create().

[override virtual] void CDPPort::CreateModel()

Reimplemented from CDPBaseObject::CreateModel().

[override virtual] void CDPPort::Destroy()

void CDPPort::Disconnect()

Disconnects all inputs and outputs.

[override virtual] void CDPPort::FillNodeChildren(CDP::StudioAPI::NodeStream &serializer) const

Reimplemented from CDPNode::FillNodeChildren().

bool CDPPort::IsConnected() const

Returns true if all inputs and outputs were found and have been connected.

[virtual protected] int CDPPort::MessageConnectPortFailed(void *message)

Received when connecting a output failed.

[virtual protected] int CDPPort::MessageConnectPortOK(void *message)

Received when a output specified in message parameter string was successfully connected.

void CDPPort::Reconnect()

Connects to node specified by Routing property.

void CDPPort::RemoveInput(const std::string &name)

Removes a input.

If port was connected when this method was called, a reconnect sequence will be triggered. For bulk modifications first call Disconnect(), then do modifications and finally call Reconnect().

void CDPPort::RemoveOutput(const std::string &name)

Removes a output.

If port was connected when this method was called, a reconnect sequence will be triggered. For bulk modifications first call Disconnect(), then do modifications and finally call Reconnect().

void CDPPort::SetDataConsistency(bool dataConsistency)

When set to true, values connected by this port are sent within the same data packet, meaning that a group of remote values always appears consistent. Otherwise when multiple values change, they may appear for a remote application in wrong order or one change might be delayed a little. This option can only be enabled when the port only connects values with periodic routing (not event-based, see CDPPropertyBase::RouteMethod_e).

If port was connected when this method was called, a reconnect sequence will be triggered.

[override virtual protected] void CDPPort::SetPropertyHandler(CDPPropertyBase *property)

Reimplemented from CDPObject::SetPropertyHandler().

[override virtual] void CDPPort::Suspend()

Reimplemented from CDPBaseObject::Suspend().

Disconnects all inputs and outputs from remote object.

© CDP Technologies AS - All rights reserved