Ceetron Data Provider Framework
CDPPlugin.h
1 //##################################################################################################
2 //
3 // Ceetron Data Provider Framework
4 //
5 // --------------------------------------------------------------------------------------------
6 // Copyright (C) 2018, Ceetron AS
7 //##################################################################################################
8 
9 #pragma once
10 
11 #include "CDPBaseTypes.h"
12 #include "CDPVersion.h"
13 
15 
16 #define CDP_RET_SUCCESS 1
17 #define CDP_RET_FAIL 0
18 
19 extern "C" {
20 
21 
23 typedef void (*CDP_DestroyProviderFactoryFunc)(CDPDataProviderFactory* objPtr);
24 
25 //==================================================================================================
30 //==================================================================================================
32 {
33  cdp_int_t pluginApiMajorVer;
34  cdp_int_t pluginApiMinorVer;
36  CDP_DestroyProviderFactoryFunc destroyProviderFactoryFunc;
37 };
38 
40 typedef int (*CDP_RegisterProviderFunc)(const char* providerIdString, const CDP_RegisterProviderParams* params);
41 
42 
43 
46 typedef void (*CDP_LogFunc)(int level, const char* message);
47 
48 
50 typedef void (*CDP_SetPluginInfoFunc)(const char* key, const char* value);
51 
52 
53 //==================================================================================================
60 //==================================================================================================
62 {
63  cdp_int_t pluginApiMajorVer;
64  cdp_int_t pluginApiMinorVer;
65  CDP_RegisterProviderFunc registerProviderFunc;
66  CDP_LogFunc logFunc;
67  CDP_SetPluginInfoFunc setPluginInfoFunc;
68 };
69 
70 
71 // Type definition of the plugin exit function pointer (used by the plugin manager to tell plugins to cleanup before being unloaded)
72 typedef void (*CDP_PluginExitFunc)();
73 
74 
80 typedef CDP_PluginExitFunc (*CDP_PluginInitFunc)(const CDP_FrameworkServices* frameworkServices);
81 
82 
83 
84 // Make sure that CDP_BUILD_PLUGIN_DLL is defined when building the plugin DLL.
85 #ifdef WIN32
86  #ifdef CDP_BUILD_PLUGIN_DLL
87  #define CDP_PLUGIN_EXPORT __declspec(dllexport)
88  #else
89  #define CDP_PLUGIN_EXPORT __declspec(dllimport)
90  #endif
91 #else
92  #define CDP_PLUGIN_EXPORT
93 #endif
94 
95 
100 extern "C" CDP_PLUGIN_EXPORT CDP_PluginExitFunc initializeDataProviderPlugin(const CDP_FrameworkServices* params);
101 
102 } // extern "C"
CDP_SetPluginInfoFunc setPluginInfoFunc
Function pointer for communicating plugin info.
Definition: CDPPlugin.h:67
cdp_int_t pluginApiMajorVer
Major version of the framework plugin API for which this plugin was written.
Definition: CDPPlugin.h:33
Definition: CDPPlugin.h:61
CDP_RegisterProviderFunc registerProviderFunc
Function for registering data providers.
Definition: CDPPlugin.h:65
Definition: CDPDataProviderFactory.h:42
cdp_int_t pluginApiMinorVer
Minor version of the framework plugin API for which this plugin was written.
Definition: CDPPlugin.h:34
CDP_LogFunc logFunc
Function pointer for log function.
Definition: CDPPlugin.h:66
Definition: CDPPlugin.h:31
cdp_int_t pluginApiMinorVer
Minor version of the framework plugin API.
Definition: CDPPlugin.h:64
cdp_int_t pluginApiMajorVer
Major version of the framework plugin API.
Definition: CDPPlugin.h:63
CDPDataProviderFactory * providerFactoryObj
Pointer to CDPDataProviderFactory object that allows creation/destruction of CDPDataProvider instance...
Definition: CDPPlugin.h:35
CDP_DestroyProviderFactoryFunc destroyProviderFactoryFunc
Pointer to function that should be used to delete providerFactoryObj.
Definition: CDPPlugin.h:36