mirror of
https://github.com/eclipse-openvehicle-api/openvehicle-api.git
synced 2026-02-05 15:18:45 +00:00
47 lines
994 B
C++
47 lines
994 B
C++
#include <iostream>
|
|
|
|
#include "example_interfaces.h"
|
|
#include <support/component_impl.h>
|
|
|
|
class CTestComponent
|
|
: public sdv::CSdvObject
|
|
, public ISayHello
|
|
, public ISayGoodbye
|
|
{
|
|
public:
|
|
CTestComponent()
|
|
{
|
|
std::cout << "Entering CTestComponent constructor..." << std::endl;
|
|
}
|
|
~CTestComponent() override
|
|
{
|
|
std::cout << "Entering CTestComponent destructor..." << std::endl;
|
|
}
|
|
|
|
BEGIN_SDV_INTERFACE_MAP()
|
|
SDV_INTERFACE_ENTRY(ISayHello)
|
|
SDV_INTERFACE_ENTRY(ISayGoodbye)
|
|
END_SDV_INTERFACE_MAP()
|
|
|
|
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::Device)
|
|
DECLARE_OBJECT_CLASS_NAME("Hello_Component")
|
|
|
|
/**
|
|
* @brief Show hello message, implements the function of ISayHello
|
|
*/
|
|
void SayHello() override
|
|
{
|
|
std::cout << "Hello from Hello_Component ..." << std::endl;
|
|
}
|
|
|
|
/**
|
|
* @brief Show hello message, implements the function of ISayGoodbye
|
|
*/
|
|
void SayGoodbye() override
|
|
{
|
|
std::cout << "Goodbye from Hello_Component ..." << std::endl;
|
|
}
|
|
};
|
|
|
|
DEFINE_SDV_OBJECT(CTestComponent)
|