source: pacpussensors/trunk/ExampleComponent/ExampleComponent.cpp@ 24

Last change on this file since 24 was 14, checked in by Marek Kurdej, 11 years ago

ExampleComponent: added parameters, fixed Log include.

File size: 1.4 KB
Line 
1// %pacpus:license{
2// This file is part of the PACPUS framework distributed under the
3// CECILL-C License, Version 1.0.
4// %pacpus:license}
5
6#include "${<PROJECT_NAME>}.h"
7
8#include <kernel/Log.h>
9
10using namespace pacpus;
11using namespace std;
12
13DECLARE_STATIC_LOGGER("pacpus.base.${<PROJECT_NAME>}");
14
15/// Constructs a static component factory
16static ComponentFactory<${<PROJECT_NAME>}> sFactory("${<PROJECT_NAME>}");
17
18static const int kDefaultVerboseLevel = 1;
19
20//////////////////////////////////////////////////////////////////////////
21${<PROJECT_NAME>}::${<PROJECT_NAME>}(QString name)
22 : ComponentBase(name)
23{
24 LOG_TRACE("constructor(" << name << ")");
25}
26
27//////////////////////////////////////////////////////////////////////////
28${<PROJECT_NAME>}::~${<PROJECT_NAME>}()
29{
30 LOG_TRACE("destructor");
31}
32
33//////////////////////////////////////////////////////////////////////////
34void ${<PROJECT_NAME>}::startActivity()
35{
36}
37
38//////////////////////////////////////////////////////////////////////////
39void ${<PROJECT_NAME>}::stopActivity()
40{
41}
42
43//////////////////////////////////////////////////////////////////////////
44ComponentBase::COMPONENT_CONFIGURATION ${<PROJECT_NAME>}::configureComponent(XmlComponentConfig config)
45{
46 recording = config.getIntProperty("verbose", kDefaultVerboseLevel);
47 recording = config.getBoolProperty("recording");
48
49 return ComponentBase::CONFIGURED_OK;
50}
51
Note: See TracBrowser for help on using the repository browser.