2014-09-16 22:42:47 +03:00
|
|
|
#include "interface/module.h"
|
2014-09-16 23:14:04 +03:00
|
|
|
#include "interface/server.h"
|
2014-09-17 01:04:51 +03:00
|
|
|
#include "interface/event.h"
|
2014-09-16 23:57:31 +03:00
|
|
|
#include <iostream>
|
2014-09-16 22:42:47 +03:00
|
|
|
|
2014-09-17 01:04:51 +03:00
|
|
|
using interface::Event;
|
|
|
|
|
2014-09-16 23:14:04 +03:00
|
|
|
struct Module: public interface::Module
|
2014-09-16 22:42:47 +03:00
|
|
|
{
|
2014-09-16 23:14:04 +03:00
|
|
|
Module()
|
|
|
|
{
|
2014-09-16 23:57:31 +03:00
|
|
|
std::cout<<"test1 construct"<<std::endl;
|
2014-09-16 23:14:04 +03:00
|
|
|
}
|
2014-09-16 22:42:47 +03:00
|
|
|
|
2014-09-16 23:14:04 +03:00
|
|
|
~Module()
|
|
|
|
{
|
2014-09-16 23:57:31 +03:00
|
|
|
std::cout<<"test1 destruct"<<std::endl;
|
2014-09-16 23:14:04 +03:00
|
|
|
}
|
2014-09-16 22:42:47 +03:00
|
|
|
|
2014-09-17 01:04:51 +03:00
|
|
|
void event(const interface::Event &event)
|
2014-09-16 23:21:41 +03:00
|
|
|
{
|
2014-09-17 01:04:51 +03:00
|
|
|
switch(event.type){
|
|
|
|
case Event::Type::START:
|
|
|
|
start();
|
|
|
|
break;
|
|
|
|
}
|
2014-09-16 23:21:41 +03:00
|
|
|
}
|
|
|
|
|
2014-09-16 23:14:04 +03:00
|
|
|
int test_add(int a, int b)
|
|
|
|
{
|
|
|
|
return a + b;
|
|
|
|
}
|
2014-09-17 01:04:51 +03:00
|
|
|
|
|
|
|
void start()
|
|
|
|
{
|
|
|
|
}
|
2014-09-16 23:14:04 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
extern "C" {
|
2014-09-16 23:57:31 +03:00
|
|
|
EXPORT void* createModule_test1(interface::Server *server)
|
2014-09-16 22:42:47 +03:00
|
|
|
{
|
2014-09-16 23:14:04 +03:00
|
|
|
return (void*)(new Module());
|
|
|
|
}
|
2014-09-16 22:42:47 +03:00
|
|
|
}
|