mirror of https://github.com/sipwise/sems.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
801 B
48 lines
801 B
#ifndef AmEvent_h
|
|
#define AmEvent_h
|
|
|
|
#include "AmArg.h"
|
|
|
|
#include <string>
|
|
using std::string;
|
|
|
|
#define E_PLUGIN 100
|
|
|
|
/** \brief base event class */
|
|
struct AmEvent
|
|
{
|
|
int event_id;
|
|
bool processed;
|
|
|
|
AmEvent(int event_id);
|
|
virtual ~AmEvent();
|
|
};
|
|
|
|
/**
|
|
* \brief named event for inter-plugin-API
|
|
*
|
|
* Optionally the AmPluginEvent also holds a dynamic argument array.
|
|
*/
|
|
struct AmPluginEvent: public AmEvent
|
|
{
|
|
string name;
|
|
AmArgArray data;
|
|
|
|
AmPluginEvent(const string& n)
|
|
: AmEvent(E_PLUGIN), name(n), data() {}
|
|
|
|
AmPluginEvent(const string& n, const AmArgArray& d)
|
|
: AmEvent(E_PLUGIN), name(n), data(d) {}
|
|
};
|
|
|
|
|
|
/** \brief event handler interface */
|
|
class AmEventHandler
|
|
{
|
|
public:
|
|
virtual void process(AmEvent*)=0;
|
|
virtual ~AmEventHandler() { };
|
|
};
|
|
|
|
#endif
|