plugin  0.1.0
Macros | Typedefs | Enumerations
common.hpp File Reference

Common definitions for the pugg library. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define INSTALL_SOURCE_DRIVER(klass, type)
 Call this macro after defining a source class to install it into the kernel. More...
 
#define INSTALL_FILTER_DRIVER(klass, type_in, type_out)
 Call this macro after defining a filter class to install it into the kernel. More...
 

Typedefs

typedef float data_t
 

Enumerations

enum class  return_type { success = 0 , warning , error , critical }
 The return type of common interface functions.
 

Detailed Description

Common definitions for the pugg library.

Macro Definition Documentation

◆ INSTALL_FILTER_DRIVER

#define INSTALL_FILTER_DRIVER (   klass,
  type_in,
  type_out 
)
Value:
class klass##Driver : public FilterDriver<type_in, type_out> { \
public: \
klass##Driver() : FilterDriver(PLUGIN_NAME, klass::version) {} \
Filter<type_in, type_out> *create() { return new klass(); } \
}; \
extern "C" EXPORTIT void register_pugg_plugin(pugg::Kernel *kernel) { \
kernel->add_driver(new klass##Driver()); \
}

Call this macro after defining a filter class to install it into the kernel.

Parameters
klassthe class name
type_inthe input type of the filter
type_outthe output type of the filter

◆ INSTALL_SOURCE_DRIVER

#define INSTALL_SOURCE_DRIVER (   klass,
  type 
)
Value:
class klass##Driver : public SourceDriver<type> { \
public: \
klass##Driver() : SourceDriver(PLUGIN_NAME, klass::version) {} \
Source<type> *create() { return new klass(); } \
}; \
extern "C" EXPORTIT void register_pugg_plugin(pugg::Kernel *kernel) { \
kernel->add_driver(new klass##Driver()); \
}

Call this macro after defining a source class to install it into the kernel.

Install a source driver into the kernel.

Parameters
klassthe class name
typethe type of the source