diff options
Diffstat (limited to 'src/uscxml/plugins/ioprocessor')
4 files changed, 46 insertions, 11 deletions
diff --git a/src/uscxml/plugins/ioprocessor/CMakeLists.txt b/src/uscxml/plugins/ioprocessor/CMakeLists.txt index 3505920..fb4315b 100644 --- a/src/uscxml/plugins/ioprocessor/CMakeLists.txt +++ b/src/uscxml/plugins/ioprocessor/CMakeLists.txt @@ -7,7 +7,18 @@ if (WITH_IOPROC_SCXML) scxml/*.cpp scxml/*.h ) - list (APPEND USCXML_FILES ${SCXML_IOPROCESSOR}) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${SCXML_IOPROCESSOR}) + add_library(ioproc_scxml SHARED ${SCXML_IOPROCESSOR} "../Plugins.cpp") + target_link_libraries(ioproc_scxml + uscxml + ) + set_target_properties(ioproc_scxml PROPERTIES FOLDER "Plugins//IO Processors") + set_target_properties(ioproc_scxml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(ioproc_scxml PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/plugins") + else() + list (APPEND USCXML_FILES ${SCXML_IOPROCESSOR}) + endif() endif() OPTION(WITH_IOPROC_BASICHTTP "Build the basichttp i/o processor" ON) @@ -17,8 +28,18 @@ if (WITH_IOPROC_BASICHTTP) basichttp/*.cpp basichttp/*.h ) - list (APPEND BASICHTTP_IOPROCESSOR "") - list (APPEND USCXML_FILES ${BASICHTTP_IOPROCESSOR}) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${BASICHTTP_IOPROCESSOR}) + add_library(ioproc_basichttp SHARED ${BASICHTTP_IOPROCESSOR} "../Plugins.cpp") + target_link_libraries(ioproc_basichttp + uscxml + ) + set_target_properties(ioproc_basichttp PROPERTIES FOLDER "Plugins//IO Processors") + set_target_properties(ioproc_basichttp PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(ioproc_basichttp PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/plugins") + else() + list (APPEND USCXML_FILES ${BASICHTTP_IOPROCESSOR}) + endif() endif() set(USCXML_INCLUDE_DIRS ${USCXML_INCLUDE_DIRS} PARENT_SCOPE) diff --git a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h index dec22fe..5ec66ec 100644 --- a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h +++ b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h @@ -20,6 +20,8 @@ #ifndef BASICHTTPIOPROCESSOR_H_2CUY93KU #define BASICHTTPIOPROCESSOR_H_2CUY93KU +#include "uscxml/config.h" + extern "C" { #include <event2/http.h> #include <event2/http_struct.h> @@ -93,11 +95,8 @@ protected: std::map<std::string, std::pair<URL, Event> > _sendRequests; }; -// do not implement pluma plugins if we build an inherited plugin -#ifdef ioprocessor_basichttp_EXPORTS -# ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(BasicHTTPIOProcessor, IOProcessorImpl); -# endif +#ifdef BUILD_AS_PLUGINS +PLUMA_INHERIT_PROVIDER(BasicHTTPIOProcessor, IOProcessorImpl) #endif } diff --git a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp index 5a82860..33a725e 100644 --- a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp @@ -30,8 +30,20 @@ #include <arpa/inet.h> #endif +#ifdef BUILD_AS_PLUGINS +#include <Pluma/Connector.hpp> +#endif + namespace uscxml { +#ifdef BUILD_AS_PLUGINS +PLUMA_CONNECTOR +bool pluginConnect(pluma::Host& host) { + host.add( new SCXMLIOProcessorProvider() ); + return true; +} +#endif + // see http://www.w3.org/TR/scxml/#SCXMLEventProcessor SCXMLIOProcessor::SCXMLIOProcessor() { diff --git a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h index 6494873..328e18e 100644 --- a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h +++ b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h @@ -20,8 +20,13 @@ #ifndef SCXMLIOProcessor_H_2CUY93KU #define SCXMLIOProcessor_H_2CUY93KU +#include "uscxml/config.h" #include "uscxml/plugins/IOProcessorImpl.h" +#ifdef BUILD_AS_PLUGINS +#include "uscxml/plugins/Plugins.h" +#endif + namespace uscxml { /** @@ -45,12 +50,10 @@ public: virtual bool isValidTarget(const std::string& target); Data getDataModelVariables(); -protected: - IOProcessorCallbacks* _callbacks; }; #ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(SCXMLIOProcessor, IOProcessorImpl); +PLUMA_INHERIT_PROVIDER(SCXMLIOProcessor, IOProcessorImpl) #endif } |