= Adding inputs/outputs = To send data between components, Pacpus uses input/output system based on signals/slots. We will try to add to our component called ```MyComponent```: 1. an output named ```"scan"``` of type ```LidarScan```, 2. an input named ```"pose"``` of type ```GeoPose2D``` . So, add virtual methods overriden from ```ComponentBase```: ```addInputs()``` and ```addOutputs()``` to the component: {{{#!c++ // MyComponent.h class My Component // ... { // ... protected: virtual void addInputs() /* override */; virtual void addOutputs() /* override */; }; }}} {{{#!c++ // MyComponent.cpp void MyComponent::addInputs() { // inputs go here } void MyComponent::addOutputs() { // outputs go here } }}} == Adding an output == To add an output, you have to use template method ```ComponentBase::addOutput(const char* outputName)```: {{{#!c++ // MyComponent.cpp void MyComponent::addOutputs() { // outputs go here addOutput("scan"); } }}} == Adding an input == To add an input, you have to have a method in your class that will process it. It should take as the only argument, a constant reference to the type of the input. In our example, we suppose to have a function declared as follows: {{{#!c++ void processPose(GeoPose2D const& pose); }}} You have to use template method ```ComponentBase::addInput(const char* outputName, ProcessingFunction inputProcessingFunction)```: {{{#!c++ // MyComponent.cpp void MyComponent::addInputs() { // inputs go here addInput("pose", &MyComponent::processPose); } }}} The second argument is the address (```&```) of our processing method. You can also use a free function or a functor object, as well as any other callable object, e.g. ```std::function```, ```boost::function```, etc.