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.
The base classes for Nodes and Components were renamed consistently (see API documentation):
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.
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 = ...
OUT->publish(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();
The classes of the standard Processing Strategies were renamed for the sake of brevity (see API documentation):
The static helper methods to create shared pointers were renamed to be more specific (see API documentation):
Printing component information is now accessible over the print() method:
std::cout << myNode->print() << std::endl;