| [126] | 1 | /*********************************************************************
|
|---|
| 2 | // created: 2016/05/13
|
|---|
| 3 | // filename: StringGenerator.h
|
|---|
| 4 | //
|
|---|
| 5 | // author: Gerald Dherbomez
|
|---|
| 6 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
|---|
| 7 | //
|
|---|
| 8 | // version: $Id: $
|
|---|
| 9 | //
|
|---|
| 10 | // purpose: A component that generates a string
|
|---|
| 11 | //
|
|---|
| 12 | *********************************************************************/
|
|---|
| 13 |
|
|---|
| 14 | #include "Pacpus/kernel/Log.h"
|
|---|
| 15 | #include "Pacpus/kernel/ComponentBase.h"
|
|---|
| 16 | #include "Pacpus/kernel/ComponentFactory.h"
|
|---|
| 17 |
|
|---|
| 18 | #include <QTimer>
|
|---|
| 19 |
|
|---|
| 20 | // Export macro for PacpusSocket DLL for Windows only
|
|---|
| 21 | #ifdef WIN32
|
|---|
| 22 | # ifdef PACPUSSOCKET_EXPORTS
|
|---|
| 23 | // make DLL
|
|---|
| 24 | # define PACPUSSOCKET_API __declspec(dllexport)
|
|---|
| 25 | # else
|
|---|
| 26 | // use DLL
|
|---|
| 27 | # define PACPUSSOCKET_API __declspec(dllimport)
|
|---|
| 28 | # endif
|
|---|
| 29 | #else
|
|---|
| 30 | // On other platforms, simply ignore this
|
|---|
| 31 | # define PACPUSSOCKET_API
|
|---|
| 32 | #endif
|
|---|
| 33 |
|
|---|
| 34 | namespace pacpus {
|
|---|
| 35 |
|
|---|
| 36 | class PACPUSSOCKET_API StringGenerator
|
|---|
| 37 | : public QObject
|
|---|
| 38 | , public ComponentBase
|
|---|
| 39 | {
|
|---|
| 40 | Q_OBJECT
|
|---|
| 41 |
|
|---|
| 42 | public:
|
|---|
| 43 | /// Constructor
|
|---|
| 44 | StringGenerator(QString name);
|
|---|
| 45 |
|
|---|
| 46 | /// Destructor
|
|---|
| 47 | ~StringGenerator();
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 | public Q_SLOTS:
|
|---|
| 51 | void sendData();
|
|---|
| 52 |
|
|---|
| 53 | Q_SIGNALS:
|
|---|
| 54 | void timeout();
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 | protected:
|
|---|
| 58 | // The 3 virtual methods relative to the ComponentBase inheritance
|
|---|
| 59 | virtual void startActivity();
|
|---|
| 60 | virtual void stopActivity();
|
|---|
| 61 | virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
|
|---|
| 62 |
|
|---|
| 63 | virtual void addInputs();
|
|---|
| 64 | virtual void addOutputs();
|
|---|
| 65 |
|
|---|
| 66 | private:
|
|---|
| 67 | OutputInterface<QString, StringGenerator>* stringOutput_;
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 | };
|
|---|
| 71 |
|
|---|
| 72 | } // namespace pacpus
|
|---|