Migrating from CCA 0.3 to CCA 0.4

CCA is under continuous development, sometimes resulting in API changes between minor versions, as happened between CCA 0.3 to CCA 0.4.

This page helps by pointing to the most prominent API changes. Examples for all of the aspects can be found here.

Node / Component base class names

The base classes for Nodes and Components were renamed consistently (see API documentation):

  • CCANode => Node
  • BaseComponent => Component

Initial component state

While in CCA 0.3 components were initialized stopped, which seemed like an unconvenient default, in CCA 0.4 the initial state of a component can be specified. It is now executing by default and can be set via an optional second parameter in the component constructor:

// MyDefaultComponent will be initialized executing
class MyDefaultComponent : cca::Component {
  MyDefaultComponent() // Constructor
      : cca::Component("Default Component") {

// MyStoppedComponent will be initialized stopped
class MyStoppedComponent : cca::Component {
  MyStoppedComponent() // Constructor
      : cca::Component("Stopped Component", ComponentState::STOPPED()) {

see also: Component Lifecycle.

Ports are named and typed

Component and node Ports are now typed and provide their own API for sending and receiving data, which was formerly done through the API of the node or component. Ports are meant to be class members now and are registered to the node / component by a name for configuration.

Publishing data through a port is now:

OutputPort<int>::Ptr PORT;
OutputPort<int>::DataPtr data = ...

Receiving data now became significantly easier. Since the ports are typed, manual casting is no longer required:

InputPort<int>::Ptr PORT;
InputPort<int>::DataPtr data = IN->get();

Processing strategy class names and helper methods

The classes of the standard Processing Strategies were renamed for the sake of brevity (see API documentation):

  • TimedProcessing => Timed
  • ModerateProcessing => Moderate
  • ...

The static helper methods to create shared pointers were renamed to be more specific (see API documentation):

  • TimedProcessing::create(2) => Timed::samplerate(2)
  • ModerateProcessing::create(0) => Moderate::noTimeout()
  • PortTriggeredProcessing::create(0) => PortTriggered::port("feedback")
  • ...

Printing nodes and components

Printing component information is now accessible over the print() method:

std::cout << myNode->print() << std::endl;

Table of Contents

Related Documentation

This Page