source: pacpustutorials/template/component_template/ComponentTemplate.cpp

Last change on this file was 10, checked in by DHERBOMEZ Gérald, 9 years ago

update tutorials

File size: 3.5 KB
Line 
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
22using namespace pacpus;
23
24
25////////////////////////////////////////////////////////////////////////////////
26/// Construct the factory
27static ComponentFactory<ComponentTemplate> sFactory("ComponentTemplate");
28
29
30
31/************************************************************************/
32/* Constructor
33/************************************************************************/
34ComponentTemplate::ComponentTemplate(QString name)
35 : ComponentBase(name)
36{
37
38}
39
40
41/************************************************************************/
42/* Destructor
43/************************************************************************/
44ComponentTemplate::~ComponentTemplate()
45{
46
47}
48
49
50/************************************************************************/
51/* Start function, called by the ComponentManager when a start()
52/* command is received
53/************************************************************************/
54void ComponentTemplate::startActivity()
55{
56 // if you add an ouput, uncomment the line
57 // out1_ = getTypedOutput<int, ComponentTemplate>("value");
58}
59
60
61/************************************************************************/
62/* Stop function, called by the ComponentManager when a stop()
63/* command is received
64/************************************************************************/
65void ComponentTemplate::stopActivity()
66{
67
68}
69
70
71/************************************************************************/
72/* Called by the framework at initialization
73/************************************************************************/
74void ComponentTemplate::addInputs()
75{
76 // uncomment to add an input
77 // addInput<int, ComponentTemplate>("value", &ComponentTemplate::processInput);
78}
79
80
81/************************************************************************/
82/* Called by the framework at initialization
83/************************************************************************/
84void 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/************************************************************************/
114ComponentBase::COMPONENT_CONFIGURATION ComponentTemplate::configureComponent(XmlComponentConfig config)
115{
116
117 return ComponentBase::CONFIGURED_OK;
118}
119
Note: See TracBrowser for help on using the repository browser.