LUMIERA.clone/tests/backend/example_plugin.cpp
Christian Thaeter 14a9e95492 moved plugin code from lib to backend
Plugin management will become stateful. This qualifies it to become a
backend subsystem.
2008-10-15 15:49:34 +02:00

61 lines
1.2 KiB
C++

#include <iostream>
#include "hello_interface.h"
class example_plugin
{
public:
static int myopen(void)
{
std::cout << "opened" << std::endl;
return 0;
}
static int myclose(void)
{
std::cout << "closed" << std::endl;
return 0;
}
};
class example_plugin_de
: public example_plugin
{
public:
static void hello(void)
{
std::cout << "Hallo Welt!" << std::endl;
}
static void bye(const char* m)
{
std::cout << "Tschuess " << m << std::endl;
}
};
class example_plugin_en
: public example_plugin
{
public:
static void hello(void)
{
std::cout << "Hello World!" << std::endl;
}
static void bye(const char* m)
{
std::cout << "Bye " << m << std::endl;
}
};
LUMIERA_INTERFACE_IMPLEMENT(hello, 1, german, example_plugin_de::myopen, example_plugin_de::myclose,
example_plugin_de::hello,
example_plugin_de::bye
);
LUMIERA_INTERFACE_IMPLEMENT(hello, 1, english, example_plugin_en::myopen, example_plugin_en::myclose,
example_plugin_en::hello,
example_plugin_en::bye
);