[1] | 1 | // *********************************************************************
|
---|
| 2 | //
|
---|
| 3 | // created: 2015/09/18
|
---|
| 4 | // filename: ComponentTemplate.cpp
|
---|
| 5 | //
|
---|
| 6 | // author: Gerald Dherbomez
|
---|
| 7 | // Copyright Heudiasyc (c) UMR UTC/CNRS 7253
|
---|
| 8 | //
|
---|
| 9 | // license: CECILL-C
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // brief: Pacpus template component source file
|
---|
| 14 | //
|
---|
| 15 | // *********************************************************************
|
---|
| 16 |
|
---|
| 17 | #include "Pacpus/kernel/ComponentFactory.h"
|
---|
| 18 | #include "Pacpus/kernel/DbiteFileTypes.h"
|
---|
| 19 |
|
---|
| 20 | #include "ComponentTemplate.h"
|
---|
| 21 |
|
---|
| 22 | using namespace pacpus;
|
---|
| 23 |
|
---|
| 24 |
|
---|
| 25 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 26 | /// Construct the factory
|
---|
| 27 | ComponentFactory<ComponentTemplate> sFactory("ComponentTemplate");
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 | /************************************************************************/
|
---|
| 32 | /* Constructor
|
---|
| 33 | /************************************************************************/
|
---|
| 34 | ComponentTemplate::ComponentTemplate(QString name)
|
---|
[9] | 35 | : ComponentBase(name)
|
---|
[1] | 36 | {
|
---|
| 37 |
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 |
|
---|
| 41 | /************************************************************************/
|
---|
| 42 | /* Destructor
|
---|
| 43 | /************************************************************************/
|
---|
| 44 | ComponentTemplate::~ComponentTemplate()
|
---|
| 45 | {
|
---|
[9] | 46 |
|
---|
[1] | 47 | }
|
---|
| 48 |
|
---|
[9] | 49 |
|
---|
[1] | 50 | /************************************************************************/
|
---|
[9] | 51 | /* Start function, called by the ComponentManager when a start()
|
---|
| 52 | /* command is received
|
---|
[1] | 53 | /************************************************************************/
|
---|
| 54 | void ComponentTemplate::startActivity()
|
---|
| 55 | {
|
---|
[9] | 56 | // if you add an ouput, uncomment the line
|
---|
| 57 | // out1_ = getTypedOutput<int, ComponentTemplate>("value");
|
---|
[1] | 58 | }
|
---|
| 59 |
|
---|
| 60 |
|
---|
| 61 | /************************************************************************/
|
---|
[9] | 62 | /* Stop function, called by the ComponentManager when a stop()
|
---|
| 63 | /* command is received
|
---|
[1] | 64 | /************************************************************************/
|
---|
| 65 | void ComponentTemplate::stopActivity()
|
---|
| 66 | {
|
---|
| 67 |
|
---|
| 68 | }
|
---|
| 69 |
|
---|
| 70 |
|
---|
[9] | 71 | /************************************************************************/
|
---|
| 72 | /* Called by the framework at initialization
|
---|
| 73 | /************************************************************************/
|
---|
| 74 | void ComponentTemplate::addInputs()
|
---|
| 75 | {
|
---|
| 76 | // uncomment to add an input
|
---|
| 77 | // addInput<int, ComponentTemplate>("value", &ComponentTemplate::processInput);
|
---|
| 78 | }
|
---|
[1] | 79 |
|
---|
[9] | 80 |
|
---|
[1] | 81 | /************************************************************************/
|
---|
[9] | 82 | /* Called by the framework at initialization
|
---|
[1] | 83 | /************************************************************************/
|
---|
[9] | 84 | void ComponentTemplate::addOutputs()
|
---|
| 85 | {
|
---|
| 86 | // empty: no output
|
---|
| 87 | // addOutput<int, ProducerExample>("value");
|
---|
| 88 | }
|
---|
| 89 |
|
---|
| 90 |
|
---|
| 91 | /************************************************************************/
|
---|
| 92 | /* Example function that produces an output
|
---|
| 93 | /************************************************************************/
|
---|
| 94 | // void ComponentTemplate::produceOutput()
|
---|
| 95 | // {
|
---|
| 96 | // int val = 12;
|
---|
| 97 | // checkedSend(out1_, val);
|
---|
| 98 | // }
|
---|
| 99 |
|
---|
| 100 |
|
---|
| 101 | /************************************************************************/
|
---|
| 102 | /* Example function that processes an input
|
---|
| 103 | /************************************************************************/
|
---|
| 104 | // void processInput(const int& value)
|
---|
| 105 | // {
|
---|
| 106 | //
|
---|
| 107 | // }
|
---|
| 108 |
|
---|
| 109 |
|
---|
| 110 | /************************************************************************/
|
---|
| 111 | /* Configuration of the component, called by the ComponentManager after
|
---|
| 112 | /* the construction of the object
|
---|
| 113 | /************************************************************************/
|
---|
[1] | 114 | ComponentBase::COMPONENT_CONFIGURATION ComponentTemplate::configureComponent(XmlComponentConfig config)
|
---|
| 115 | {
|
---|
| 116 |
|
---|
| 117 | return ComponentBase::CONFIGURED_OK;
|
---|
| 118 | }
|
---|
| 119 |
|
---|