From b7771e1cf8b5b0c4d4998a74a8ba3a25ccb4300f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Tue, 15 Sep 2026 13:11:44 +0200 Subject: [PATCH 01/14] feat(CodeGeneration): add CodeGeneration library from macchina.io #5447 Flat import of platform/CodeGeneration from macchina.io (state of 2026-09-09); the Applied Informatics changes since the common base follow as separate commits. Co-Authored-By: Aleksandar Fabijanic Co-Authored-By: Matej Kenda --- CodeGeneration/CMakeLists.txt | 37 + CodeGeneration/Makefile | 17 + .../cmake/PocoCodeGenerationConfig.cmake | 4 + .../Poco/CodeGeneration/CodeGeneration.h | 60 ++ .../Poco/CodeGeneration/CodeGenerator.h | 217 +++++ .../Poco/CodeGeneration/CppGenerator.h | 189 +++++ .../Poco/CodeGeneration/GeneratorEngine.h | 221 +++++ .../CodeGeneration/MethodPropertyFilter.h | 275 ++++++ .../include/Poco/CodeGeneration/Utility.h | 204 +++++ CodeGeneration/src/CodeGenerator.cpp | 88 ++ CodeGeneration/src/CppGenerator.cpp | 780 ++++++++++++++++++ CodeGeneration/src/GeneratorEngine.cpp | 450 ++++++++++ CodeGeneration/src/MethodPropertyFilter.cpp | 95 +++ CodeGeneration/src/Utility.cpp | 599 ++++++++++++++ CodeGeneration/testsuite/CMakeLists.txt | 28 + CodeGeneration/testsuite/Makefile | 16 + .../testsuite/src/CodeGenerationTest.cpp | 82 ++ .../testsuite/src/CodeGenerationTest.h | 40 + .../testsuite/src/CodeGenerationTestSuite.cpp | 22 + .../testsuite/src/CodeGenerationTestSuite.h | 29 + CodeGeneration/testsuite/src/Driver.cpp | 17 + CodeGeneration/testsuite/src/WinDriver.cpp | 28 + 22 files changed, 3498 insertions(+) create mode 100644 CodeGeneration/CMakeLists.txt create mode 100644 CodeGeneration/Makefile create mode 100644 CodeGeneration/cmake/PocoCodeGenerationConfig.cmake create mode 100644 CodeGeneration/include/Poco/CodeGeneration/CodeGeneration.h create mode 100644 CodeGeneration/include/Poco/CodeGeneration/CodeGenerator.h create mode 100644 CodeGeneration/include/Poco/CodeGeneration/CppGenerator.h create mode 100644 CodeGeneration/include/Poco/CodeGeneration/GeneratorEngine.h create mode 100644 CodeGeneration/include/Poco/CodeGeneration/MethodPropertyFilter.h create mode 100644 CodeGeneration/include/Poco/CodeGeneration/Utility.h create mode 100644 CodeGeneration/src/CodeGenerator.cpp create mode 100644 CodeGeneration/src/CppGenerator.cpp create mode 100644 CodeGeneration/src/GeneratorEngine.cpp create mode 100644 CodeGeneration/src/MethodPropertyFilter.cpp create mode 100644 CodeGeneration/src/Utility.cpp create mode 100644 CodeGeneration/testsuite/CMakeLists.txt create mode 100644 CodeGeneration/testsuite/Makefile create mode 100644 CodeGeneration/testsuite/src/CodeGenerationTest.cpp create mode 100644 CodeGeneration/testsuite/src/CodeGenerationTest.h create mode 100644 CodeGeneration/testsuite/src/CodeGenerationTestSuite.cpp create mode 100644 CodeGeneration/testsuite/src/CodeGenerationTestSuite.h create mode 100644 CodeGeneration/testsuite/src/Driver.cpp create mode 100644 CodeGeneration/testsuite/src/WinDriver.cpp diff --git a/CodeGeneration/CMakeLists.txt b/CodeGeneration/CMakeLists.txt new file mode 100644 index 0000000000..60541f6381 --- /dev/null +++ b/CodeGeneration/CMakeLists.txt @@ -0,0 +1,37 @@ +# Sources +file(GLOB SRCS_G "src/*.cpp") +POCO_SOURCES_AUTO(SRCS ${SRCS_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "include/*.h") +POCO_HEADERS_AUTO(SRCS ${HDRS_G}) + +# Version Resource +if(MSVC AND BUILD_SHARED_LIBS) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) +endif() + +add_library(CodeGeneration ${SRCS}) +add_library(Poco::CodeGeneration ALIAS CodeGeneration) +set_target_properties(CodeGeneration + PROPERTIES + VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} + OUTPUT_NAME PocoCodeGeneration + DEFINE_SYMBOL CodeGeneration_EXPORTS +) + +target_link_libraries(CodeGeneration PUBLIC Poco::CppParser Poco::Foundation) +target_include_directories(CodeGeneration + PUBLIC + $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src +) + +POCO_INSTALL(CodeGeneration) +POCO_GENERATE_PACKAGE(CodeGeneration) + +if(ENABLE_TESTS) + add_subdirectory(testsuite) +endif() diff --git a/CodeGeneration/Makefile b/CodeGeneration/Makefile new file mode 100644 index 0000000000..aa18fba6e3 --- /dev/null +++ b/CodeGeneration/Makefile @@ -0,0 +1,17 @@ +# +# Makefile +# +# Makefile for Poco CodeGeneration +# + +include $(POCO_BASE)/build/rules/global + +SHAREDOPT_CXX += -DCodeGeneration_EXPORTS + +objects = CodeGenerator CppGenerator GeneratorEngine MethodPropertyFilter Utility + +target = PocoCodeGeneration +target_version = $(LIBVERSION) +target_libs = PocoCppParser PocoFoundation + +include $(POCO_BASE)/build/rules/lib diff --git a/CodeGeneration/cmake/PocoCodeGenerationConfig.cmake b/CodeGeneration/cmake/PocoCodeGenerationConfig.cmake new file mode 100644 index 0000000000..3922bd951d --- /dev/null +++ b/CodeGeneration/cmake/PocoCodeGenerationConfig.cmake @@ -0,0 +1,4 @@ +include(CMakeFindDependencyMacro) +find_dependency(PocoFoundation) +find_dependency(PocoCppParser) +include("${CMAKE_CURRENT_LIST_DIR}/PocoCodeGenerationTargets.cmake") diff --git a/CodeGeneration/include/Poco/CodeGeneration/CodeGeneration.h b/CodeGeneration/include/Poco/CodeGeneration/CodeGeneration.h new file mode 100644 index 0000000000..2a585abade --- /dev/null +++ b/CodeGeneration/include/Poco/CodeGeneration/CodeGeneration.h @@ -0,0 +1,60 @@ +// +// CodeGeneration.h +// +// Library: CodeGeneration +// Package: CodeGeneration +// Module: CodeGeneration +// +// Basic definitions for the Poco CodeGeneration library. +// This file must be the first file included by every other CodeGeneration +// header file. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef CodeGeneration_CodeGeneration_INCLUDED +#define CodeGeneration_CodeGeneration_INCLUDED + + +#ifndef Foundation_Foundation_INCLUDED +#include "Poco/Foundation.h" +#endif + + +// +// The following block is the standard way of creating macros which make exporting +// from a DLL simpler. All files within this DLL are compiled with the CodeGeneration_EXPORTS +// symbol defined on the command line. This symbol should not be defined on any project +// that uses this DLL. This way any other project whose source files include this file sees +// CodeGeneration_API functions as being imported from a DLL, whereas this DLL sees symbols +// defined with this macro as being exported. +// +#if defined(_WIN32) && defined(POCO_DLL) + #if defined(CodeGeneration_EXPORTS) + #define CodeGeneration_API __declspec(dllexport) + #else + #define CodeGeneration_API __declspec(dllimport) + #endif +#endif + + +#if !defined(CodeGeneration_API) + #define CodeGeneration_API +#endif + + +// +// Automatically link CodeGeneration library. +// +#if defined(_MSC_VER) + #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(CodeGeneration_EXPORTS) + #pragma comment(lib, "PocoCodeGeneration" POCO_LIB_SUFFIX) + #endif +#endif + + +#endif // CodeGeneration_CodeGeneration_INCLUDED diff --git a/CodeGeneration/include/Poco/CodeGeneration/CodeGenerator.h b/CodeGeneration/include/Poco/CodeGeneration/CodeGenerator.h new file mode 100644 index 0000000000..48754a691f --- /dev/null +++ b/CodeGeneration/include/Poco/CodeGeneration/CodeGenerator.h @@ -0,0 +1,217 @@ +// +// CodeGenerator.h +// +// Library: CodeGeneration +// Package: CodeGeneration +// Module: CodeGenerator +// +// Definition of the CodeGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef CodeGeneration_CodeGenerator_INCLUDED +#define CodeGeneration_CodeGenerator_INCLUDED + + +#include "Poco/CodeGeneration/CodeGeneration.h" +#include "Poco/CppParser/Struct.h" +#include "Poco/CppParser/Variable.h" +#include "Poco/CppParser/TypeDef.h" +#include +#include + + +namespace Poco { +namespace CodeGeneration { + + +class CodeGeneration_API CodeGenerator + /// A CodeGenerator defines an interface for code generators. +{ +public: + struct FwdDecl + { + std::string includeFile; + std::string className; + std::string fullNameSpace; + FwdDecl(const std::string& inc, const std::string& cN, const std::string& ns); + bool operator<(const FwdDecl& other) const; + /// Must guarantee that the primary order is by namespace, then by class + }; + + typedef std::set IncludeSet; + typedef std::map Properties; + /// Maps a property name to its value. + typedef std::set FwdDecls; + + CodeGenerator(const std::string& nameSpace, const std::string& libraryName, bool usePocoIncludeStyle, const std::string& copyright); + /// Creates the CodeGenerator. The nameSpace declares in which nameSpace the generated class will be, + /// the library name contaisn the name of the project + + virtual ~CodeGenerator(); + /// Destroys the CodeGenerator. + + virtual void addIncludeFile(const std::string& incFile); + /// Adds an include file to the CodeGenerator. A call to this method is only meaningful until structStart was not called. + /// Duplicate includes will be ignored. Contains the include path only, e.g. "include/MyClass.h" (without enclosing ") + + virtual void addSrcIncludeFile(const std::string& incFile); + /// Include file which will be written to an implementation file. + + virtual void addSystemIncludeFile(const std::string& incFile); + /// Adds a system include file + + virtual void addFwdDecl(const std::string& inclFile, const std::string& className, const std::string namespacePrefix); + /// Adds a fwd decl. + + virtual void writeIncludes(); + /// Convenience Functions which calls for all include files writeInclude, also writes fwdDecls. + + virtual void writeDefaultHeader(const Poco::CppParser::Struct* pStruct, const std::string& className, const std::string& libraryName, const std::string& package) = 0; + /// Writes the default header, e.g. copyright notice, no include namespace open or anything else is written + /// This is always the first method that is called! + + virtual void endFile() = 0; + /// Closes the file. + + virtual void writeInclude(const std::string& include, bool toHeader) = 0; + /// Writes the include either to the header or the src file. + + virtual void writeSystemInclude(const std::string& include) = 0; + /// Writes the system include file to the header. + + virtual void writeNameSpaceBegin(const std::string& fullNameSpace) = 0; + /// Writes the enclosing namespace + + virtual void writeFwdDecls(const FwdDecls& decl) = 0; + /// Writes the fwd decl to the header file and the include file to the src file. + + virtual void writeNameSpaceEnd(const std::string& fullNameSpace) = 0; + /// Closes the namespace + + virtual void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) = 0; + /// Writes the class declaration. + + virtual void structEnd() = 0; + /// Closes the class declaration. + + virtual void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties) = 0; + /// Writes the method header. Properties contains the properties found in the functions docuementation and in the class documentation. + + virtual void writeMethodImplementation(const std::string& code) = 0; + /// Only valid when inside a method. Simply forwards the code lines to the implementation file. + + virtual void writeImplementation(const std::string& code) = 0; + /// Writes other non-method code. + + virtual void methodEnd(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties) = 0; + /// Closes the method. + + virtual void variablesStart() = 0; + /// Indicates that variables wil be written. + + virtual void variable(const Poco::CppParser::Variable* pVar) = 0; + /// Writes a single variable. + + virtual void writeTypeDef(const Poco::CppParser::TypeDef* pType) = 0; + /// Writes a single typedef + + virtual void writeUsing(const Poco::CppParser::TypeAlias* pType) = 0; + /// Writes a single using + + virtual void variablesEnd() = 0; + /// Ends variable definitions. + + virtual const CodeGenerator::IncludeSet& includes() const; + /// Returns all includes that the CodeGenerator consists of. + + virtual const CodeGenerator::IncludeSet& systemIncludes() const; + /// Returns all system includes that the CodeGenerator consists of. + + virtual const std::string& nameSpace() const; + /// The namespace of the file + + virtual const std::string& libraryName() const; + /// The prefix assigned to the namespace. + + virtual bool usePocoIncludeStyle() const; + /// Returns which include style should be used + + virtual const std::string& copyright() const; + /// Returns the copyright notice, can be empty. + +private: + std::string _nameSpace; + std::string _libraryName; + bool _usePocoIncludeStyle; + std::string _copyright; + IncludeSet _includes; + IncludeSet _systemIncludes; + IncludeSet _srcIncludes; + FwdDecls _fwdDecls; +}; + + +inline void CodeGenerator::addIncludeFile(const std::string& incFile) +{ + _includes.insert(incFile); +} + + +inline void CodeGenerator::addSrcIncludeFile(const std::string& incFile) +{ + _srcIncludes.insert(incFile); +} + + +inline void CodeGenerator::addSystemIncludeFile(const std::string& incFile) +{ + _systemIncludes.insert(incFile); +} + + +inline const CodeGenerator::IncludeSet& CodeGenerator::includes() const +{ + return _includes; +} + + +inline const CodeGenerator::IncludeSet& CodeGenerator::systemIncludes() const +{ + return _systemIncludes; +} + + +inline const std::string& CodeGenerator::nameSpace() const +{ + return _nameSpace; +} + + +inline const std::string& CodeGenerator::libraryName() const +{ + return _libraryName; +} + + +inline bool CodeGenerator::usePocoIncludeStyle() const +{ + return _usePocoIncludeStyle; +} + + +inline const std::string& CodeGenerator::copyright() const +{ + return _copyright; +} + + +} } // namespace Poco::CodeGeneration + + +#endif // CodeGeneration_CodeGenerator_INCLUDED diff --git a/CodeGeneration/include/Poco/CodeGeneration/CppGenerator.h b/CodeGeneration/include/Poco/CodeGeneration/CppGenerator.h new file mode 100644 index 0000000000..a4b41974ba --- /dev/null +++ b/CodeGeneration/include/Poco/CodeGeneration/CppGenerator.h @@ -0,0 +1,189 @@ +// +// CppGenerator.h +// +// Library: CodeGeneration +// Package: CodeGeneration +// Module: CppGenerator +// +// Definition of the CppGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef CodeGeneration_CppGenerator_INCLUDED +#define CodeGeneration_CppGenerator_INCLUDED + + +#include "Poco/CodeGeneration/CodeGeneration.h" +#include "Poco/CodeGeneration/CodeGenerator.h" +#include "Poco/CppParser/Parameter.h" +#include + + +namespace Poco { +namespace CodeGeneration { + + +class CodeGeneration_API CppGenerator: public CodeGenerator + /// Cpp implementation of the code generator +{ +public: + CppGenerator(const std::string& nameSpace, const std::string& libraryName, bool usePocoIncludeStyle, const std::string& copyright, std::ostream& hOut, std::ostream& cppOut); + /// Creates the CppGenerator. + + ~CppGenerator(); + /// Destroys the CppGenerator. + + void enableAttributes(bool enable = true); + /// Enable or disable (default) writing of attributes. + + void enableTimestamps(bool enable = true); + /// Enable (default) or disable timestamps in file headers. + + void registerConstructorHint(const Poco::CppParser::Variable* pVar, const Poco::CppParser::Parameter* pParam); + /// Register a hint which tells us which parameter of the constructor should be used to init + /// a given member variable + + void registerConstructorHint(const Poco::CppParser::Variable* pVar, const std::string& val); + /// Register a hint which tells us which constant value should be used to init + /// a given member variable. + + void writeDefaultHeader(const Poco::CppParser::Struct* pStruct, const std::string& className, const std::string& libraryName, const std::string& package); + /// Writes the default header, plus include guard + + void endFile(); + /// Closes the include guard + + void writeInclude(const std::string& include, bool toHeader); + + void writeSrcInclude(const std::string& include); + + void writeSystemInclude(const std::string& include); + + void writeNameSpaceBegin(const std::string& fullNameSpace); + + void writeFwdDecls(const CodeGenerator::FwdDecls& decl); + + void writeNameSpaceEnd(const std::string& fullNameSpace); + + void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + + void structEnd(); + + void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + + void writeMethodImplementation(const std::string& code); + + void writeImplementation(const std::string& code); + + void methodEnd(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + + void variablesStart(); + + void variable(const Poco::CppParser::Variable* pVar); + + void variablesEnd(); + + void writeTypeDef(const Poco::CppParser::TypeDef* pType); + + void writeUsing(const Poco::CppParser::TypeAlias* pType); + + void writeToHeader(const std::string& jsCode); + +private: + void writeNameSpaceBegin(const std::string& fullNameSpace, bool toHeaderOnly); + + void writeNameSpaceEnd(const std::string& fullNameSpace, bool toHeaderOnly); + + void writeParameter(const Poco::CppParser::Parameter* pParam); + ///Writes parameters to h and cpp file + + void writeParameter(const Poco::CppParser::Parameter* pParam, bool inHFile, std::ostream& out); + ///Writes a single parameter to h and cpp file + + void handleAccessChange(Poco::CppParser::Symbol::Access newAcc); + /// Handles access change in h file. + + void handleMemberInitInConstructor(const Poco::CppParser::Function* pFunc, std::ostream& out); + /// Magically initializes the member variables with the correct constructor parameter. + + void writeMethodStartCpp(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties, std::ostream& out); + /// Writes method implementation header to the defined output stream. + + void writeMethodStartH(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Writes method implementation header to the h file. + + void writeFunctionHeader(const Poco::CppParser::Function* pFunc, bool inHFile, std::ostream& out, const std::string& className=std::string()); + /// Writes the function header. If a className is specified, the function is written qualified. + + void writeMethodStartTemplate(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Writes method templates. + + void writeMethodImplementationImpl(const std::string& code, std::ostream& out); + /// Implementation of writeMethodImplementation. + + void methodEndImpl(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties, std::ostream& out); + /// Cloes the method. + + const Poco::CppParser::Parameter* findParameter(const Poco::CppParser::Function* pFunc, const std::string& paramName); + /// Finds the parameter in the function or returns 0. + + bool findMatchingDecl(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Parameter* pParam); + /// Matches fucntion declaration to a parameter declaration. Returns true on success, + +private: + typedef std::map ConstructorMapping; + typedef std::map SimpleConstructorMapping; + + struct InlineFunctionInfo + { + const Poco::CppParser::Function* pFunc; + CodeGenerator::Properties props; + std::vector codeLines; + }; + + ///Defines if include paths are formatted poco style. + std::ostream& _hOut; + std::ostream& _cppOut; + std::string _className; + bool _inInlineFct; + bool _isTemplate; + bool _inPureVirtualFct; + Poco::CppParser::Symbol::Access _lastAcc; + const Poco::CppParser::Struct* _pStruct; + const Poco::CppParser::Function* _pFunc; + std::vector _inlineFunctions; + ConstructorMapping _constrMapping; + SimpleConstructorMapping _simpleConstrMapping; + std::string _includeGuard; + bool _attributesEnabled; + bool _timestampsEnabled; +}; + + +inline void CppGenerator::registerConstructorHint(const Poco::CppParser::Variable* pVar, const Poco::CppParser::Parameter* pParam) +{ + _constrMapping.insert(std::make_pair (pVar, pParam)); +} + + +inline void CppGenerator::registerConstructorHint(const Poco::CppParser::Variable* pVar, const std::string& val) +{ + _simpleConstrMapping.insert(std::make_pair (pVar, val)); +} + + +inline void CppGenerator::writeToHeader(const std::string& jsCode) +{ + _hOut << jsCode << std::endl; +} + + +} } // namespace Poco::CodeGeneration + + +#endif // CodeGeneration_CppGenerator_INCLUDED diff --git a/CodeGeneration/include/Poco/CodeGeneration/GeneratorEngine.h b/CodeGeneration/include/Poco/CodeGeneration/GeneratorEngine.h new file mode 100644 index 0000000000..f8d3a0f390 --- /dev/null +++ b/CodeGeneration/include/Poco/CodeGeneration/GeneratorEngine.h @@ -0,0 +1,221 @@ +// +// GeneratorEngine.h +// +// Library: CodeGeneration +// Package: CodeGeneration +// Module: GeneratorEngine +// +// Definition of the GeneratorEngine class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef CodeGeneration_GeneratorEngine_INCLUDED +#define CodeGeneration_GeneratorEngine_INCLUDED + + +#include "Poco/CodeGeneration/CodeGeneration.h" +#include "Poco/CodeGeneration/CodeGenerator.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Struct.h" +#include + + +namespace Poco { +namespace CodeGeneration { + + +class CodeGenerator; + + +class CodeGeneration_API GeneratorEngine + /// A GeneratorEngine iterates over a Struct and calls the correct methods in a CodeGenerator. +{ +public: + typedef void (*MethodGenerator)(const Poco::CppParser::Function*, const Poco::CppParser::Struct*, CodeGenerator&, void* param); + typedef std::map Callbacks; + + GeneratorEngine(); + /// Creates the GeneratorEngine. + + ~GeneratorEngine(); + /// Destroys the GeneratorEngine. + + void registerDefaultCallback(MethodGenerator funcGen); + /// Registers a default callback, invoked always when no callback is found for a given methodname + + void unregisterDefaultCallback(); + /// Unregisters the default callback. + + void registerPreClassCallback(MethodGenerator funcGen); + /// Allows to register a code generator that will write code to the implementation file + /// before the first constructor is written. Useful to initialize static members. + /// With templates the code will be written right after namespace_begin. + + void registerPostClassCallback(MethodGenerator funcGen); + /// Allows to register a code generator that will write code to the implementation file + /// after the last method was written. Useful to initialize static members. + + void unregisterPreClassCallback(); + /// Unregisters the pre class callback. + + void unregisterPostClassCallback(); + /// Unregisters the post class callback. + + void registerPreNameSpaceCallback(MethodGenerator funcGen); + /// Allows to register a code generator that will write code to the implementation file + /// before the namespace is opened. + + void registerPostNameSpaceCallback(MethodGenerator funcGen); + /// Allows to register a code generator that will write code to the implementation file + /// after the namespace was closed. + + void unregisterPreNameSpaceCallback(); + /// Unregisters the pre namespace callback. + + void unregisterPostNameSpaceCallback(); + /// Unregisters the post namespace callback. + + void registerCallback(const std::string& methodName, MethodGenerator funcGen); + /// Registers a callback for a method name iff no other callback is registered yet. Throws an exception in the latter case. + + void unregisterCallback(const std::string& methodName); + /// Unregisters a callback. + + void generate(const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam = 0, bool isFirstClass = true, bool isLastClass = true); + /// Generates code for the given struct using the given CodeGenerator, addParam can be used to provide a pointer to additional information, required for the + /// registered callbacks. If isFirstClass is true, the copyright header and the namespace begin is written, if isLastClass is true + /// the namespace is closed. + + static void handleIncludeFile(const Poco::CppParser::Struct* pStruct, const std::string& classDecl, const std::string& defaultLibrary, CodeGenerator& gen); + /// Checks first the file in pStruct, then regenerates the include based on the classDecl + + static void handleIncludes(const Poco::CppParser::Struct* pStruct, CodeGenerator& gen); + /// Detects and handles all includes. + + static void emptyCodeGen(const Poco::CppParser::Function*, const Poco::CppParser::Struct*, CodeGenerator&, void* param); + // Empty code generator used for functions. + + static void parseProperties(const Poco::CppParser::Symbol* pSym, CodeGenerator::Properties& props); + /// Parses and adds properties in lower case to props. + + static void parseElementProperties(const std::string& elemVal, CodeGenerator::Properties& props); + /// Parses and adds element properties in lower case to props. Element properties are properties defined + /// for single parameters or variables + + static bool getStringProperty(const CodeGenerator::Properties& props, const std::string& propName, std::string& value); + /// Returns true if it finds for the given property name the attrValue, writes the found value to parameter value. + + static bool getBoolProperty(const CodeGenerator::Properties& props, const std::string& propName, bool& value); + /// Returns true if it finds for the given property name the attrValue, writes the found value to parameter value. + + static bool getUInt32Property(const CodeGenerator::Properties& props, const std::string& propName, Poco::UInt32& value); + /// Returns true if it finds for the given property name the attrValue, writes the found value to parameter value. + +private: + static void parseKeyValue(const std::string& keyValue, CodeGenerator::Properties& props); + /// Parses a key = value pair + + void handleFunctions(const Poco::CppParser::Struct::Functions& functions, const Poco::CppParser::Struct* pStruct, void* addparam, const CodeGenerator::Properties& classProperties, CodeGenerator& gen); + /// Iterates over all functions and writes them. + + void handleFunction(const Poco::CppParser::Function* pFunction, const Poco::CppParser::Struct* pStruct, void* addparam, const CodeGenerator::Properties& methodProperties, CodeGenerator& gen); + /// Generates a single method. + + void handleTypedefs(const Poco::CppParser::NameSpace::SymbolTable& typedefs, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen); + /// Iterates over all functions and writes them. + + void handleUsings(const Poco::CppParser::NameSpace::SymbolTable& typedefs, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen); + /// Iterates over all functions and writes them. + + static void handleSystemInclude(const std::string& typeDecl, CodeGenerator& gen); + /// Handle system includes for a given type. + + static void skipWhiteSpace(const std::string& str, std::size_t& startPos); + static std::string parseToken(const std::string& str, std::size_t& beginPos); + static bool isWhiteSpace(const char c); + +private: + Callbacks _callbacks; + static const std::string WILDCARD; + static const std::string PRECLASS; + static const std::string POSTCLASS; + static const std::string PRENAMESPACE; + static const std::string POSTNAMESPACE; +}; + + +inline void GeneratorEngine::registerDefaultCallback(MethodGenerator funcGen) +{ + registerCallback(GeneratorEngine::WILDCARD, funcGen); +} + + +inline void GeneratorEngine::unregisterDefaultCallback() +{ + unregisterCallback(GeneratorEngine::WILDCARD); +} + + +inline void GeneratorEngine::registerPreClassCallback(MethodGenerator funcGen) +{ + registerCallback(GeneratorEngine::PRECLASS, funcGen); +} + + +inline void GeneratorEngine::registerPostClassCallback(MethodGenerator funcGen) +{ + registerCallback(GeneratorEngine::POSTCLASS, funcGen); +} + + +inline void GeneratorEngine::unregisterPreClassCallback() +{ + unregisterCallback(GeneratorEngine::PRECLASS); +} + + +inline void GeneratorEngine::unregisterPostClassCallback() +{ + unregisterCallback(GeneratorEngine::POSTCLASS); +} + + +inline void GeneratorEngine::registerPreNameSpaceCallback(MethodGenerator funcGen) +{ + registerCallback(GeneratorEngine::PRENAMESPACE, funcGen); +} + + +inline void GeneratorEngine::registerPostNameSpaceCallback(MethodGenerator funcGen) +{ + registerCallback(GeneratorEngine::POSTNAMESPACE, funcGen); +} + + +inline void GeneratorEngine::unregisterPreNameSpaceCallback() +{ + unregisterCallback(GeneratorEngine::PRENAMESPACE); +} + + +inline void GeneratorEngine::unregisterPostNameSpaceCallback() +{ + unregisterCallback(GeneratorEngine::POSTNAMESPACE); +} + + +inline void GeneratorEngine::unregisterCallback(const std::string& methodName) +{ + _callbacks.erase(methodName); +} + + +} } // namespace Poco::CodeGeneration + + +#endif // CodeGeneration_GeneratorEngine_INCLUDED diff --git a/CodeGeneration/include/Poco/CodeGeneration/MethodPropertyFilter.h b/CodeGeneration/include/Poco/CodeGeneration/MethodPropertyFilter.h new file mode 100644 index 0000000000..afc8e427a5 --- /dev/null +++ b/CodeGeneration/include/Poco/CodeGeneration/MethodPropertyFilter.h @@ -0,0 +1,275 @@ +// +// MethodPropertyFilter.h +// +// Library: CodeGeneration +// Package: CodeGeneration +// Module: MethodPropertyFilter +// +// Definition of the MethodPropertyFilter class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef CodeGeneration_MethodPropertyFilter_INCLUDED +#define CodeGeneration_MethodPropertyFilter_INCLUDED + + +#include "Poco/CodeGeneration/CodeGeneration.h" +#include "Poco/CodeGeneration/CodeGenerator.h" + + +namespace Poco { +namespace CodeGeneration { + + +class CodeGeneration_API MethodPropertyFilter: public CodeGenerator + /// A MethodPropertyFilter filters methods according to properties. It works as a decorator, + /// checking if a property is set at the method. If not it will simply ignore all method calls + /// related to that method. It will not filter variables, includes, only methods excl. constructor and destructor + /// are checked. +{ +public: + MethodPropertyFilter(CodeGenerator* pGen, const CodeGenerator::Properties& properties); + /// Creates a MethodPropertyFilter decorating another CodeGenerator. Takes ownership of the pointer which must not be 0. + /// properties contains the properties that each method must match to be generated. + + MethodPropertyFilter(CodeGenerator* pGen, const std::string& prop); + /// Creates a MethodPropertyFilter decorating another CodeGenerator. Takes ownership of the pointer which must not be 0. + /// Convenience constructor which takes exactly one property. + + ~MethodPropertyFilter(); + /// Destroys the MethodPropertyFilter. + + void addIncludeFile(const std::string& incFile); + /// Adds an include file to the CodeGenerator. A call to this method is only meaningful until structStart was not called. + /// Duplicate includes will be ignored. Contains the include path only, e.g. "include/MyClass.h" (without enclosing ") + + void addSystemIncludeFile(const std::string& incFile); + /// Adds a system include file. + + void addFwdDecl(const std::string& inclFile, const std::string& className, const std::string namespacePrefix); + /// Adds a fwd decl. + + void writeIncludes(); + /// Convenience Functions which calls for all include files writeInclude, also writes fwdDecls. + + void writeDefaultHeader(const Poco::CppParser::Struct* pStruct, const std::string& className, const std::string& libraryName, const std::string& package); + /// Writes the default header, e.g. copyright notice, no include namespace open or anything else is written + /// This is always the first method that is called! + + void writeInclude(const std::string& include, bool toHeader); + + void writeSystemInclude(const std::string& include); + + void writeNameSpaceBegin(const std::string& ns); + + void writeFwdDecls(const CodeGenerator::FwdDecls& decl); + + void writeNameSpaceEnd(const std::string& ns); + + void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + + void structEnd(); + + void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + + void writeMethodImplementation(const std::string& code); + + void writeImplementation(const std::string& code); + + void methodEnd(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + + void variablesStart(); + + void variable(const Poco::CppParser::Variable* pVar); + + void variablesEnd(); + + const CodeGenerator::IncludeSet& includes() const; + + const CodeGenerator::IncludeSet& systemIncludes() const; + + const std::string& nameSpace() const; + + const std::string& libraryName() const; + + bool usePocoIncludeStyle() const; + + const std::string& copyright() const; + + void endFile(); + + void writeTypeDef(const Poco::CppParser::TypeDef* pType); + + void writeUsing(const Poco::CppParser::TypeAlias* pType); + +private: + bool matches(const CodeGenerator::Properties& properties) const; + /// Returns true if it is superset of the internal properties + +private: + CodeGenerator* _pGen; + CodeGenerator::Properties _properties; + bool _forwardMethod; + bool _inMethod; +}; + + +inline void MethodPropertyFilter::addIncludeFile(const std::string& incFile) +{ + _pGen->addIncludeFile(incFile); +} + + +inline void MethodPropertyFilter::addSystemIncludeFile(const std::string& incFile) +{ + _pGen->addSystemIncludeFile(incFile); +} + + +inline void MethodPropertyFilter::addFwdDecl(const std::string& inclFile, const std::string& className, const std::string namespacePrefix) +{ + _pGen->addFwdDecl(inclFile, className, namespacePrefix); +} + + +inline void MethodPropertyFilter::writeIncludes() +{ + _pGen->writeIncludes(); +} + + +inline void MethodPropertyFilter::writeDefaultHeader(const Poco::CppParser::Struct* pStruct, const std::string& className, const std::string& libraryName, const std::string& package) +{ + _pGen->writeDefaultHeader(pStruct, className, libraryName, package); +} + + +inline void MethodPropertyFilter::writeInclude(const std::string& include, bool toheader) +{ + _pGen->writeInclude(include, toheader); +} + + +inline void MethodPropertyFilter::writeSystemInclude(const std::string& include) +{ + _pGen->writeSystemInclude(include); +} + + +inline void MethodPropertyFilter::writeImplementation(const std::string& code) +{ + _pGen->writeImplementation(code); +} + + +inline void MethodPropertyFilter::writeNameSpaceBegin(const std::string& ns) +{ + _pGen->writeNameSpaceBegin(ns); +} + + +inline void MethodPropertyFilter::writeFwdDecls(const FwdDecls& decl) +{ + _pGen->writeFwdDecls(decl); +} + + +inline void MethodPropertyFilter::writeNameSpaceEnd(const std::string& ns) +{ + _pGen->writeNameSpaceEnd(ns); +} + + +inline void MethodPropertyFilter::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + _pGen->structStart(pStruct, properties); +} + + +inline void MethodPropertyFilter::structEnd() +{ + _pGen->structEnd(); +} + + +inline void MethodPropertyFilter::variablesStart() +{ + _pGen->variablesStart(); +} + + +inline void MethodPropertyFilter::variable(const Poco::CppParser::Variable* pVar) +{ + _pGen->variable(pVar); +} + + +inline void MethodPropertyFilter::variablesEnd() +{ + _pGen->variablesEnd(); +} + + +inline const CodeGenerator::IncludeSet& MethodPropertyFilter::includes() const +{ + return _pGen->includes(); +} + + +inline const CodeGenerator::IncludeSet& MethodPropertyFilter::systemIncludes() const +{ + return _pGen->systemIncludes(); +} + + +inline const std::string& MethodPropertyFilter::nameSpace() const +{ + return _pGen->nameSpace(); +} + + +inline const std::string& MethodPropertyFilter::libraryName() const +{ + return _pGen->libraryName(); +} + + +inline bool MethodPropertyFilter::usePocoIncludeStyle() const +{ + return _pGen->usePocoIncludeStyle(); +} + + +inline void MethodPropertyFilter::endFile() +{ + _pGen->endFile(); +} + + +inline const std::string& MethodPropertyFilter::copyright() const +{ + return _pGen->copyright(); +} + + +inline void MethodPropertyFilter::writeTypeDef(const Poco::CppParser::TypeDef* pType) +{ + return _pGen->writeTypeDef(pType); +} + + +inline void MethodPropertyFilter::writeUsing(const Poco::CppParser::TypeAlias* pType) +{ + return _pGen->writeUsing(pType); +} + + +} } // namespace Poco::CodeGeneration + + +#endif // CodeGeneration_MethodPropertyFilter_INCLUDED diff --git a/CodeGeneration/include/Poco/CodeGeneration/Utility.h b/CodeGeneration/include/Poco/CodeGeneration/Utility.h new file mode 100644 index 0000000000..65dedcaec5 --- /dev/null +++ b/CodeGeneration/include/Poco/CodeGeneration/Utility.h @@ -0,0 +1,204 @@ +// +// Utility.h +// +// Library: CodeGeneration +// Package: CodeGeneration +// Module: Utility +// +// Definition of the Utility class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef CodeGeneration_Utility_INCLUDED +#define CodeGeneration_Utility_INCLUDED + + +#include "Poco/CodeGeneration/CodeGeneration.h" +#include "Poco/CppParser/Symbol.h" +#include "Poco/CppParser/Struct.h" +#include "Poco/CppParser/Parameter.h" +#include "Poco/Exception.h" +#include + + +#if defined(_WIN32) +#undef IN +#undef OPTIONAL +#endif + + +namespace Poco { +namespace CodeGeneration { + + +class CodeGenerator; + + +class CodeGeneration_API Utility + /// Constants and utility functions for code generation. +{ +public: + static const std::string HFILEEXTENSION; + static const std::string CPPFILEEXTENSION; + static const std::string RETURN; + static const std::string PUBLIC; + static const std::string PRIVATE; + static const std::string PROTECTED; + static const std::string VIRTUAL; + static const std::string STATIC; + static const std::string CLASS; + static const std::string PROPERTYSTART; + static const std::string PROPERTYEND; + static const std::string PROPERTYSTARTELEM; + static const std::string PROPERTYENDELEM; + static const std::string TYPE_VOID; + + // Properties + static const std::string REMOTE; + static const std::string ONEWAY; + static const std::string SYNCHRONIZED; + static const std::string SERIALIZE; + static const std::string GENERATED; + static const std::string CACHING; + static const std::string CACHEEXPIRETIME; + static const std::string NAME; + static const std::string TYPE; + static const std::string ORDER; + static const std::string DIRECTION; + static const std::string NAMESPACE; + static const std::string MANDATORY; + static const std::string OPTIONAL; + static const std::string HEADER; + static const std::string ACTION; + static const std::string REQUEST; + static const std::string REPLY; + static const std::string FAULT; + static const std::string FILTER; + static const std::string IN; + static const std::string FORMAT; + static const std::string PATH; + static const std::string PRODUCES; + static const std::string CONSUMES; + static const std::string CONTENT_TYPE; + static const std::string PERMISSION; + static const std::string AUTHENTICATED; + static const std::string LENGTH; + static const std::string XSDTYPE; + + static const std::string VAL_TRUE; + static const std::string VAL_FALSE; + static const std::string VAL_ASSIGNMENT; + static const std::string VAL_SEPARATOR; + static const std::string VAL_INFINITE; + static const std::string VAL_ATTR; + static const std::string VAL_ELEM; + + static void writeStdHeader(std::ostream& ostr, + const std::string& fileName, + const std::string& libraryName, + const std::string& packageName, + const std::string& moduleName, + const std::string& copyright, + bool writeTimestamp = true); + + static void writeIncludeGuard(std::ostream& ostr, const std::string& libraryName, const std::string& fileName); + /// Writes an includeguard: ie. #ifndef xy #define xy + + static void writeInclude(std::ostream& ostr, const std::string& libraryName, const std::string& fileName); + /// Writes an include. + + static void writeLines(std::ostream& ostr, const std::vector& lines, bool appendNewLine); + /// Writes code lines to the output stream. + + static void writeClassDeclaration(std::ostream& ostr, const std::string& libName, const std::string& className); + /// Writes a class declaration. Do not use for templates! + + static void writeClassDeclaration(std::ostream& ostr, const std::string& libName, const Poco::CppParser::Struct* pStruct, bool enableAttributes = false); + /// Writes a class declaration. Works for templates. + + static void writeAccess(std::ostream& ostr, Poco::CppParser::Symbol::Access acc); + /// Writes string version of the Access. + + static void createFiles(const std::string& fileNameCore, std::ofstream& hFile, std::ofstream& cppFile); + /// Takes the fileNameCore (name without extension), appends HFILEEXTENSION, and CPPFILEEXTENSION, and opens both files + /// In case of an error an exception is thrown + + static std::string createIncludeGuard(const std::string& libraryName, const std::string& fileName); + /// Creates an include guard found at the very beginning of the h file. + + static std::string createInclude(const Poco::CppParser::Struct* pStruct, bool usePocoIncludes); + /// Creates an include path for the given struct. + + static std::string createInclude(const std::string& filePath, bool flatInclude); + /// Creates an include path for the given filePath. + + static void handleInclude(const Poco::CppParser::Struct* pStruct, CodeGenerator& gen); + /// Takes the absolute/relative file path from the struct as input and converts it to an include dir + + static void handleSrcInclude(const Poco::CppParser::Struct* pStruct, CodeGenerator& gen); + /// Takes the absolute/relative file path from the struct as input and converts it to an include dir + + static void handleBaseClassesInclude(const Poco::CppParser::Struct* pStruct, CodeGenerator& gen); + /// Includes all files for the parents + + static std::string extractTemplateFromClassDecl(const Poco::CppParser::Struct* pStruct); + /// Extracts the template name from the class. + + static bool hasAnyRemoteProperty(const Poco::CppParser::Struct* pStruct); + /// Checks if a class or a single PUBLIC method of it has remote properties. + + static std::string resolveType(const Poco::CppParser::NameSpace* pSym, const std::string& name); + /// Resolves types by appending namespaces to them + + static std::string resolveTypeImpl(const Poco::CppParser::NameSpace* pSym, const std::string& name); + /// Resolves types by appending namespaces to them + + static std::string resolveParamDecl(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Parameter* pSym); + /// Returns the declaration of a parameter with resolved types. + + static void writeNameSpaceBegin(std::ostream& out, const std::string& nameSpace); + /// Starts the namespace + + static void writeNameSpaceEnd(std::ostream& out, const std::string& nameSpace); + /// Ends the namespace + + static void writeDocumentation(std::ostream& out, const std::string& docu, int indent); + + static void writeAttributes(std::ostream& out, const Poco::CppParser::Attributes& attrs, int indent); + +private: + Utility(); + ~Utility(); + Utility& operator = (const Utility&); + Utility(const Utility&); +}; + + +class RecursionGuard +{ +public: + RecursionGuard(int& counter, const Poco::Exception& exc = Poco::RuntimeException("Recursion limit reached"), int limit = 50): + _c(counter) + { + if (++_c >= limit) throw exc; + } + + ~RecursionGuard() + { + --_c; + } + +private: + int& _c; +}; + + +} } // namespace Poco::CodeGeneration + + +#endif // CodeGeneration_Utility_INCLUDED diff --git a/CodeGeneration/src/CodeGenerator.cpp b/CodeGeneration/src/CodeGenerator.cpp new file mode 100644 index 0000000000..1561828289 --- /dev/null +++ b/CodeGeneration/src/CodeGenerator.cpp @@ -0,0 +1,88 @@ +// +// CodeGenerator.cpp +// +// Library: CodeGeneration +// Package: CodeGeneration +// Module: CodeGenerator +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "Poco/CodeGeneration/CodeGenerator.h" + + +namespace Poco { +namespace CodeGeneration { + + +CodeGenerator::FwdDecl::FwdDecl(const std::string& inc, const std::string& cN, const std::string& ns): + includeFile(inc), + className(cN), + fullNameSpace(ns) +{ + poco_assert_dbg (!includeFile.empty()); + poco_assert_dbg (!className.empty()); +} + + +bool CodeGenerator::FwdDecl::operator<(const FwdDecl& other) const +{ + if (fullNameSpace < other.fullNameSpace) + return true; + if (fullNameSpace > other.fullNameSpace) + return false; + + return className < other.className; +} + + +CodeGenerator::CodeGenerator(const std::string& nameSpace, const std::string& libraryName, bool st, const std::string& copyright): + _nameSpace(nameSpace), + _libraryName(libraryName), + _usePocoIncludeStyle(st), + _copyright(copyright), + _includes(), + _systemIncludes(), + _fwdDecls() +{ +} + + +CodeGenerator::~CodeGenerator() +{ +} + + +void CodeGenerator::writeIncludes() +{ + CodeGenerator::IncludeSet::const_iterator it = systemIncludes().begin(); + CodeGenerator::IncludeSet::const_iterator itEnd = systemIncludes().end(); + for (; it != itEnd; ++it) + writeSystemInclude(*it); + + it = includes().begin(); + itEnd = includes().end(); + for (; it != itEnd; ++it) + writeInclude(*it, true); + + it = _srcIncludes.begin(); + itEnd = _srcIncludes.end(); + for (; it != itEnd; ++it) + writeInclude(*it, false); + + writeFwdDecls(_fwdDecls); +} + + +void CodeGenerator::addFwdDecl(const std::string& inclFile, const std::string& className, const std::string namespacePrefix) +{ + CodeGenerator::FwdDecl decl(inclFile, className, namespacePrefix); + _fwdDecls.insert(decl); +} + + +} } // namespace Poco::CodeGeneration diff --git a/CodeGeneration/src/CppGenerator.cpp b/CodeGeneration/src/CppGenerator.cpp new file mode 100644 index 0000000000..3e7981f74e --- /dev/null +++ b/CodeGeneration/src/CppGenerator.cpp @@ -0,0 +1,780 @@ +// +// CppGenerator.cpp +// +// Library: CodeGeneration +// Package: CodeGeneration +// Module: CppGenerator +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "Poco/CodeGeneration/CppGenerator.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/String.h" +#include "Poco/StringTokenizer.h" +#include "Poco/Path.h" + + +namespace Poco { +namespace CodeGeneration { + + +CppGenerator::CppGenerator(const std::string& nameSpace, const std::string& libraryName, bool usePocoIncludes, const std::string& copyright, std::ostream& hOut, std::ostream& cppOut): + CodeGenerator(nameSpace, libraryName, usePocoIncludes, copyright), + _hOut(hOut), + _cppOut(cppOut), + _className(), + _inInlineFct(false), + _isTemplate(false), + _inPureVirtualFct(false), + _lastAcc(Poco::CppParser::Symbol::ACC_PUBLIC), + _pStruct(0), + _pFunc(0), + _attributesEnabled(false), + _timestampsEnabled(true) +{ +} + + +CppGenerator::~CppGenerator() +{ +} + + +void CppGenerator::enableAttributes(bool enable) +{ + _attributesEnabled = enable; +} + + +void CppGenerator::enableTimestamps(bool enable) +{ + _timestampsEnabled = enable; +} + + +void CppGenerator::writeDefaultHeader(const Poco::CppParser::Struct* pStruct, const std::string& className, const std::string& libraryName, const std::string& packageName) +{ + _isTemplate = (pStruct->flags() & Poco::CppParser::Struct::FN_TEMPLATE); + Poco::Path path(pStruct->getFile()); + Utility::writeStdHeader(_hOut, path.getBaseName() + Utility::HFILEEXTENSION, libraryName, packageName, className, copyright(), _timestampsEnabled); + if (pStruct->flags() & Poco::CppParser::Struct::FN_TEMPLATE_SPECIALIZATION) + { + // write a different include guard which depends on the specialized type too + const std::string& decl = pStruct->declaration(); + std::size_t templTypeStart = decl.rfind("<"); + std::size_t templTypeEnd = decl.rfind(">"); + poco_assert (templTypeStart != std::string::npos && templTypeEnd != std::string::npos); + std::string templParam = decl.substr(templTypeStart+1, templTypeEnd-templTypeStart-1); + Poco::trimInPlace(templParam); + templParam = Poco::CppParser::replace(templParam, "::", "_"); + poco_assert (!templParam.empty()); + _includeGuard = Utility::createIncludeGuard(libraryName, className+"_"+templParam); + Utility::writeIncludeGuard(_hOut, libraryName, className+"_"+templParam); + } + else + { + _includeGuard = Utility::createIncludeGuard(libraryName, className); + Utility::writeIncludeGuard(_hOut, libraryName, className); + } + if (!_isTemplate) + { + Utility::writeStdHeader(_cppOut, path.getBaseName() + Utility::CPPFILEEXTENSION, libraryName, packageName, className, copyright(), _timestampsEnabled); + std::string incPath = Utility::createInclude(pStruct, usePocoIncludeStyle()); + _cppOut << "#include \"" << incPath << "\"\n"; + } +} + + +void CppGenerator::writeInclude(const std::string& include, bool toHeader) +{ + if (toHeader) + _hOut << "#include \"" << include << "\"\n"; + else + writeSrcInclude(include); +} + + +void CppGenerator::writeSrcInclude(const std::string& include) +{ + _cppOut << "#include \"" << include << "\"\n"; +} + + +void CppGenerator::writeSystemInclude(const std::string& include) +{ + _hOut << "#include <" << include << ">\n"; +} + + +void CppGenerator::writeNameSpaceBegin(const std::string& nameSpace) +{ + writeNameSpaceBegin(nameSpace, false); +} + + +void CppGenerator::writeNameSpaceBegin(const std::string& nameSpace, bool toHeaderOnly) +{ + _hOut << "\n\n"; + + if (!nameSpace.empty()) + { + Poco::StringTokenizer aTok(nameSpace, ":", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); + int nsCnt = (int)aTok.count(); + if (!_isTemplate && !toHeaderOnly) + { + _cppOut << "\n\n"; + } + for (int i = 0; i < nsCnt; ++i) + { + std::string nsDecl("namespace " + aTok[i] + " {\n"); + _hOut << nsDecl; + if (!_isTemplate && !toHeaderOnly) + { + _cppOut << nsDecl; + } + } + _hOut << "\n\n"; + if (!_isTemplate && !toHeaderOnly) + { + _cppOut << "\n\n"; + } + } + else + { + if (!_isTemplate && !toHeaderOnly) + _cppOut << "\n\n"; + } +} + + +void CppGenerator::writeFwdDecls(const CodeGenerator::FwdDecls& decl) +{ + std::string lastNS; + bool nsOpen = false; + bool firstDecl = true; + CodeGenerator::FwdDecls::const_iterator itFwd = decl.begin(); + CodeGenerator::FwdDecls::const_iterator itFwdEnd = decl.end(); + for (; itFwd != itFwdEnd; ++itFwd) + { + // only write fwd decl if the file is not yet included + if (includes().find(itFwd->includeFile) == includes().end() && + systemIncludes().find(itFwd->includeFile) == systemIncludes().end()) + { + if (_isTemplate) + { + // fwd decl in template? not always possible/meaningful + _hOut << "#include \"" << itFwd->includeFile << "\"\n"; + } + else + { + if (lastNS != itFwd->fullNameSpace) + { + // a new namespace + if (nsOpen) + { + _hOut << "\n\n"; + writeNameSpaceEnd(lastNS, true); + } + if (firstDecl) + { + _hOut << "\n\n"; + } + writeNameSpaceBegin(itFwd->fullNameSpace, true); + lastNS = itFwd->fullNameSpace; + nsOpen = true; + } + else if (firstDecl) + { + _hOut << "\n\n"; + } + _hOut << "class " << itFwd->className << ";\n"; + _cppOut << "#include \"" << itFwd->includeFile << "\"\n"; + firstDecl = false; + } + } + } + if (nsOpen) + { + _hOut << "\n\n"; + writeNameSpaceEnd(lastNS, true); + } +} + + +void CppGenerator::writeNameSpaceEnd(const std::string& nameSpace) +{ + writeNameSpaceEnd(nameSpace, false); +} + + +void CppGenerator::writeNameSpaceEnd(const std::string& nameSpace, bool toHeaderOnly) +{ + if (!nameSpace.empty()) + { + Poco::StringTokenizer aTok(nameSpace, ":", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); + int nsCnt = (int)aTok.count(); + for (int i = 0; i < nsCnt; ++i) + { + _hOut << "} // namespace " << aTok[nsCnt-1-i] << "\n"; + if (!_isTemplate && !toHeaderOnly) + { + _cppOut << "} // namespace " << aTok[nsCnt-1-i] << "\n"; + } + } + _hOut << "\n\n"; + if (!_isTemplate && !toHeaderOnly) + { + _cppOut << "\n"; + } + } + else + _hOut << "\n\n"; +} + + +void CppGenerator::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + _pStruct = pStruct; + _className = pStruct->name(); + std::ostream& out = _pStruct->isInline()? _cppOut : _hOut; + + // now write the decl of the class + Utility::writeClassDeclaration(out, libraryName(), pStruct, _attributesEnabled); + Utility::writeAccess(out, Poco::CppParser::Symbol::ACC_PUBLIC); + out << ":\n"; + _lastAcc = Poco::CppParser::Symbol::ACC_PUBLIC; +} + + +void CppGenerator::structEnd() +{ + std::ostream& out = _pStruct->isInline()? _cppOut : _hOut; + + out << "};\n\n\n"; + // now write the inline methods + std::vector::const_iterator it = _inlineFunctions.begin(); + std::vector::const_iterator itEnd = _inlineFunctions.end(); + for (; it != itEnd; ++it) + { + writeMethodStartCpp(it->pFunc, it->props, out); + std::vector::const_iterator itCode = it->codeLines.begin(); + std::vector::const_iterator itCodeEnd = it->codeLines.end(); + for (; itCode != itCodeEnd; ++itCode) + { + writeMethodImplementationImpl(*itCode, out); + } + methodEndImpl(it->pFunc, it->props, out); + } + _className.clear(); + _inlineFunctions.clear(); +} + + +void CppGenerator::methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties) +{ + handleAccessChange (pFunc->getAccess()); + _pFunc = pFunc; + _inPureVirtualFct = (pFunc->flags() & Poco::CppParser::Function::FN_PURE_VIRTUAL) != 0; + if (_isTemplate || _pStruct->isInline() || pFunc->flags() & Poco::CppParser::Function::FN_TEMPLATE) + { + writeMethodStartTemplate(pFunc, properties); + } + else + { + writeMethodStartH(pFunc, properties); + _inInlineFct = ((pFunc->flags() & Poco::CppParser::Function::FN_INLINE) != 0); + + if (!_inInlineFct && !_inPureVirtualFct) + writeMethodStartCpp(pFunc, properties, _cppOut); + else if (!_inPureVirtualFct) + { + InlineFunctionInfo info; + info.pFunc = pFunc; + info.props = properties; + _inlineFunctions.push_back(info); + } + } +} + + +void CppGenerator::writeMethodStartCpp(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties, std::ostream& out) +{ + poco_assert_dbg(!_inPureVirtualFct); + if (pFunc->flags() & Poco::CppParser::Function::FN_INLINE) + { + out << "inline "; + } + if (!pFunc->getReturnParameter().empty()) + { + out << pFunc->getReturnParameter() << " "; + } + out << _className << "::" << pFunc->name() << "("; + /// now write the parameters + Poco::CppParser::Function::Iterator itF = pFunc->begin(); + Poco::CppParser::Function::Iterator itFEnd = pFunc->end(); + if (itF != itFEnd) + { + writeParameter(*itF, false, out); + ++itF; + } + while (itF != itFEnd) + { + out << ", "; + writeParameter(*itF, false, out); + ++itF; + } + if (pFunc->isConstructor()) + { + out << ")"; + handleMemberInitInConstructor(pFunc, out); + out << "\n{\n"; + } + else + { + if (pFunc->flags() & Poco::CppParser::Function::FN_CONST) + { + out << ") const\n{\n"; + } + else + { + out << ")\n{\n"; + } + } +} + + +void CppGenerator::writeMethodStartH(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties) +{ + writeFunctionHeader(pFunc, true, _hOut); + _hOut << ";\n"; + if (!pFunc->getDocumentation().empty()) + { + _hOut << "\t\t///"; + _hOut << Poco::CppParser::replace(pFunc->getDocumentation(), "\n", "\n\t\t///") << "\n\n"; + } + else + _hOut << "\n"; +} + + +void CppGenerator::writeFunctionHeader(const Poco::CppParser::Function* pFunc, bool inHFile, std::ostream& out, const std::string& className) +{ + // write properties if in hFile + if (!inHFile && _inPureVirtualFct) + return; + + if (inHFile) + { + if (_attributesEnabled) + { + Utility::writeAttributes(out, pFunc->attrs(), 1); + } + out << "\t"; //indentation + if ( (pFunc->flags() & Poco::CppParser::Function::FN_VIRTUAL) || _inPureVirtualFct) + out << Utility::VIRTUAL << " "; + + if (pFunc->flags() & Poco::CppParser::Function::FN_STATIC) + out << Utility::STATIC << " "; + } + + // write the return type + if (!pFunc->getReturnParameter().empty()) + { + out << pFunc->getReturnParameter() << " "; + } + + if (!className.empty() && !inHFile) + out << className << "::"; + + out << pFunc->name() << "("; + + // now write the parameters + Poco::CppParser::Function::Iterator itF = pFunc->begin(); + Poco::CppParser::Function::Iterator itFEnd = pFunc->end(); + if (itF != itFEnd) + { + writeParameter(*itF, inHFile, out); + ++itF; + } + while (itF != itFEnd) + { + out << ", "; + writeParameter(*itF, inHFile, out); + ++itF; + } + if (pFunc->flags() & Poco::CppParser::Function::FN_CONST) + out << ") const"; + else + out << ")"; + + if (inHFile && _inPureVirtualFct) + { + out << " = 0"; + } + +} + + +void CppGenerator::writeMethodStartTemplate(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties) +{ + std::ostream& out = _pStruct->isInline()? _cppOut : _hOut; + writeFunctionHeader(pFunc, true, out); + out << "\n"; + if (!pFunc->getDocumentation().empty()) + { + out << "\t\t///"; + out << Poco::CppParser::replace(pFunc->getDocumentation(), "\n", "\n\t\t///") << "\n"; + } + out << "\t{\n"; +} + + +void CppGenerator::writeMethodImplementation(const std::string& code) +{ + poco_assert (_pFunc); + if(_inPureVirtualFct) + return; + + if (_isTemplate || _pStruct->isInline() || _pFunc->flags() & Poco::CppParser::Function::FN_TEMPLATE) + { + std::ostream& out = _pStruct->isInline()? _cppOut : _hOut; + out << "\t\t"; + out << Poco::CppParser::replace(code, "\n", "\n\t\t"); + out << "\n"; + } + else if (!_inInlineFct) + { + writeMethodImplementationImpl(code, _cppOut); + } + else + { + _inlineFunctions.back().codeLines.push_back(code); + } + +} + +void CppGenerator::writeImplementation(const std::string& code) +{ + if (_isTemplate) + { + _hOut << code << "\n"; + } + else + { + _cppOut << code << "\n"; + } +} + + +void CppGenerator::writeMethodImplementationImpl(const std::string& code, std::ostream& out) +{ + out << "\t"; + out << Poco::CppParser::replace(code, "\n", "\n\t"); + out << "\n"; +} + + +void CppGenerator::methodEnd(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties) +{ + if (_isTemplate || _pStruct->isInline() || _pFunc->flags() & Poco::CppParser::Function::FN_TEMPLATE) + { + std::ostream& out = _pStruct->isInline()? _cppOut : _hOut; + out << "\t}\n\n"; + } + else if (!_inInlineFct && !_inPureVirtualFct) + methodEndImpl(pFunc, properties, _cppOut); + _inInlineFct = false; + _inPureVirtualFct = false; + _pFunc = 0; +} + + +void CppGenerator::methodEndImpl(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties, std::ostream& out) +{ + out << "}\n\n\n"; + _inInlineFct = false; +} + + +void CppGenerator::variablesStart() +{ +} + + +void CppGenerator::variable(const Poco::CppParser::Variable* pVar) +{ + handleAccessChange(pVar->getAccess()); + std::ostream& out = _pStruct->isInline()? _cppOut : _hOut; + + if (_attributesEnabled) + { + const Poco::CppParser::Attributes& attrs = pVar->attrs(); + Utility::writeAttributes(out, attrs, 1); + } + out << "\t" << pVar->declaration() << ";\n"; +} + + +void CppGenerator::variablesEnd() +{ +} + + +void CppGenerator::writeTypeDef(const Poco::CppParser::TypeDef* pType) +{ + if (!pType) + { + _hOut << std::endl; + return; + } + handleAccessChange(pType->getAccess()); + _hOut << "\t" << pType->declaration() << ";" << std::endl; +} + + +void CppGenerator::writeUsing(const Poco::CppParser::TypeAlias* pType) +{ + if (!pType) + { + _hOut << std::endl; + return; + } + handleAccessChange(pType->getAccess()); + _hOut << "\t" << pType->declaration() << ";" << std::endl; +} + + +void CppGenerator::writeParameter(const Poco::CppParser::Parameter* pParam) +{ + if (!_pStruct->isInline()) + { + _hOut << Poco::trim(pParam->declaration()); + if (pParam->hasDefaultValue()) + _hOut << " = " << Utility::resolveType(_pStruct, pParam->declType()) << "(" << pParam->defaultValue() << ")"; + } + _cppOut << Poco::trim(pParam->declaration()); + if (_pStruct->isInline()) + { + if (pParam->hasDefaultValue()) + _cppOut << " = " << Utility::resolveType(_pStruct, pParam->declType()) << "(" << pParam->defaultValue() << ")"; + } +} + + +void CppGenerator::writeParameter(const Poco::CppParser::Parameter* pParam, bool inHFile, std::ostream& out) +{ + out << pParam->declaration(); + if (_pStruct->isInline() || inHFile) + { + if (pParam->hasDefaultValue()) + out << " = " << Utility::resolveType(_pStruct, pParam->declType()) << "(" << pParam->defaultValue() << ")"; + } +} + + +void CppGenerator::handleAccessChange(Poco::CppParser::Symbol::Access newAcc) +{ + if (newAcc != _lastAcc) + { + std::ostream& out = _pStruct->isInline()? _cppOut : _hOut; + Utility::writeAccess(out, newAcc); + out << ":\n"; + _lastAcc = newAcc; + } +} + + +void CppGenerator::handleMemberInitInConstructor(const Poco::CppParser::Function* pFunc, std::ostream& out) +{ + poco_assert_dbg(_pStruct); + // the question is: do we have any member variables that we can initialize? + Poco::CppParser::NameSpace::SymbolTable varsAll; + _pStruct->variables(varsAll); + // remove static vars! and store the remaining in vars + Poco::CppParser::NameSpace::SymbolTable vars; + Poco::CppParser::NameSpace::SymbolTable::iterator it = varsAll.begin(); + Poco::CppParser::NameSpace::SymbolTable::iterator itEnd = varsAll.end(); + for (; it != itEnd; ++it) + { + Poco::CppParser::Variable* pVar = static_cast(it->second); + if ((pVar->flags() & Poco::CppParser::Variable::VAR_STATIC) == 0) + vars.insert(std::make_pair(it->first, it->second)); + } + + Poco::CppParser::Struct::BaseIterator itB = _pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = _pStruct->baseEnd(); + + it = vars.begin(); + itEnd = vars.end(); + if (itB != itBEnd || it != itEnd) + out << ":\n"; + for (; itB != itBEnd; ++itB) + { + // call for each base class the correct constructor, + // we assume that the parameters do have the same name in the subclass than + // in the super class, so basically it CAN work, but there is NO guarantee + // that it will always work... + + out << "\t" << itB->name << "("; + Poco::CppParser::Struct::BaseIterator itBBeforeEnd = _pStruct->baseEnd(); + --itBBeforeEnd; + // now do parameter magic + // take the decl of the super class constructor, use it. if we find more than one, guess. + // when using virtual inheritance always take the default constructor! + if (itB->pClass && !itB->isVirtual) + { + Poco::CppParser::Struct* pParent = itB->pClass; + Poco::CppParser::Struct::Functions fct; + pParent->constructors(fct); + Poco::CppParser::Struct::Functions::const_iterator itF = fct.begin(); + Poco::CppParser::Struct::Functions::const_iterator itBestMatch = fct.end(); + int bestMatchCnt = 0; + Poco::CppParser::Struct::Functions::const_iterator itFEnd = fct.end(); + for (; itF != itFEnd; ++itF) + { + const Poco::CppParser::Function* pParentConstr = *itF; + Poco::CppParser::Function::Iterator itP = pFunc->begin(); + Poco::CppParser::Function::Iterator itPEnd = pFunc->end(); + int cnt = 0; + for (; itP != itPEnd; ++itP) + { + // only compare parameter decl! + if (findMatchingDecl(pParentConstr, (*itP))) + cnt++; + } + if (cnt > bestMatchCnt) + itBestMatch = itF; + } + if (itBestMatch != fct.end()) + { + const Poco::CppParser::Function* pBestConstr = *itBestMatch; + Poco::CppParser::Function::Iterator itP = pBestConstr->begin(); + Poco::CppParser::Function::Iterator itPEnd = pBestConstr->end(); + Poco::CppParser::Function::Iterator itPBeforeEnd = itPEnd; + --itPBeforeEnd; + + for (; itP != itPEnd; ++itP) + { + out << (*itP)->name(); + if (itP != itPBeforeEnd) + out << ", "; + } + } + } + + out << ")"; + if (itB != itBBeforeEnd) + out << ",\n"; + else + { + if (vars.empty()) + out << "\n"; + else + out << ",\n"; + } + } + + // now search for each member in pFunc, the matching member in vars + + bool first = true; + for (; it != itEnd; ++it) + { + if (!first) + { + out << ",\n"; + } + const Poco::CppParser::Variable* pVar = static_cast(it->second); + + out << "\t" << pVar->name() << "("; + // is there a matching member in pFunc? + // we assume that the only difference between member vars and init vars name is a "_" + // remove the "_" from the var name if there is one + // we never init a member which doesn't begin with _ + ConstructorMapping::const_iterator itMap = _constrMapping.find(pVar); + SimpleConstructorMapping::const_iterator itMapS = _simpleConstrMapping.find(pVar); + if (itMap != _constrMapping.end() || itMapS != _simpleConstrMapping.end()) + { + if (itMap != _constrMapping.end()) + { + const Poco::CppParser::Parameter* pParam = itMap->second; + out << pParam->name(); + } + else + { + poco_assert_dbg (itMapS != _simpleConstrMapping.end()); + out << itMapS->second; + } + } + else if(pVar->name()[0]=='_') + { + std::string expectedParamName(pVar->name().substr(1)); + // if we find the parameter init with the paramname, otherwise init empty + const Poco::CppParser::Parameter* pParam = findParameter(pFunc, expectedParamName); + if (pParam) + { + out << pParam->name(); + } + else if (pVar->isPointer()) + out << "0"; + } + else if (pVar->isPointer()) + out << "0"; + out << ")"; + + first = false; + } +} + + +const Poco::CppParser::Parameter* CppGenerator::findParameter(const Poco::CppParser::Function* pFunc, const std::string& paramName) +{ + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + + for (; it != itEnd; ++it) + { + if ((*it)->name() == paramName) + return *it; + } + return 0; +} + + +bool CppGenerator::findMatchingDecl(const Poco::CppParser::Function* pParentFunc, const Poco::CppParser::Parameter* pParam) +{ + const std::string& dN = pParam->name(); + std::string resDT(Utility::resolveType(_pStruct->nameSpace(), pParam->declType())); + Poco::CppParser::Function::Iterator it = pParentFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pParentFunc->end(); + + for (; it != itEnd; ++it) + { + std::string res(Utility::resolveType(_pStruct, (*it)->declType())); + if (res == resDT && (*it)->name() == dN) + return true; + } + + return false; +} + + +void CppGenerator::endFile() +{ + _hOut << "#endif"; + if (!_includeGuard.empty()) + { + _hOut << " // " << _includeGuard; + _includeGuard.clear(); + } + _hOut << "\n\n"; +} + + +} } // namespace Poco::CodeGeneration diff --git a/CodeGeneration/src/GeneratorEngine.cpp b/CodeGeneration/src/GeneratorEngine.cpp new file mode 100644 index 0000000000..f367182a9a --- /dev/null +++ b/CodeGeneration/src/GeneratorEngine.cpp @@ -0,0 +1,450 @@ +// +// GeneratorEngine.cpp +// +// Library: CodeGeneration +// Package: CodeGeneration +// Module: GeneratorEngine +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CppParser/TypeDef.h" +#include "Poco/Exception.h" +#include "Poco/StringTokenizer.h" +#include "Poco/String.h" +#include "Poco/Path.h" +#include "Poco/NumberParser.h" + + +namespace Poco { +namespace CodeGeneration { + + +using Poco::CppParser::TypeDef; +using Poco::CppParser::TypeAlias; + + +//always choose names that real functions cannot have +const std::string GeneratorEngine::WILDCARD("*"); +const std::string GeneratorEngine::PRECLASS("1PRE*CLASS"); +const std::string GeneratorEngine::POSTCLASS("2POST*CLASS"); +const std::string GeneratorEngine::PRENAMESPACE("1PRE*NAMESPACE"); +const std::string GeneratorEngine::POSTNAMESPACE("2POST*NAMESPACE"); + + +GeneratorEngine::GeneratorEngine():_callbacks() +{ +} + + +GeneratorEngine::~GeneratorEngine() +{ +} + + + +void GeneratorEngine::registerCallback(const std::string& methodName, MethodGenerator funcGen) +{ + bool ok = _callbacks.insert(make_pair(methodName, funcGen)).second; + if (!ok) + throw Poco::ExistsException("callback already exists for the given method"); +} + + +void GeneratorEngine::generate(const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam, bool isFirstClass, bool isLastClass) +{ + if (isFirstClass) + { + gen.writeDefaultHeader(pStruct, pStruct->name(), pStruct->getLibrary(), pStruct->getPackage()); + handleIncludes(pStruct, gen); + + Callbacks::iterator itPreNS = _callbacks.find(PRENAMESPACE); + if (itPreNS != _callbacks.end()) + { + (*(itPreNS->second))(0, pStruct, gen, addParam); + } + + gen.writeNameSpaceBegin(gen.nameSpace()); + } + + Callbacks::iterator itPreC = _callbacks.find(PRECLASS); + if (itPreC != _callbacks.end()) + { + (*(itPreC->second))(0, pStruct, gen, addParam); + } + + CodeGenerator::Properties classProperties; + parseProperties(pStruct, classProperties); + gen.structStart(pStruct, classProperties); + + Poco::CppParser::NameSpace::SymbolTable typeDefs; + pStruct->typeDefs(typeDefs); + handleTypedefs(typeDefs, pStruct, gen); + + Poco::CppParser::NameSpace::SymbolTable typeAliases; + pStruct->typeAliases(typeAliases); + handleUsings(typeAliases, pStruct, gen); + + Poco::CppParser::Struct::Functions functions; + pStruct->constructors(functions); + handleFunctions(functions, pStruct, addParam, classProperties, gen); + functions.clear(); + if (pStruct->destructor() != 0) + handleFunction(pStruct->destructor(), pStruct, addParam, classProperties, gen); + + pStruct->methods(Poco::CppParser::Symbol::ACC_PUBLIC, functions); + handleFunctions(functions, pStruct, addParam, classProperties, gen); + functions.clear(); + pStruct->methods(Poco::CppParser::Symbol::ACC_PROTECTED, functions); + handleFunctions(functions, pStruct, addParam, classProperties, gen); + functions.clear(); + pStruct->methods(Poco::CppParser::Symbol::ACC_PRIVATE, functions); + handleFunctions(functions, pStruct, addParam, classProperties, gen); + + // now generate member variables + gen.variablesStart(); + Poco::CppParser::NameSpace::SymbolTable vars; + pStruct->variables(vars); + Poco::CppParser::NameSpace::SymbolTable::const_iterator itVar = vars.begin(); + Poco::CppParser::NameSpace::SymbolTable::const_iterator itVarEnd = vars.end(); + for (; itVar != itVarEnd; ++itVar) + { + gen.variable(static_cast(itVar->second)); + } + gen.variablesEnd(); + + gen.structEnd(); + + Callbacks::iterator itPostC = _callbacks.find(POSTCLASS); + if (itPostC != _callbacks.end()) + { + (*(itPostC->second))(0, pStruct, gen, addParam); + } + + if (isLastClass) + { + gen.writeNameSpaceEnd(gen.nameSpace()); + + Callbacks::iterator itPostNS = _callbacks.find(POSTNAMESPACE); + if (itPostNS != _callbacks.end()) + { + (*(itPostNS->second))(0, pStruct, gen, addParam); + } + + gen.endFile(); + } +} + + +void GeneratorEngine::handleFunctions(const Poco::CppParser::Struct::Functions& functions, const Poco::CppParser::Struct* pStruct, void* addparam, const CodeGenerator::Properties& classProperties, CodeGenerator& gen) +{ + Poco::CppParser::Struct::Functions::const_iterator it = functions.begin(); + Poco::CppParser::Struct::Functions::const_iterator itEnd = functions.end(); + for (; it != itEnd; ++it) + { + CodeGenerator::Properties methodProperties(classProperties); + parseProperties(*it, methodProperties); + handleFunction(*it, pStruct, addparam, methodProperties, gen); + } +} + + +void GeneratorEngine::handleFunction(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, void* addparam, const CodeGenerator::Properties& methodProperties, CodeGenerator& gen) +{ + gen.methodStart(pFunc, methodProperties); + Callbacks::iterator itC = _callbacks.find(pFunc->name()); + if (itC != _callbacks.end()) + { + (*(itC->second))(pFunc, pStruct, gen, addparam); + } + else + { + // try default callback + itC = _callbacks.find(GeneratorEngine::WILDCARD); + if (itC != _callbacks.end()) + (*(itC->second))(pFunc, pStruct, gen, addparam); + } + gen.methodEnd(pFunc, methodProperties); +} + + +void GeneratorEngine::handleTypedefs(const Poco::CppParser::NameSpace::SymbolTable& typedefs, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen) +{ + int cnt = 0; + Poco::CppParser::NameSpace::Iterator it = typedefs.begin(); + for (; it != typedefs.end(); ++it, ++cnt) + { + const TypeDef* pDef = static_cast(it->second); + gen.writeTypeDef(pDef); + } + if (cnt > 0) + gen.writeTypeDef(0); +} + + +void GeneratorEngine::handleUsings(const Poco::CppParser::NameSpace::SymbolTable& usings, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen) +{ + int cnt = 0; + Poco::CppParser::NameSpace::Iterator it = usings.begin(); + for (; it != usings.end(); ++it, ++cnt) + { + const TypeAlias* pDef = static_cast(it->second); + gen.writeUsing(pDef); + } + if (cnt > 0) + gen.writeUsing(0); +} + + +void GeneratorEngine::handleIncludes(const Poco::CppParser::Struct* pStruct, CodeGenerator& gen) +{ + // iterate over all direct base classes, include all of them + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + for (; itB != itBEnd; ++itB) + { + const Poco::CppParser::Struct* pParent = itB->pClass; + GeneratorEngine::handleIncludeFile(pParent, itB->name, pStruct->getLibrary(), gen); + } + // iterate over all variables, member as function parameters + // TODO + gen.writeIncludes(); +} + + +void GeneratorEngine::handleIncludeFile(const Poco::CppParser::Struct* pStruct, const std::string& classDecl, const std::string& defaultLibrary, CodeGenerator& gen) +{ + if (pStruct) + { + Utility::handleInclude(pStruct, gen); + } + else + { + // no parent means either unknown file (not included in the search dirs) + // or a system file + // check if the file is from std + std::size_t pos = classDecl.find("std::"); + if (pos != std::string::npos) + { + GeneratorEngine::handleSystemInclude(classDecl.substr(pos+5), gen); + } + else + { + // check if we have a namespace, if non, we assume that we extend from a file + // that has the same namespace + pos = classDecl.rfind("::"); + std::string libraryName; + if (pos != std::string::npos) + { + libraryName = classDecl; + } + else + { + // parentdecl contains only the class + libraryName = defaultLibrary + "::" + classDecl; + } + libraryName.append(".h"); + libraryName = Poco::CppParser::replace(libraryName, "::", "/"); + gen.addIncludeFile(libraryName); + } + } +} + + +void GeneratorEngine::handleSystemInclude(const std::string& typeDecl, CodeGenerator& gen) +{ + // could be a template + std::size_t pos = typeDecl.find("<"); + if (pos != std::string::npos) + { + std::string tmp = typeDecl.substr(0, pos); + Poco::trimInPlace(tmp); + // most common templates have an include file with the same name as the template + gen.addSystemIncludeFile(tmp); + } + else + { + // TODO: check the type + gen.addSystemIncludeFile(typeDecl); + } + +} + + +void GeneratorEngine::parseProperties(const Poco::CppParser::Symbol* pSym, CodeGenerator::Properties& props) +{ + const Poco::CppParser::Attributes& attrs = pSym->getAttributes(); + Poco::CppParser::Attributes::Iterator it = attrs.begin(); + Poco::CppParser::Attributes::Iterator itEnd = attrs.end(); + CodeGenerator::Properties tmpProps; + for (;it != itEnd; ++it) + { + // attrs can contain: name=value, var1.name=value, var1.type=attr + // -> convert to name=value, var1={name =value, type = attr + Poco::StringTokenizer tok(it->first, ".", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); + if (tok.count() == 1) + { + std::pair ok = tmpProps.insert(std::make_pair(tok[0], it->second)); + poco_assert (ok.second); + } + else + { + poco_assert (tok.count() == 2); + CodeGenerator::Properties::iterator itSub = tmpProps.find(tok[0]); + poco_assert (itSub != tmpProps.end()); + if (itSub->second.empty()) + itSub->second = "{"; + else + itSub->second.append(", "); + + itSub->second.append(tok[1]); + itSub->second.append(" = "); + itSub->second.append(it->second); + } + } + CodeGenerator::Properties::iterator itP = tmpProps.begin(); + CodeGenerator::Properties::iterator itPEnd = tmpProps.end(); + for (;itP != itPEnd; ++itP) + { + if (!itP->second.empty() && itP->second[0] == '{') + { + if (itP->second[itP->second.size() - 1] != '}') + { + itP->second.append("}"); + } + } + std::pair ok = props.insert(std::make_pair(itP->first, itP->second)); + if (!ok.second) + { + ok.first->second = itP->second; + } + } +} + + +void GeneratorEngine::parseKeyValue(const std::string& keyValue, CodeGenerator::Properties& props) +{ + // search for =. don't use the stringtokenizer becuase we will have attr = {val = x, val2 = y} + std::string key; + std::string value(Utility::VAL_TRUE); + std::size_t pos = keyValue.find(Utility::VAL_ASSIGNMENT); + if (pos != std::string::npos) + { + key = keyValue.substr(0, pos); + value = keyValue.substr(pos + Utility::VAL_ASSIGNMENT.length()); + } + else + key = keyValue; + + Poco::trimInPlace(key); + Poco::trimInPlace(value); + + std::pair ok = props.insert(std::make_pair(key, value)); + if (!ok.second) + { + ok.first->second = value; + } +} + + +void GeneratorEngine::parseElementProperties(const std::string& elemVal, CodeGenerator::Properties& props) +{ + if (elemVal.empty()) + return; + std::size_t posStart = elemVal.find(Utility::PROPERTYSTARTELEM); + std::size_t posEnd = elemVal.rfind(Utility::PROPERTYENDELEM); + if (posStart == std::string::npos || posEnd == std::string::npos) + return; + + std::string prop = elemVal.substr(posStart+Utility::PROPERTYSTARTELEM.length(), posEnd-posStart-Utility::PROPERTYSTARTELEM.length()); + Poco::StringTokenizer tok(prop, Utility::VAL_SEPARATOR, Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); + Poco::StringTokenizer::Iterator it = tok.begin(); + Poco::StringTokenizer::Iterator itEnd = tok.end(); + for (; it != itEnd; ++it) + { + const std::string& keyValue = *it; + parseKeyValue(keyValue, props); + } +} + + +bool GeneratorEngine::getStringProperty(const CodeGenerator::Properties& props, const std::string& propName, std::string& value) +{ + CodeGenerator::Properties::const_iterator it = props.find(propName); + bool found = (it != props.end()); + if (found) + { + value = it->second; + } + return found; +} + + +bool GeneratorEngine::getBoolProperty(const CodeGenerator::Properties& props, const std::string& propName, bool& value) +{ + std::string val; + bool retVal = getStringProperty(props, propName, val); + if (!retVal) + return retVal; + Poco::toLowerInPlace(val); + if (val == Utility::VAL_FALSE || val == "0") + value = false; + else + value = true; + + return retVal; +} + + +bool GeneratorEngine::getUInt32Property(const CodeGenerator::Properties& props, const std::string& propName, Poco::UInt32& value) +{ + std::string val; + bool retVal = getStringProperty(props, propName, val); + if (!retVal) + return retVal; + value = Poco::NumberParser::parseUnsigned(val); + + return retVal; +} + + +void GeneratorEngine::emptyCodeGen(const Poco::CppParser::Function*, const Poco::CppParser::Struct*, CodeGenerator&, void*) +{ +} + + +void GeneratorEngine::skipWhiteSpace(const std::string& str, std::size_t& startPos) +{ + while (isWhiteSpace(str[startPos]) && startPos < str.size()) + ++startPos; +} + + +std::string GeneratorEngine::parseToken(const std::string& str, std::size_t& endPos) +{ + skipWhiteSpace(str, endPos); + std::size_t beginPos = endPos; + while (endPos < str.length() && !isWhiteSpace(str[endPos]) && str[endPos] != ',' && str[endPos] != '=' && str[endPos] != '{' && str[endPos] != '[' && str[endPos] != '}' && str[endPos] != ']') + { + ++endPos; + } + std::string result = str.substr(beginPos, endPos-beginPos); + skipWhiteSpace(str, endPos); + return result; +} + + +bool GeneratorEngine::isWhiteSpace(const char c) +{ + return (c==' ' || c=='\t' || c == '\r' || c == '\n'); +} + + +} } // namespace Poco::CodeGeneration diff --git a/CodeGeneration/src/MethodPropertyFilter.cpp b/CodeGeneration/src/MethodPropertyFilter.cpp new file mode 100644 index 0000000000..b9ad39aa05 --- /dev/null +++ b/CodeGeneration/src/MethodPropertyFilter.cpp @@ -0,0 +1,95 @@ +// +// MethodPropertyFilter.cpp +// +// Library: CodeGeneration +// Package: CodeGeneration +// Module: MethodPropertyFilter +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "Poco/CodeGeneration/MethodPropertyFilter.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CppParser/Function.h" + + +namespace Poco { +namespace CodeGeneration { + + +MethodPropertyFilter::MethodPropertyFilter(CodeGenerator* pGen, const CodeGenerator::Properties& properties): + CodeGenerator("","", true, ""), + _pGen(pGen), + _properties(properties), + _forwardMethod(false), + _inMethod(false) +{ + poco_assert (pGen); +} + + +MethodPropertyFilter::MethodPropertyFilter(CodeGenerator* pGen, const std::string& prop): + CodeGenerator("","", true, ""), + _pGen(pGen), + _properties(), + _forwardMethod(false), + _inMethod(false) +{ + poco_assert (pGen); + _properties.insert(std::make_pair(prop, Utility::VAL_TRUE)); +} + + +MethodPropertyFilter::~MethodPropertyFilter() +{ + delete _pGen; +} + + +void MethodPropertyFilter::methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties) +{ + _inMethod = true; + _forwardMethod = matches(properties) && !(pFunc->isConstructor() || pFunc->isDestructor() || pFunc->isDeleted()) && pFunc->getAccess() == Poco::CppParser::Symbol::ACC_PUBLIC; + + if (_forwardMethod) + _pGen->methodStart(pFunc, properties); +} + + +void MethodPropertyFilter::writeMethodImplementation(const std::string& code) +{ + if (_forwardMethod || !_inMethod) + _pGen->writeMethodImplementation(code); +} + + +void MethodPropertyFilter::methodEnd(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties) +{ + if (_forwardMethod) + _pGen->methodEnd(pFunc, properties); + _inMethod = false; + _forwardMethod = false; +} + + +bool MethodPropertyFilter::matches(const CodeGenerator::Properties& properties) const +{ + // look if we find all of the internalproperties in properties + CodeGenerator::Properties::const_iterator it = _properties.begin(); + CodeGenerator::Properties::const_iterator itEnd = _properties.end(); + bool ok = true; + for (; it != itEnd && ok; ++it) + { + CodeGenerator::Properties::const_iterator itF = properties.find(it->first); + + ok &= (itF != properties.end() && (itF->second == it->second || (it->second == Utility::VAL_TRUE && itF->second.empty()))); + } + return ok; +} + + +} } // namespace Poco::CodeGeneration diff --git a/CodeGeneration/src/Utility.cpp b/CodeGeneration/src/Utility.cpp new file mode 100644 index 0000000000..72481b31aa --- /dev/null +++ b/CodeGeneration/src/Utility.cpp @@ -0,0 +1,599 @@ +// +// Utility.cpp +// +// Library: CodeGeneration +// Package: CodeGeneration +// Module: Utility +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/CodeGenerator.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CppParser/Function.h" +#include "Poco/Exception.h" +#include "Poco/String.h" +#include "Poco/Path.h" +#include "Poco/StringTokenizer.h" +#include "Poco/DateTime.h" +#include "Poco/DateTimeFormatter.h" +#include "Poco/DateTimeFormat.h" +#include +#include +#include + + +namespace Poco { +namespace CodeGeneration { + + +const std::string Utility::HFILEEXTENSION(".h"); +const std::string Utility::CPPFILEEXTENSION(".cpp"); +const std::string Utility::REMOTE("remote"); +const std::string Utility::SYNCHRONIZED("synchronized"); +const std::string Utility::SERIALIZE("serialize"); +const std::string Utility::GENERATED("generated"); +const std::string Utility::CACHING("cacheResult"); +const std::string Utility::CACHEEXPIRETIME("cacheExpire"); +const std::string Utility::ONEWAY("oneway"); +const std::string Utility::RETURN("return"); +const std::string Utility::PUBLIC("public"); +const std::string Utility::PRIVATE("private"); +const std::string Utility::PROTECTED("protected"); +const std::string Utility::VIRTUAL("virtual"); +const std::string Utility::STATIC("static"); +const std::string Utility::CLASS("class"); +const std::string Utility::PROPERTYSTART("[["); +const std::string Utility::PROPERTYEND("]]"); +const std::string Utility::PROPERTYSTARTELEM("{"); +const std::string Utility::PROPERTYENDELEM("}"); +const std::string Utility::TYPE_VOID("void"); +const std::string Utility::NAME("name"); +const std::string Utility::TYPE("type"); +const std::string Utility::ORDER("order"); +const std::string Utility::DIRECTION("direction"); +const std::string Utility::NAMESPACE("namespace"); +const std::string Utility::MANDATORY("mandatory"); +const std::string Utility::OPTIONAL("optional"); +const std::string Utility::HEADER("header"); +const std::string Utility::ACTION("action"); +const std::string Utility::REQUEST("request"); +const std::string Utility::REPLY("reply"); +const std::string Utility::FAULT("fault"); +const std::string Utility::FILTER("filter"); +const std::string Utility::IN("in"); +const std::string Utility::FORMAT("format"); +const std::string Utility::PATH("path"); +const std::string Utility::PRODUCES("produces"); +const std::string Utility::CONSUMES("consumes"); +const std::string Utility::CONTENT_TYPE("contentType"); +const std::string Utility::PERMISSION("permission"); +const std::string Utility::AUTHENTICATED("authenticated"); +const std::string Utility::LENGTH("length"); +const std::string Utility::XSDTYPE("xsdType"); +const std::string Utility::VAL_TRUE("true"); +const std::string Utility::VAL_FALSE("false"); +const std::string Utility::VAL_ASSIGNMENT("="); +const std::string Utility::VAL_SEPARATOR(","); +const std::string Utility::VAL_INFINITE("infinite"); +const std::string Utility::VAL_ATTR("attr"); +const std::string Utility::VAL_ELEM("elem"); + + +void Utility::writeStdHeader(std::ostream& ostr, const std::string& fileName, const std::string& libraryName, const std::string& packageName, const std::string& moduleName, const std::string& copyright, bool writeTimestamp) +{ + Poco::DateTime now; + ostr << "//\n"; + ostr << "// " << fileName << "\n"; + ostr << "//\n"; + if (!libraryName.empty()) ostr << "// Library: " << libraryName << "\n"; + if (!packageName.empty()) ostr << "// Package: " << packageName << "\n"; + if (!moduleName.empty()) ostr << "// Module: " << moduleName << "\n"; + ostr << "//\n"; + ostr << "// This file has been generated"; + if (writeTimestamp) + ostr << " on " << Poco::DateTimeFormatter::format(now, Poco::DateTimeFormat::SORTABLE_FORMAT) << " UTC.\n"; + else + ostr << ".\n"; + ostr << "// Warning: All changes to this will be lost when the file is re-generated.\n"; + if (!copyright.empty()) + { + ostr << "//\n"; + char line[1024]; + std::istringstream iStr(copyright); + while (!iStr.eof()) + { + iStr.getline(line, 1024); + std::string strLine(line); + Poco::trimInPlace(strLine); + ostr << "// " << strLine << "\n"; + } + } + ostr << "//\n\n\n"; +} + + +void Utility::writeIncludeGuard(std::ostream& ostr, const std::string& libraryName, const std::string& fileName) +{ + std::string define(Utility::createIncludeGuard(libraryName, fileName)); + ostr << "#ifndef " << define << "\n"; + ostr << "#define " << define << "\n\n\n"; +} + + +void Utility::writeInclude(std::ostream& ostr, const std::string& libraryName, const std::string& fileName) +{ + if (!libraryName.empty()) + ostr << "#include \"" << libraryName << "/" << fileName << "\"\n"; + else + ostr << "#include \"" << fileName << "\"\n"; +} + + +std::string Utility::createIncludeGuard(const std::string& libraryName, const std::string& fileName) +{ + std::string define(libraryName); + if (!define.empty()) + define.append("_"); + define.append(fileName); + define.append("_INCLUDED"); + Poco::replaceInPlace(define, "/", "_"); + return define; +} + + +void Utility::writeLines(std::ostream& ostr, const std::vector& lines, bool appendNewLine) +{ + std::vector::const_iterator it = lines.begin(); + std::vector::const_iterator itEnd = lines.end(); + + for (; it != itEnd; ++it) + { + ostr << *it; + if (appendNewLine) + ostr << "\n"; + } +} + + +void Utility::writeClassDeclaration(std::ostream& ostr, const std::string& libName, const std::string& className) +{ + ostr << "class "; + if (!libName.empty()) + { + ostr << libName << "_API "; + } + ostr << className << "\n" << "{" << "\n"; +} + + +void Utility::writeAttributes(std::ostream& out, const Poco::CppParser::Attributes& attrs, int indent) +{ + std::string prefix; + while (indent--) + { + prefix.append("\t"); + } + + for (Poco::CppParser::Attributes::Iterator it = attrs.begin(); it != attrs.end(); ++it) + { + out << prefix << "//@ " << it->first; + if (!it->second.empty()) + { + out << "="; + bool mustQuote = false; + if (it->second[0] != '{') + { + for (std::string::const_iterator itv = it->second.begin(); itv != it->second.end(); ++itv) + { + bool isAlNum = (*itv >= '0' && *itv <= '9') + || (*itv >= 'a' && *itv <= 'z') + || (*itv >= 'A' && *itv <= 'Z') + || (*itv == '_'); + if (!isAlNum) mustQuote = true; + + } + } + std::string quote(mustQuote ? "\"" : ""); + out << quote << it->second << quote << std::endl; + } + else out << std::endl; + } +} + + +void Utility::writeClassDeclaration(std::ostream& ostr, const std::string& libName, const Poco::CppParser::Struct* pStruct, bool enableAttributes) +{ + if (enableAttributes) + { + writeAttributes(ostr, pStruct->attrs(), 0); + } + Poco::CppParser::Struct::BaseIterator begin = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator end = pStruct->baseEnd(); + bool isTemplate = (pStruct->flags() & Poco::CppParser::Struct::FN_TEMPLATE); + if (isTemplate) + { + ostr << pStruct->declaration(); + } + else + { + ostr << "class "; + if (!libName.empty()) + { + ostr << libName << "_API "; + } + ostr << pStruct->name(); + } + if (begin != end) + { + // inheritance info + ostr << ": "; + Utility::writeAccess(ostr, begin->access); + if (begin->isVirtual) + ostr << " " << Utility::VIRTUAL; + ostr << " " << begin->name; + + ++begin; + while (begin != end) + { + ostr << ", "; + Utility::writeAccess(ostr, begin->access); + if (begin->isVirtual) + ostr << " " << Utility::VIRTUAL; + ostr << " " << begin->name; + ++begin; + } + } + const std::string& doc = pStruct->getDocumentation(); + if (!doc.empty()) + { + ostr << "\n\t///"; + ostr << Poco::CppParser::replace(doc, "\n", "\n\t///"); + } + ostr << "\n" << "{" << "\n"; +} + + +void Utility::writeAccess(std::ostream& ostr, Poco::CppParser::Symbol::Access acc) +{ + if (acc == Poco::CppParser::Symbol::ACC_PUBLIC) + ostr << Utility::PUBLIC; + else if(acc == Poco::CppParser::Symbol::ACC_PROTECTED) + ostr << Utility::PROTECTED; + else + ostr << Utility::PRIVATE; +} + + +void Utility::createFiles(const std::string& fileNameCore, std::ofstream& hFile, std::ofstream& cppFile) +{ + std::string hFileName(fileNameCore); + std::string cppFileName(fileNameCore); + hFileName.append(Utility::HFILEEXTENSION); + cppFileName.append(Utility::CPPFILEEXTENSION); + hFile.open(hFileName.c_str()); + if (!hFile.good()) + throw Poco::OpenFileException(hFileName); + cppFile.open(cppFileName.c_str()); + if (!cppFile.good()) + { + hFile.close(); + throw Poco::OpenFileException(cppFileName); + } +} + + +std::string Utility::extractTemplateFromClassDecl(const Poco::CppParser::Struct* pStruct) +{ + const std::string& origDecl = pStruct->declaration(); + std::size_t pos = origDecl.find(pStruct->name()); + pos = origDecl.rfind(">", pos); + std::size_t posStart = origDecl.find("template"); + poco_assert (pos != std::string::npos); + return origDecl.substr(posStart, pos+1-posStart); +} + + +bool Utility::hasAnyRemoteProperty(const Poco::CppParser::Struct* pStruct) +{ + CodeGenerator::Properties classProperties; + GeneratorEngine::parseProperties(pStruct,classProperties); + bool remote = (classProperties.find(REMOTE) != classProperties.end()); + if (remote) + return remote; + + // else check if we find any method that has this property + + Poco::CppParser::Struct::Functions functions; + pStruct->methods(Poco::CppParser::Symbol::ACC_PUBLIC, functions); + Poco::CppParser::Struct::Functions::const_iterator it = functions.begin(); + Poco::CppParser::Struct::Functions::const_iterator itEnd = functions.end(); + for (; it != itEnd; ++it) + { + CodeGenerator::Properties methodProperties; + GeneratorEngine::parseProperties(*it, methodProperties); + remote = (methodProperties.find(REMOTE) != methodProperties.end()); + if (remote) + return remote; + } + return remote; +} + + +void Utility::handleInclude(const Poco::CppParser::Struct* pStruct, CodeGenerator& gen) +{ + bool usePocoIncludes = gen.usePocoIncludeStyle(); + std::string inc(createInclude(pStruct, usePocoIncludes)); + gen.addIncludeFile(inc); +} + + +void Utility::handleSrcInclude(const Poco::CppParser::Struct* pStruct, CodeGenerator& gen) +{ + bool usePocoIncludes = gen.usePocoIncludeStyle(); + std::string inc(createInclude(pStruct, usePocoIncludes)); + gen.addSrcIncludeFile(inc); +} + + +std::string Utility::createInclude(const Poco::CppParser::Struct* pStruct, bool usePocoIncludes) +{ + const std::string& file2 = pStruct->getFile(); + if (!file2.empty()) + { + return createInclude(file2, false); + } + else + { + // take the ns as path + std::string fullName(pStruct->fullName()); + fullName = CppParser::replace(fullName, "::","/"); + fullName.append(".h"); + return fullName; + } +} + + +std::string Utility::createInclude(const std::string& filePath, bool flatInclude) +{ + poco_assert (!filePath.empty()); + const Poco::Path aFile(filePath); + // common rule: include/Poco/libraryName/FileName.h or with core components simply include Poco/FileName.h + + if (flatInclude) + return aFile.getFileName(); + + int start = aFile.depth()-1; + bool found = false; + do + { + std::string directory = Poco::toLower(aFile.directory(start)); + if (directory.find("include") != std::string::npos) + found = true; + else + --start; + } + while(!found && start >= 0); + if (!found) + start = aFile.depth(); + else + ++start; + + std::string result; + for (int i = start; i < aFile.depth(); ++i) + { + if (i > start) + { + result.append("/"); + } + result.append(aFile.directory(i)); + } + if (!result.empty()) + result.append("/"); + + result.append(aFile.getFileName()); + return result; +} + + +void Utility::handleBaseClassesInclude(const Poco::CppParser::Struct* pStruct, CodeGenerator& gen) +{ + poco_assert_dbg(pStruct); + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + for (; itB != itBEnd; ++itB) + { + const Poco::CppParser::Struct* pParent = itB->pClass; + if (pParent) + Utility::handleInclude(pParent, gen); + else + { + // guess the include from the lib and name + // no parent means either unknown file (not included in the search dirs) + // or a system file + // check if the file is from std + const std::string& classDecl = itB->name; + std::size_t pos = classDecl.find("std::"); + if (pos == 0) + { + gen.addSystemIncludeFile(classDecl.substr(pos+5)); + } + } + } +} + + +std::string Utility::resolveType(const Poco::CppParser::NameSpace* pParent, const std::string& name) +{ + return resolveTypeImpl(pParent, name); +} + + +std::string Utility::resolveTypeImpl(const Poco::CppParser::NameSpace* pParent, const std::string& name) +{ + if (!pParent) return name; + + static int recursionCount = 0; + RecursionGuard recursionGuard(recursionCount, Poco::RuntimeException("Recursion limit reached resolving type", name)); + + // template support + std::size_t pos = name.find("<"); + std::size_t posEnd = name.rfind(">"); + if (pos != std::string::npos && posEnd != std::string::npos) + { + std::string innerType = name.substr(pos+1, posEnd-pos-1); + std::string resolvedInnerType; + // inner type of a map: int, std::map + // parse that + int openTemplates = 0; + int end = 0; + for (int i = 0; i < innerType.size(); ++i) + { + if (innerType[i] == '<') + openTemplates++; + else if ((innerType[i] == ',' && openTemplates == 0) || (i+1 == innerType.size())) + { + if (i+1 == innerType.size()) + ++i; + std::string innerPart(innerType.substr(end, i-end)); + end = i+1; + if (!resolvedInnerType.empty()) + resolvedInnerType.append(", "); + resolvedInnerType.append(resolveTypeImpl(pParent, innerPart)); + } + else if (innerType[i] == '>') + openTemplates--; + } + + std::string pre = name.substr(0, pos); + std::string post = name.substr(posEnd+1); + Poco::trimInPlace(pre); + Poco::trimInPlace(post); + std::string templateType(resolveTypeImpl(pParent, pre)); + templateType.append("<"); + templateType.append(resolvedInnerType); + templateType.append(">"); + templateType.append(post); + return templateType; + } + + std::string core(Poco::trim(name)); + bool isConst = (core.find("const") == 0) && std::isspace(core[5]); + std::size_t constPos = isConst? 5 : 0; + std::string result; + if (isConst) + { + while (std::isspace(core[constPos])) + ++constPos; + result = "const "; + } + std::size_t endPos = core.size(); + while (endPos > 1 && (core[endPos-1] == '&' || core[endPos-1] == '*')) + --endPos; + std::string post(core.substr(endPos)); + std::string type(core.substr(constPos, endPos-constPos)); + Poco::trimInPlace(type); + Poco::CppParser::Symbol* pSym = pParent->lookup(type); + if (!pSym) + { + return result + type + post; + } + // Handle the rare case of a recursive data structure. In this case we + // will find a constructor, but we need the class (which is the parent). + if (pSym->kind() == Poco::CppParser::Symbol::SYM_FUNCTION && pSym->name() == pParent->name()) + { + pSym = pSym->nameSpace(); + } + std::string fN = pSym->fullName(); + if (pSym->kind() == Poco::CppParser::Symbol::SYM_TYPEDEF) + { + std::string base = static_cast(pSym)->baseType(); + if (base != name) + return result + resolveTypeImpl(pSym->nameSpace(), base) + post; + else + return result + base + post; + } + else if (pSym->kind() == Poco::CppParser::Symbol::SYM_TYPEALIAS) + { + std::string base = static_cast(pSym)->baseType(); + if (base != name) + return result + resolveTypeImpl(pSym->nameSpace(), base) + post; + else + return result + base + post; + } + else return result + fN + post; +} + + +std::string Utility::resolveParamDecl(const Poco::CppParser::NameSpace* pParent, const Poco::CppParser::Parameter* pSym) +{ + const std::string& decl = pSym->declaration(); + // type var + std::size_t pos = decl.rfind(' '); + + std::string resType = Utility::resolveType(pParent, decl.substr(0, pos)); + if (pos != std::string::npos) + { + resType.append(decl.substr(pos)); + } + return resType; +} + + +void Utility::writeNameSpaceBegin(std::ostream& out, const std::string& nameSpace) +{ + if (!nameSpace.empty()) + { + Poco::StringTokenizer aTok(nameSpace, ":", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); + int nsCnt = (int)aTok.count(); + + for (int i = 0; i < nsCnt; ++i) + { + out << "namespace " << aTok[i] << " {" << std::endl; + } + } +} + + +void Utility::writeNameSpaceEnd(std::ostream& out, const std::string& nameSpace) +{ + if (!nameSpace.empty()) + { + Poco::StringTokenizer aTok(nameSpace, ":", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); + int nsCnt = (int)aTok.count(); + + for (int i = 0; i < nsCnt; ++i) + { + out << "}" << std::endl; + } + } +} + + +void Utility::writeDocumentation(std::ostream& out, const std::string& docu, int indent) +{ + std::string prefix; + while (indent--) + { + prefix.append("\t"); + } + + char line[1024]; + std::istringstream iStr(docu); + while (!iStr.eof()) + { + iStr.getline(line, 1024); + std::string strLine(line); + Poco::trimInPlace(strLine); + out << prefix << "/// " << strLine << "\n"; + } +} + + +} } // namespace Poco::CodeGeneration diff --git a/CodeGeneration/testsuite/CMakeLists.txt b/CodeGeneration/testsuite/CMakeLists.txt new file mode 100644 index 0000000000..808105f820 --- /dev/null +++ b/CodeGeneration/testsuite/CMakeLists.txt @@ -0,0 +1,28 @@ +# Sources +file(GLOB SRCS_G "src/*.cpp") +POCO_SOURCES_AUTO(TEST_SRCS ${SRCS_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "src/*.h") +POCO_HEADERS_AUTO(TEST_SRCS ${HDRS_G}) + +POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF + src/WinDriver.cpp +) + +add_executable(CodeGeneration-testrunner ${TEST_SRCS}) +if(ANDROID) + add_test( + NAME CodeGeneration + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/CodeGeneration-testrunner -DTEST_PARAMETER=-all -P ${PROJECT_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake + ) +else() + add_test( + NAME CodeGeneration + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND CodeGeneration-testrunner -ignore ${PROJECT_SOURCE_DIR}/cppignore.lnx -all + ) + set_tests_properties(CodeGeneration PROPERTIES ENVIRONMENT POCO_BASE=${PROJECT_SOURCE_DIR}) +endif() +target_link_libraries(CodeGeneration-testrunner PUBLIC Poco::CodeGeneration Poco::CppParser CppUnit) diff --git a/CodeGeneration/testsuite/Makefile b/CodeGeneration/testsuite/Makefile new file mode 100644 index 0000000000..ccf77eec3a --- /dev/null +++ b/CodeGeneration/testsuite/Makefile @@ -0,0 +1,16 @@ +# +# Makefile +# +# Makefile for Poco CodeGeneration testsuite +# + +include $(POCO_BASE)/build/rules/global + +objects = CodeGenerationTestSuite Driver \ + CodeGenerationTest + +target = testrunner +target_version = 1 +target_libs = PocoCodeGeneration PocoCppParser PocoFoundation CppUnit + +include $(POCO_BASE)/build/rules/exec diff --git a/CodeGeneration/testsuite/src/CodeGenerationTest.cpp b/CodeGeneration/testsuite/src/CodeGenerationTest.cpp new file mode 100644 index 0000000000..1c79ad90d4 --- /dev/null +++ b/CodeGeneration/testsuite/src/CodeGenerationTest.cpp @@ -0,0 +1,82 @@ +// +// CodeGenerationTest.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "CodeGenerationTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CppParser/Symbol.h" +#include "Poco/CppParser/Struct.h" +#include "Poco/CodeGeneration/CppGenerator.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CodeGeneration/Utility.h" +#include +#include + + +using namespace Poco::CodeGeneration; +using namespace Poco::CppParser; + + +std::string linker("cl"); +std::string options("/I \"C:\\Program Files\\Microsoft Visual Studio 8\\VC\\INCLUDE\", " + "/I \"C:\\Program Files\\Microsoft Visual Studio 8\\VC\\PlatformSDK\\include\", " + "/I \"p:\\poco\\Foundation\\include\", " + "/I \"p:\\poco\\XML\\include\", " + "/I \"p:\\poco\\Util\\include\", " + "/I \"p:\\poco\\Net\\include\", " + "/D \"WIN32\", " + "/D \"_DEBUG\", " + "/D \"_WINDOWS\", " + "/D \"_MBCS\", " + "/C, /P, /TP"); +std::string path("C:\\Program Files\\Microsoft Visual Studio 8\\Common7\\IDE;C:\\Program Files\\Microsoft Visual Studio 8\\VC\\BIN;C:\\Program Files\\Microsoft Visual Studio 8\\Common7\\Tools;;C:\\Program Files\\Microsoft Visual Studio 8\\Common7\\Tools\\bin"); + + +CodeGenerationTest::CodeGenerationTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +CodeGenerationTest::~CodeGenerationTest() +{ +} + + +void CodeGenerationTest::testA() +{ +} + + +void CodeGenerationTest::testB() +{ + // add code for second test here +} + + +void CodeGenerationTest::setUp() +{ +} + + +void CodeGenerationTest::tearDown() +{ +} + + +CppUnit::Test* CodeGenerationTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("CodeGenerationTest"); + + CppUnit_addTest(pSuite, CodeGenerationTest, testA); + CppUnit_addTest(pSuite, CodeGenerationTest, testB); + + return pSuite; +} diff --git a/CodeGeneration/testsuite/src/CodeGenerationTest.h b/CodeGeneration/testsuite/src/CodeGenerationTest.h new file mode 100644 index 0000000000..61cf616171 --- /dev/null +++ b/CodeGeneration/testsuite/src/CodeGenerationTest.h @@ -0,0 +1,40 @@ +// +// CodeGenerationTest.h +// +// Definition of the CodeGenerationTest class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef CodeGenerationTest_INCLUDED +#define CodeGenerationTest_INCLUDED + + +#ifndef CppUnit_TestCase_INCLUDED +#include "CppUnit/TestCase.h" +#endif + + +class CodeGenerationTest: public CppUnit::TestCase +{ +public: + CodeGenerationTest(const std::string& name); + ~CodeGenerationTest(); + + void testA(); + void testB(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // CodeGenerationTest_INCLUDED diff --git a/CodeGeneration/testsuite/src/CodeGenerationTestSuite.cpp b/CodeGeneration/testsuite/src/CodeGenerationTestSuite.cpp new file mode 100644 index 0000000000..9c544fdb42 --- /dev/null +++ b/CodeGeneration/testsuite/src/CodeGenerationTestSuite.cpp @@ -0,0 +1,22 @@ +// +// CodeGenerationTestSuite.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "CodeGenerationTestSuite.h" +#include "CodeGenerationTest.h" + + +CppUnit::Test* CodeGenerationTestSuite::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("CodeGenerationTestSuite"); + + pSuite->addTest(CodeGenerationTest::suite()); + + return pSuite; +} diff --git a/CodeGeneration/testsuite/src/CodeGenerationTestSuite.h b/CodeGeneration/testsuite/src/CodeGenerationTestSuite.h new file mode 100644 index 0000000000..cdb449ce89 --- /dev/null +++ b/CodeGeneration/testsuite/src/CodeGenerationTestSuite.h @@ -0,0 +1,29 @@ +// +// CodeGenerationTestSuite.h +// +// Definition of the CodeGenerationTestSuite class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef CodeGenerationTestSuite_INCLUDED +#define CodeGenerationTestSuite_INCLUDED + + +#ifndef CppUnit_TestSuite_INCLUDED +#include "CppUnit/TestSuite.h" +#endif + + +class CodeGenerationTestSuite +{ +public: + static CppUnit::Test* suite(); +}; + + +#endif // CodeGenerationTestSuite_INCLUDED diff --git a/CodeGeneration/testsuite/src/Driver.cpp b/CodeGeneration/testsuite/src/Driver.cpp new file mode 100644 index 0000000000..b9e50dc069 --- /dev/null +++ b/CodeGeneration/testsuite/src/Driver.cpp @@ -0,0 +1,17 @@ +// +// Driver.cpp +// +// Console-based test driver for Poco CodeGeneration. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "CppUnit/TestRunner.h" +#include "CodeGenerationTestSuite.h" + + +CppUnitMain(CodeGenerationTestSuite) diff --git a/CodeGeneration/testsuite/src/WinDriver.cpp b/CodeGeneration/testsuite/src/WinDriver.cpp new file mode 100644 index 0000000000..953846a781 --- /dev/null +++ b/CodeGeneration/testsuite/src/WinDriver.cpp @@ -0,0 +1,28 @@ +// +// WinDriver.cpp +// +// Windows test driver for Poco CodeGeneration. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "WinTestRunner/WinTestRunner.h" +#include "CodeGenerationTestSuite.h" + + +class TestDriver: public CppUnit::WinTestRunnerApp +{ + void TestMain() + { + CppUnit::WinTestRunner runner; + runner.addTest(CodeGenerationTestSuite::suite()); + runner.run(); + } +}; + + +TestDriver theDriver; From dee32211ea0c29b6e0dcca962f792e63b5a58cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Tue, 15 Sep 2026 13:11:46 +0200 Subject: [PATCH 02/14] feat(RemotingNG): add RemotingNG library and RemoteGenNG from macchina.io #5447 Flat import of platform/RemotingNG from macchina.io (state of 2026-09-09); the Applied Informatics changes since the common base follow as separate commits. Co-Authored-By: Aleksandar Fabijanic Co-Authored-By: Matej Kenda Co-Authored-By: Florian Behrens --- RemotingNG/CMakeLists.txt | 43 + RemotingNG/HTTP/CMakeLists.txt | 37 + RemotingNG/HTTP/Makefile | 16 + .../HTTP/cmake/PocoRemotingNGHTTPConfig.cmake | 5 + RemotingNG/HTTP/dependencies | 3 + ...0250-RemotingNGHTTPTransportUserGuide.page | 195 + .../HTTP/include/Poco/RemotingNG/HTTP/HTTP.h | 62 + .../Poco/RemotingNG/HTTP/HTTPRequestHandler.h | 58 + .../HTTP/HTTPRequestHandlerFactory.h | 57 + .../include/Poco/RemotingNG/HTTP/Listener.h | 137 + .../include/Poco/RemotingNG/HTTP/Transport.h | 252 + .../Poco/RemotingNG/HTTP/TransportFactory.h | 55 + RemotingNG/HTTP/src/HTTPRequestHandler.cpp | 317 + .../HTTP/src/HTTPRequestHandlerFactory.cpp | 44 + RemotingNG/HTTP/src/Listener.cpp | 125 + RemotingNG/HTTP/src/Transport.cpp | 410 + RemotingNG/HTTP/src/TransportFactory.cpp | 58 + RemotingNG/HTTP/testsuite/CMakeLists.txt | 32 + RemotingNG/HTTP/testsuite/Makefile | 26 + RemotingNG/HTTP/testsuite/RemoteGen.xml | 18 + .../HTTP/testsuite/src/Class1Deserializer.h | 66 + .../HTTP/testsuite/src/Class1Serializer.h | 55 + RemotingNG/HTTP/testsuite/src/Driver.cpp | 19 + .../HTTP/testsuite/src/HTTPTestSuite.cpp | 28 + RemotingNG/HTTP/testsuite/src/HTTPTestSuite.h | 29 + RemotingNG/HTTP/testsuite/src/ITester.cpp | 33 + RemotingNG/HTTP/testsuite/src/ITester.h | 126 + .../HTTP/testsuite/src/RemotingTest.cpp | 1068 + RemotingNG/HTTP/testsuite/src/RemotingTest.h | 156 + .../HTTP/testsuite/src/Struct1Deserializer.h | 66 + .../HTTP/testsuite/src/Struct1Serializer.h | 57 + .../HTTP/testsuite/src/Struct2Deserializer.h | 65 + .../HTTP/testsuite/src/Struct2Serializer.h | 61 + .../HTTP/testsuite/src/Struct3Deserializer.h | 68 + .../HTTP/testsuite/src/Struct3Serializer.h | 64 + .../HTTP/testsuite/src/Struct4Deserializer.h | 61 + .../HTTP/testsuite/src/Struct4Serializer.h | 59 + .../HTTP/testsuite/src/Struct5Deserializer.h | 57 + .../HTTP/testsuite/src/Struct5Serializer.h | 53 + RemotingNG/HTTP/testsuite/src/Tester.cpp | 269 + RemotingNG/HTTP/testsuite/src/Tester.h | 292 + .../HTTP/testsuite/src/TesterClientHelper.cpp | 55 + .../HTTP/testsuite/src/TesterClientHelper.h | 72 + RemotingNG/HTTP/testsuite/src/TesterProxy.cpp | 1115 + RemotingNG/HTTP/testsuite/src/TesterProxy.h | 145 + .../HTTP/testsuite/src/TesterProxyFactory.cpp | 32 + .../HTTP/testsuite/src/TesterProxyFactory.h | 38 + .../HTTP/testsuite/src/TesterRemoteObject.cpp | 34 + .../HTTP/testsuite/src/TesterRemoteObject.h | 387 + .../HTTP/testsuite/src/TesterServerHelper.cpp | 79 + .../HTTP/testsuite/src/TesterServerHelper.h | 105 + .../HTTP/testsuite/src/TesterSkeleton.cpp | 2665 ++ .../HTTP/testsuite/src/TesterSkeleton.h | 44 + RemotingNG/HTTP/testsuite/src/WinDriver.cpp | 30 + RemotingNG/JSONRPC/CMakeLists.txt | 37 + RemotingNG/JSONRPC/Makefile | 17 + .../cmake/PocoRemotingNGJSONRPCConfig.cmake | 5 + RemotingNG/JSONRPC/dependencies | 3 + ...0-RemotingNGJSONRPCTransportUserGuide.page | 245 + .../Poco/RemotingNG/JSONRPC/CookieStore.h | 84 + .../Poco/RemotingNG/JSONRPC/Deserializer.h | 108 + .../include/Poco/RemotingNG/JSONRPC/JSArray.h | 65 + .../Poco/RemotingNG/JSONRPC/JSONParser.h | 106 + .../include/Poco/RemotingNG/JSONRPC/JSONRPC.h | 62 + .../JSONRPC/JSONRPCRequestHandler.h | 61 + .../JSONRPC/JSONRPCRequestHandlerFactory.h | 57 + .../Poco/RemotingNG/JSONRPC/JSObject.h | 64 + .../Poco/RemotingNG/JSONRPC/JSScalar.h | 61 + .../include/Poco/RemotingNG/JSONRPC/JSValue.h | 136 + .../Poco/RemotingNG/JSONRPC/Listener.h | 176 + .../Poco/RemotingNG/JSONRPC/Serializer.h | 218 + .../Poco/RemotingNG/JSONRPC/Transport.h | 290 + .../RemotingNG/JSONRPC/TransportFactory.h | 56 + RemotingNG/JSONRPC/src/CookieStore.cpp | 83 + RemotingNG/JSONRPC/src/Deserializer.cpp | 475 + RemotingNG/JSONRPC/src/JSArray.cpp | 71 + RemotingNG/JSONRPC/src/JSONParser.cpp | 247 + .../JSONRPC/src/JSONRPCRequestHandler.cpp | 350 + .../src/JSONRPCRequestHandlerFactory.cpp | 44 + RemotingNG/JSONRPC/src/JSObject.cpp | 69 + RemotingNG/JSONRPC/src/JSScalar.cpp | 55 + RemotingNG/JSONRPC/src/JSValue.cpp | 68 + RemotingNG/JSONRPC/src/Listener.cpp | 140 + RemotingNG/JSONRPC/src/Serializer.cpp | 314 + RemotingNG/JSONRPC/src/Transport.cpp | 454 + RemotingNG/JSONRPC/src/TransportFactory.cpp | 58 + RemotingNG/JSONRPC/testsuite/CMakeLists.txt | 32 + RemotingNG/JSONRPC/testsuite/Makefile | 29 + RemotingNG/JSONRPC/testsuite/RemoteGen.xml | 18 + .../testsuite/src/Class1Deserializer.h | 66 + .../JSONRPC/testsuite/src/Class1Serializer.h | 55 + .../testsuite/src/DeserializerTest.cpp | 484 + .../JSONRPC/testsuite/src/DeserializerTest.h | 53 + RemotingNG/JSONRPC/testsuite/src/Driver.cpp | 19 + RemotingNG/JSONRPC/testsuite/src/ITester.cpp | 33 + RemotingNG/JSONRPC/testsuite/src/ITester.h | 126 + .../JSONRPC/testsuite/src/JSONParserTest.cpp | 356 + .../JSONRPC/testsuite/src/JSONParserTest.h | 60 + .../testsuite/src/JSONRPCTestSuite.cpp | 34 + .../JSONRPC/testsuite/src/JSONRPCTestSuite.h | 29 + .../JSONRPC/testsuite/src/RemotingTest.cpp | 1068 + .../JSONRPC/testsuite/src/RemotingTest.h | 157 + .../JSONRPC/testsuite/src/SerializerTest.cpp | 380 + .../JSONRPC/testsuite/src/SerializerTest.h | 51 + .../testsuite/src/Struct1Deserializer.h | 66 + .../JSONRPC/testsuite/src/Struct1Serializer.h | 57 + .../testsuite/src/Struct2Deserializer.h | 65 + .../JSONRPC/testsuite/src/Struct2Serializer.h | 61 + .../testsuite/src/Struct3Deserializer.h | 68 + .../JSONRPC/testsuite/src/Struct3Serializer.h | 64 + .../testsuite/src/Struct4Deserializer.h | 61 + .../JSONRPC/testsuite/src/Struct4Serializer.h | 59 + .../testsuite/src/Struct5Deserializer.h | 57 + .../JSONRPC/testsuite/src/Struct5Serializer.h | 53 + RemotingNG/JSONRPC/testsuite/src/Tester.cpp | 269 + RemotingNG/JSONRPC/testsuite/src/Tester.h | 292 + .../testsuite/src/TesterClientHelper.cpp | 55 + .../testsuite/src/TesterClientHelper.h | 72 + .../JSONRPC/testsuite/src/TesterProxy.cpp | 1115 + .../JSONRPC/testsuite/src/TesterProxy.h | 145 + .../testsuite/src/TesterProxyFactory.cpp | 32 + .../testsuite/src/TesterProxyFactory.h | 38 + .../testsuite/src/TesterRemoteObject.cpp | 34 + .../testsuite/src/TesterRemoteObject.h | 387 + .../testsuite/src/TesterServerHelper.cpp | 79 + .../testsuite/src/TesterServerHelper.h | 105 + .../JSONRPC/testsuite/src/TesterSkeleton.cpp | 2665 ++ .../JSONRPC/testsuite/src/TesterSkeleton.h | 44 + .../JSONRPC/testsuite/src/WinDriver.cpp | 30 + RemotingNG/Makefile | 26 + RemotingNG/REST/CMakeLists.txt | 41 + RemotingNG/REST/Makefile | 25 + .../REST/cmake/PocoRemotingNGRESTConfig.cmake | 5 + RemotingNG/REST/dependencies | 3 + ...0240-RemotingNGRESTTransportUserGuide.page | 571 + .../Poco/RemotingNG/REST/CookieStore.h | 84 + .../Poco/RemotingNG/REST/Deserializer.h | 129 + .../Poco/RemotingNG/REST/FormDeserializer.h | 80 + .../Poco/RemotingNG/REST/FormSerializer.h | 76 + .../Poco/RemotingNG/REST/HeaderDeserializer.h | 62 + .../Poco/RemotingNG/REST/HeaderSerializer.h | 56 + .../include/Poco/RemotingNG/REST/JSArray.h | 65 + .../Poco/RemotingNG/REST/JSONDeserializer.h | 101 + .../include/Poco/RemotingNG/REST/JSONParser.h | 106 + .../Poco/RemotingNG/REST/JSONSerializer.h | 111 + .../include/Poco/RemotingNG/REST/JSObject.h | 64 + .../include/Poco/RemotingNG/REST/JSScalar.h | 61 + .../include/Poco/RemotingNG/REST/JSValue.h | 136 + .../include/Poco/RemotingNG/REST/Listener.h | 217 + .../Poco/RemotingNG/REST/PathDeserializer.h | 73 + .../Poco/RemotingNG/REST/PathSerializer.h | 69 + .../REST/include/Poco/RemotingNG/REST/REST.h | 62 + .../Poco/RemotingNG/REST/RESTRequestHandler.h | 61 + .../REST/RESTRequestHandlerFactory.h | 57 + .../RemotingNG/REST/RESTServerException.h | 113 + .../Poco/RemotingNG/REST/RawDeserializer.h | 88 + .../Poco/RemotingNG/REST/RawSerializer.h | 90 + .../Poco/RemotingNG/REST/ScalarDeserializer.h | 86 + .../Poco/RemotingNG/REST/ScalarSerializer.h | 89 + .../include/Poco/RemotingNG/REST/Serializer.h | 140 + .../include/Poco/RemotingNG/REST/Transport.h | 294 + .../Poco/RemotingNG/REST/TransportFactory.h | 56 + RemotingNG/REST/src/CookieStore.cpp | 86 + RemotingNG/REST/src/Deserializer.cpp | 311 + RemotingNG/REST/src/FormDeserializer.cpp | 148 + RemotingNG/REST/src/FormSerializer.cpp | 155 + RemotingNG/REST/src/HeaderDeserializer.cpp | 71 + RemotingNG/REST/src/HeaderSerializer.cpp | 42 + RemotingNG/REST/src/JSArray.cpp | 71 + RemotingNG/REST/src/JSONDeserializer.cpp | 502 + RemotingNG/REST/src/JSONParser.cpp | 247 + RemotingNG/REST/src/JSONSerializer.cpp | 348 + RemotingNG/REST/src/JSObject.cpp | 69 + RemotingNG/REST/src/JSScalar.cpp | 55 + RemotingNG/REST/src/JSValue.cpp | 68 + RemotingNG/REST/src/Listener.cpp | 165 + RemotingNG/REST/src/PathDeserializer.cpp | 117 + RemotingNG/REST/src/PathSerializer.cpp | 92 + RemotingNG/REST/src/RESTRequestHandler.cpp | 405 + .../REST/src/RESTRequestHandlerFactory.cpp | 44 + RemotingNG/REST/src/RESTServerException.cpp | 112 + RemotingNG/REST/src/RawDeserializer.cpp | 336 + RemotingNG/REST/src/RawSerializer.cpp | 217 + RemotingNG/REST/src/ScalarDeserializer.cpp | 333 + RemotingNG/REST/src/ScalarSerializer.cpp | 214 + RemotingNG/REST/src/Serializer.cpp | 395 + RemotingNG/REST/src/Transport.cpp | 481 + RemotingNG/REST/src/TransportFactory.cpp | 58 + RemotingNG/REST/testsuite/CMakeLists.txt | 32 + RemotingNG/REST/testsuite/Makefile | 46 + RemotingNG/REST/testsuite/RemoteGen.xml | 18 + .../testsuite/src/AuthTesterClientHelper.cpp | 55 + .../testsuite/src/AuthTesterClientHelper.h | 72 + .../REST/testsuite/src/AuthTesterProxy.cpp | 88 + .../REST/testsuite/src/AuthTesterProxy.h | 53 + .../testsuite/src/AuthTesterProxyFactory.cpp | 32 + .../testsuite/src/AuthTesterProxyFactory.h | 38 + .../testsuite/src/AuthTesterRemoteObject.cpp | 34 + .../testsuite/src/AuthTesterRemoteObject.h | 65 + .../testsuite/src/AuthTesterServerHelper.cpp | 81 + .../testsuite/src/AuthTesterServerHelper.h | 105 + .../REST/testsuite/src/AuthTesterSkeleton.cpp | 178 + .../REST/testsuite/src/AuthTesterSkeleton.h | 44 + .../REST/testsuite/src/DeserializerTest.cpp | 271 + .../REST/testsuite/src/DeserializerTest.h | 46 + RemotingNG/REST/testsuite/src/Driver.cpp | 19 + .../testsuite/src/FormDeserializerTest.cpp | 181 + .../REST/testsuite/src/FormDeserializerTest.h | 44 + .../REST/testsuite/src/FormSerializerTest.cpp | 175 + .../REST/testsuite/src/FormSerializerTest.h | 46 + .../testsuite/src/HeaderDeserializerTest.cpp | 103 + .../testsuite/src/HeaderDeserializerTest.h | 41 + .../testsuite/src/HeaderSerializerTest.cpp | 79 + .../REST/testsuite/src/HeaderSerializerTest.h | 41 + RemotingNG/REST/testsuite/src/IAuthTester.cpp | 33 + RemotingNG/REST/testsuite/src/IAuthTester.h | 46 + RemotingNG/REST/testsuite/src/ITester.cpp | 33 + RemotingNG/REST/testsuite/src/ITester.h | 50 + .../testsuite/src/JSONDeserializerTest.cpp | 331 + .../REST/testsuite/src/JSONDeserializerTest.h | 50 + .../REST/testsuite/src/JSONParserTest.cpp | 356 + .../REST/testsuite/src/JSONParserTest.h | 60 + .../REST/testsuite/src/JSONSerializerTest.cpp | 219 + .../REST/testsuite/src/JSONSerializerTest.h | 47 + .../REST/testsuite/src/ObjectDeserializer.h | 57 + .../REST/testsuite/src/ObjectSerializer.h | 53 + .../testsuite/src/PathDeserializerTest.cpp | 144 + .../REST/testsuite/src/PathDeserializerTest.h | 43 + .../REST/testsuite/src/PathSerializerTest.cpp | 118 + .../REST/testsuite/src/PathSerializerTest.h | 44 + .../REST/testsuite/src/RESTTestSuite.cpp | 55 + RemotingNG/REST/testsuite/src/RESTTestSuite.h | 29 + .../testsuite/src/RawDeserializerTest.cpp | 97 + .../REST/testsuite/src/RawDeserializerTest.h | 42 + .../REST/testsuite/src/RawSerializerTest.cpp | 97 + .../REST/testsuite/src/RawSerializerTest.h | 42 + .../REST/testsuite/src/RemotingTest.cpp | 762 + RemotingNG/REST/testsuite/src/RemotingTest.h | 165 + .../REST/testsuite/src/SerializerTest.cpp | 271 + .../REST/testsuite/src/SerializerTest.h | 46 + RemotingNG/REST/testsuite/src/Tester.cpp | 104 + RemotingNG/REST/testsuite/src/Tester.h | 80 + .../REST/testsuite/src/TesterClientHelper.cpp | 55 + .../REST/testsuite/src/TesterClientHelper.h | 72 + RemotingNG/REST/testsuite/src/TesterProxy.cpp | 136 + RemotingNG/REST/testsuite/src/TesterProxy.h | 58 + .../REST/testsuite/src/TesterProxyFactory.cpp | 32 + .../REST/testsuite/src/TesterProxyFactory.h | 38 + .../REST/testsuite/src/TesterRemoteObject.cpp | 34 + .../REST/testsuite/src/TesterRemoteObject.h | 81 + .../REST/testsuite/src/TesterServerHelper.cpp | 81 + .../REST/testsuite/src/TesterServerHelper.h | 105 + .../REST/testsuite/src/TesterSkeleton.cpp | 298 + .../REST/testsuite/src/TesterSkeleton.h | 44 + RemotingNG/REST/testsuite/src/WinDriver.cpp | 30 + RemotingNG/RemoteGen/CMakeLists.txt | 46 + RemotingNG/RemoteGen/Makefile | 21 + RemotingNG/RemoteGen/RemoteGenNG.xml | 64 + RemotingNG/RemoteGen/RemoteGenNG.xml.install | 54 + RemotingNG/RemoteGen/dependencies | 7 + .../RemoteGen/src/AbstractGenerator.cpp | 759 + RemotingNG/RemoteGen/src/AbstractGenerator.h | 253 + .../src/BundleActivatorGenerator.cpp | 653 + .../RemoteGen/src/BundleActivatorGenerator.h | 98 + .../RemoteGen/src/ClientHelperGenerator.cpp | 230 + .../RemoteGen/src/ClientHelperGenerator.h | 69 + .../RemoteGen/src/DeserializerGenerator.cpp | 837 + .../RemoteGen/src/DeserializerGenerator.h | 98 + .../src/EventDispatcherGenerator.cpp | 1095 + .../RemoteGen/src/EventDispatcherGenerator.h | 147 + .../src/EventSubscriberGenerator.cpp | 846 + .../RemoteGen/src/EventSubscriberGenerator.h | 126 + .../RemoteGen/src/ExtensionsGenerator.cpp | 44 + .../RemoteGen/src/ExtensionsGenerator.h | 39 + RemotingNG/RemoteGen/src/GenUtility.cpp | 592 + RemotingNG/RemoteGen/src/GenUtility.h | 164 + .../RemoteGen/src/InterfaceGenerator.cpp | 337 + RemotingNG/RemoteGen/src/InterfaceGenerator.h | 82 + .../RemoteGen/src/ProxyFactoryGenerator.cpp | 116 + .../RemoteGen/src/ProxyFactoryGenerator.h | 63 + RemotingNG/RemoteGen/src/ProxyGenerator.cpp | 1513 + RemotingNG/RemoteGen/src/ProxyGenerator.h | 157 + .../RemoteGen/src/RemoteBridgeGenerator.cpp | 392 + .../RemoteGen/src/RemoteBridgeGenerator.h | 98 + RemotingNG/RemoteGen/src/RemoteGen.cpp | 1151 + .../RemoteGen/src/RemoteObjectGenerator.cpp | 389 + .../RemoteGen/src/RemoteObjectGenerator.h | 97 + .../RemoteGen/src/SerializerGenerator.cpp | 864 + .../RemoteGen/src/SerializerGenerator.h | 126 + .../RemoteGen/src/ServerHelperGenerator.cpp | 479 + .../RemoteGen/src/ServerHelperGenerator.h | 82 + .../RemoteGen/src/SkeletonGenerator.cpp | 1133 + RemotingNG/RemoteGen/src/SkeletonGenerator.h | 118 + RemotingNG/RemoteGen/src/SwaggerGenerator.cpp | 1156 + RemotingNG/RemoteGen/src/SwaggerGenerator.h | 115 + RemotingNG/RemoteGen/src/WSDLGenerator.cpp | 562 + RemotingNG/RemoteGen/src/WSDLGenerator.h | 173 + RemotingNG/RemoteGen/src/XSDGenerator.cpp | 965 + RemotingNG/RemoteGen/src/XSDGenerator.h | 148 + RemotingNG/SOAP/CMakeLists.txt | 37 + RemotingNG/SOAP/Makefile | 26 + .../SOAP/cmake/PocoRemotingNGSOAPConfig.cmake | 5 + RemotingNG/SOAP/dependencies | 5 + ...0220-RemotingNGSOAPTransportUserGuide.page | 378 + .../Poco/RemotingNG/SOAP/CookieStore.h | 84 + .../Poco/RemotingNG/SOAP/Deserializer.h | 203 + .../include/Poco/RemotingNG/SOAP/Listener.h | 199 + .../SOAP/include/Poco/RemotingNG/SOAP/SOAP.h | 60 + .../Poco/RemotingNG/SOAP/SOAPContentHandler.h | 86 + .../Poco/RemotingNG/SOAP/SOAPFaultException.h | 104 + .../Poco/RemotingNG/SOAP/SOAPRequestHandler.h | 62 + .../include/Poco/RemotingNG/SOAP/Serializer.h | 329 + .../include/Poco/RemotingNG/SOAP/Transport.h | 342 + .../Poco/RemotingNG/SOAP/TransportFactory.h | 63 + .../Poco/RemotingNG/SOAP/WSDLRequestHandler.h | 58 + .../include/Poco/RemotingNG/SOAP/XMLElement.h | 144 + RemotingNG/SOAP/src/CookieStore.cpp | 83 + RemotingNG/SOAP/src/Deserializer.cpp | 844 + RemotingNG/SOAP/src/Listener.cpp | 182 + RemotingNG/SOAP/src/SOAPContentHandler.cpp | 104 + RemotingNG/SOAP/src/SOAPFaultException.cpp | 136 + RemotingNG/SOAP/src/SOAPRequestHandler.cpp | 439 + RemotingNG/SOAP/src/Serializer.cpp | 1149 + RemotingNG/SOAP/src/Transport.cpp | 655 + RemotingNG/SOAP/src/TransportFactory.cpp | 63 + RemotingNG/SOAP/src/WSDLRequestHandler.cpp | 82 + RemotingNG/SOAP/src/XMLElement.cpp | 91 + RemotingNG/SOAP/testsuite/CMakeLists.txt | 32 + RemotingNG/SOAP/testsuite/Makefile | 28 + RemotingNG/SOAP/testsuite/RemoteGen.xml | 18 + .../SOAP/testsuite/src/Class1Deserializer.h | 66 + .../SOAP/testsuite/src/Class1Serializer.h | 55 + .../SOAP/testsuite/src/DeserializerTest.cpp | 1176 + .../SOAP/testsuite/src/DeserializerTest.h | 78 + RemotingNG/SOAP/testsuite/src/Driver.cpp | 19 + RemotingNG/SOAP/testsuite/src/ITester.cpp | 33 + RemotingNG/SOAP/testsuite/src/ITester.h | 126 + .../SOAP/testsuite/src/RemotingTest.cpp | 1436 + RemotingNG/SOAP/testsuite/src/RemotingTest.h | 190 + .../SOAP/testsuite/src/SOAPTestSuite.cpp | 34 + RemotingNG/SOAP/testsuite/src/SOAPTestSuite.h | 29 + .../SOAP/testsuite/src/SerializerTest.cpp | 1062 + .../SOAP/testsuite/src/SerializerTest.h | 80 + .../SOAP/testsuite/src/Struct1Deserializer.h | 66 + .../SOAP/testsuite/src/Struct1Serializer.h | 57 + .../SOAP/testsuite/src/Struct2Deserializer.h | 65 + .../SOAP/testsuite/src/Struct2Serializer.h | 61 + .../SOAP/testsuite/src/Struct3Deserializer.h | 68 + .../SOAP/testsuite/src/Struct3Serializer.h | 64 + .../SOAP/testsuite/src/Struct4Deserializer.h | 61 + .../SOAP/testsuite/src/Struct4Serializer.h | 59 + .../SOAP/testsuite/src/Struct5Deserializer.h | 57 + .../SOAP/testsuite/src/Struct5Serializer.h | 53 + RemotingNG/SOAP/testsuite/src/Tester.cpp | 269 + RemotingNG/SOAP/testsuite/src/Tester.h | 292 + .../SOAP/testsuite/src/TesterClientHelper.cpp | 55 + .../SOAP/testsuite/src/TesterClientHelper.h | 72 + RemotingNG/SOAP/testsuite/src/TesterProxy.cpp | 1115 + RemotingNG/SOAP/testsuite/src/TesterProxy.h | 145 + .../SOAP/testsuite/src/TesterProxyFactory.cpp | 32 + .../SOAP/testsuite/src/TesterProxyFactory.h | 38 + .../SOAP/testsuite/src/TesterRemoteObject.cpp | 34 + .../SOAP/testsuite/src/TesterRemoteObject.h | 387 + .../SOAP/testsuite/src/TesterServerHelper.cpp | 79 + .../SOAP/testsuite/src/TesterServerHelper.h | 105 + .../SOAP/testsuite/src/TesterSkeleton.cpp | 2665 ++ .../SOAP/testsuite/src/TesterSkeleton.h | 44 + RemotingNG/SOAP/testsuite/src/WinDriver.cpp | 30 + RemotingNG/TCP/CMakeLists.txt | 37 + RemotingNG/TCP/Makefile | 32 + .../TCP/cmake/PocoRemotingNGTCPConfig.cmake | 5 + RemotingNG/TCP/dependencies | 3 + ...00210-RemotingNGTCPTransportUserGuide.page | 443 + .../Poco/RemotingNG/TCP/ChannelStream.h | 97 + .../Poco/RemotingNG/TCP/ClientAuthenticator.h | 62 + .../include/Poco/RemotingNG/TCP/Connection.h | 320 + .../Poco/RemotingNG/TCP/ConnectionManager.h | 157 + .../Poco/RemotingNG/TCP/CredentialsStore.h | 72 + .../TCP/include/Poco/RemotingNG/TCP/Frame.h | 360 + .../Poco/RemotingNG/TCP/FrameFactory.h | 62 + .../Poco/RemotingNG/TCP/FrameHandler.h | 56 + .../include/Poco/RemotingNG/TCP/FrameQueue.h | 76 + .../include/Poco/RemotingNG/TCP/Listener.h | 213 + .../RemotingNG/TCP/PlainClientAuthenticator.h | 57 + .../Poco/RemotingNG/TCP/SCRAMAuthenticator.h | 129 + .../RemotingNG/TCP/SCRAMClientAuthenticator.h | 86 + .../Poco/RemotingNG/TCP/ServerConnection.h | 57 + .../RemotingNG/TCP/ServerConnectionFactory.h | 52 + .../Poco/RemotingNG/TCP/ServerTransport.h | 87 + .../Poco/RemotingNG/TCP/SocketFactory.h | 69 + .../TCP/include/Poco/RemotingNG/TCP/TCP.h | 58 + .../TCP/include/Poco/RemotingNG/TCP/Timer.h | 137 + .../include/Poco/RemotingNG/TCP/Transport.h | 130 + .../Poco/RemotingNG/TCP/TransportFactory.h | 68 + RemotingNG/TCP/src/ChannelStream.cpp | 206 + RemotingNG/TCP/src/Connection.cpp | 576 + RemotingNG/TCP/src/ConnectionManager.cpp | 224 + RemotingNG/TCP/src/CredentialsStore.cpp | 76 + RemotingNG/TCP/src/Frame.cpp | 40 + RemotingNG/TCP/src/FrameQueue.cpp | 91 + RemotingNG/TCP/src/Listener.cpp | 390 + .../TCP/src/PlainClientAuthenticator.cpp | 48 + RemotingNG/TCP/src/SCRAMAuthenticator.cpp | 195 + .../TCP/src/SCRAMClientAuthenticator.cpp | 118 + RemotingNG/TCP/src/ServerConnection.cpp | 295 + .../TCP/src/ServerConnectionFactory.cpp | 41 + RemotingNG/TCP/src/ServerTransport.cpp | 202 + RemotingNG/TCP/src/SocketFactory.cpp | 51 + RemotingNG/TCP/src/Timer.cpp | 249 + RemotingNG/TCP/src/Transport.cpp | 502 + RemotingNG/TCP/src/TransportFactory.cpp | 67 + RemotingNG/TCP/testsuite/CMakeLists.txt | 32 + RemotingNG/TCP/testsuite/Makefile | 28 + RemotingNG/TCP/testsuite/RemoteGen.xml | 18 + .../TCP/testsuite/src/Class1Deserializer.h | 66 + .../TCP/testsuite/src/Class1Serializer.h | 55 + RemotingNG/TCP/testsuite/src/Driver.cpp | 17 + RemotingNG/TCP/testsuite/src/ITester.cpp | 35 + RemotingNG/TCP/testsuite/src/ITester.h | 143 + RemotingNG/TCP/testsuite/src/RemotingTest.cpp | 1199 + RemotingNG/TCP/testsuite/src/RemotingTest.h | 109 + .../TCP/testsuite/src/Struct1Deserializer.h | 66 + .../TCP/testsuite/src/Struct1Serializer.h | 57 + .../TCP/testsuite/src/Struct2Deserializer.h | 65 + .../TCP/testsuite/src/Struct2Serializer.h | 61 + .../TCP/testsuite/src/Struct3Deserializer.h | 68 + .../TCP/testsuite/src/Struct3Serializer.h | 64 + .../TCP/testsuite/src/Struct4Deserializer.h | 61 + .../TCP/testsuite/src/Struct4Serializer.h | 59 + .../TCP/testsuite/src/Struct5Deserializer.h | 57 + .../TCP/testsuite/src/Struct5Serializer.h | 53 + RemotingNG/TCP/testsuite/src/TCPTestSuite.cpp | 23 + RemotingNG/TCP/testsuite/src/TCPTestSuite.h | 27 + RemotingNG/TCP/testsuite/src/Tester.cpp | 270 + RemotingNG/TCP/testsuite/src/Tester.h | 303 + .../TCP/testsuite/src/TesterClientHelper.cpp | 55 + .../TCP/testsuite/src/TesterClientHelper.h | 72 + .../testsuite/src/TesterEventDispatcher.cpp | 201 + .../TCP/testsuite/src/TesterEventDispatcher.h | 59 + .../testsuite/src/TesterEventSubscriber.cpp | 189 + .../TCP/testsuite/src/TesterEventSubscriber.h | 52 + RemotingNG/TCP/testsuite/src/TesterProxy.cpp | 1202 + RemotingNG/TCP/testsuite/src/TesterProxy.h | 154 + .../TCP/testsuite/src/TesterProxyFactory.cpp | 32 + .../TCP/testsuite/src/TesterProxyFactory.h | 38 + .../TCP/testsuite/src/TesterRemoteObject.cpp | 80 + .../TCP/testsuite/src/TesterRemoteObject.h | 416 + .../TCP/testsuite/src/TesterServerHelper.cpp | 92 + .../TCP/testsuite/src/TesterServerHelper.h | 119 + .../TCP/testsuite/src/TesterSkeleton.cpp | 2720 ++ RemotingNG/TCP/testsuite/src/TesterSkeleton.h | 44 + RemotingNG/TCP/testsuite/src/WinDriver.cpp | 40 + RemotingNG/cmake/PocoRemotingNGConfig.cmake | 3 + RemotingNG/dependencies | 1 + RemotingNG/doc/00100-RemotingNGOverview.page | 460 + .../doc/00150-RemotingNGTutorialPart1.page | 620 + .../doc/00151-RemotingNGTutorialPart2.page | 780 + .../doc/00152-RemotingNGTutorialPart3.page | 365 + .../doc/00153-RemotingNGTutorialPart4.page | 377 + RemotingNG/doc/00200-RemotingNGUserGuide.page | 1829 ++ .../00300-RemotingNGAttributesReference.page | 563 + .../doc/00400-RemotingNGLimitations.page | 74 + .../doc/99100-RemotingNGReleaseNotes.page | 530 + RemotingNG/doc/Remoting.graffle | 4901 +++ RemotingNG/doc/images/RemoteCall.png | Bin 0 -> 11151 bytes RemotingNG/doc/images/RemotingClasses.png | Bin 0 -> 23347 bytes RemotingNG/doc/images/XSDGen.png | Bin 0 -> 14849 bytes .../Poco/RemotingNG/AttributedObject.h | 106 + .../include/Poco/RemotingNG/Authenticator.h | 181 + .../include/Poco/RemotingNG/Authorizer.h | 76 + .../Poco/RemotingNG/BinaryDeserializer.h | 125 + .../Poco/RemotingNG/BinarySerializer.h | 126 + .../include/Poco/RemotingNG/ClientHelper.h | 99 + RemotingNG/include/Poco/RemotingNG/Context.h | 171 + .../include/Poco/RemotingNG/Credentials.h | 84 + .../include/Poco/RemotingNG/Deserializer.h | 269 + .../include/Poco/RemotingNG/EventDispatcher.h | 179 + .../include/Poco/RemotingNG/EventFilter.h | 446 + .../include/Poco/RemotingNG/EventListener.h | 69 + .../include/Poco/RemotingNG/EventSubscriber.h | 78 + .../include/Poco/RemotingNG/Identifiable.h | 86 + RemotingNG/include/Poco/RemotingNG/Listener.h | 167 + .../include/Poco/RemotingNG/MethodHandler.h | 67 + RemotingNG/include/Poco/RemotingNG/ORB.h | 299 + RemotingNG/include/Poco/RemotingNG/Proxy.h | 112 + .../include/Poco/RemotingNG/ProxyFactory.h | 55 + .../Poco/RemotingNG/ProxyFactoryManager.h | 68 + .../include/Poco/RemotingNG/RemoteObject.h | 84 + .../Poco/RemotingNG/RemotingException.h | 53 + .../include/Poco/RemotingNG/RemotingNG.h | 70 + .../include/Poco/RemotingNG/Serializer.h | 237 + .../include/Poco/RemotingNG/SerializerBase.h | 137 + .../include/Poco/RemotingNG/ServerHelper.h | 103 + .../include/Poco/RemotingNG/ServerTransport.h | 124 + RemotingNG/include/Poco/RemotingNG/Skeleton.h | 86 + .../include/Poco/RemotingNG/Transport.h | 179 + .../Poco/RemotingNG/TransportFactory.h | 53 + .../Poco/RemotingNG/TransportFactoryManager.h | 91 + .../Poco/RemotingNG/TypeDeserializer.h | 634 + .../include/Poco/RemotingNG/TypeSerializer.h | 464 + .../include/Poco/RemotingNG/URIUtility.h | 71 + RemotingNG/samples/CMakeLists.txt | 21 + RemotingNG/samples/CheckVat/CMakeLists.txt | 15 + RemotingNG/samples/CheckVat/Makefile | 30 + RemotingNG/samples/CheckVat/RemoteGen.xml | 21 + RemotingNG/samples/CheckVat/XSDGen.xml | 16 + .../include/CheckVat/CheckVatService.h | 115 + .../CheckVat/CheckVatServiceClientHelper.h | 76 + .../include/CheckVat/CheckVatServiceProxy.h | 55 + .../CheckVat/CheckVatServiceProxyFactory.h | 42 + .../include/CheckVat/ICheckVatService.h | 50 + .../include/CheckVat/Types/CheckVat.h | 85 + .../include/CheckVat/Types/CheckVatApprox.h | 239 + .../CheckVat/Types/CheckVatApproxResponse.h | 394 + .../include/CheckVat/Types/CheckVatResponse.h | 175 + RemotingNG/samples/CheckVat/src/CheckVat.cpp | 38 + .../samples/CheckVat/src/CheckVatApprox.cpp | 52 + .../CheckVat/src/CheckVatApproxResponse.cpp | 66 + .../samples/CheckVat/src/CheckVatClient.cpp | 93 + .../samples/CheckVat/src/CheckVatResponse.cpp | 46 + .../samples/CheckVat/src/CheckVatService.cpp | 23 + .../src/CheckVatServiceClientHelper.cpp | 60 + .../CheckVat/src/CheckVatServiceProxy.cpp | 121 + .../src/CheckVatServiceProxyFactory.cpp | 37 + .../samples/CheckVat/src/ICheckVatService.cpp | 38 + .../CheckVat/wsdl/checkVatService.wsdl | 164 + .../samples/ConvertTemperature/CMakeLists.txt | 15 + .../samples/ConvertTemperature/Makefile | 23 + .../samples/ConvertTemperature/RemoteGen.xml | 21 + .../samples/ConvertTemperature/XSDGen.xml | 12 + .../include/WebServiceX/ConvertTemp.h | 105 + .../include/WebServiceX/ConvertTempResponse.h | 61 + .../include/WebServiceX/ConvertTemperature.h | 49 + .../ConvertTemperatureClientHelper.h | 76 + .../WebServiceX/ConvertTemperatureProxy.h | 53 + .../ConvertTemperatureProxyFactory.h | 42 + .../include/WebServiceX/IConvertTemperature.h | 48 + .../ConvertTemperature/src/ConvertTemp.cpp | 39 + .../src/ConvertTempResponse.cpp | 35 + .../src/ConvertTemperature.cpp | 23 + .../src/ConvertTemperatureClient.cpp | 40 + .../src/ConvertTemperatureClientHelper.cpp | 60 + .../src/ConvertTemperatureProxy.cpp | 66 + .../src/ConvertTemperatureProxyFactory.cpp | 37 + .../src/IConvertTemperature.cpp | 38 + .../wsdl/ConvertTemperature.wsdl | 135 + RemotingNG/samples/Makefile | 24 + RemotingNG/samples/ONVIF/CMakeLists.txt | 15 + RemotingNG/samples/ONVIF/Makefile | 16 + RemotingNG/samples/ONVIF/XSDGen.xml | 64 + .../include/OASIS/WSN/B2/CreatePullPoint.h | 43 + .../OASIS/WSN/B2/CreatePullPointResponse.h | 75 + .../include/OASIS/WSN/B2/DestroyPullPoint.h | 43 + .../OASIS/WSN/B2/DestroyPullPointResponse.h | 43 + .../ONVIF/include/OASIS/WSN/B2/Filter.h | 43 + .../include/OASIS/WSN/B2/GetCurrentMessage.h | 75 + .../OASIS/WSN/B2/GetCurrentMessageResponse.h | 43 + .../ONVIF/include/OASIS/WSN/B2/GetMessages.h | 68 + .../OASIS/WSN/B2/GetMessagesResponse.h | 84 + .../include/OASIS/WSN/B2/InvalidFilterFault.h | 89 + .../B2/InvalidMessageContentExpressionFault.h | 51 + ...InvalidProducerPropertiesExpressionFault.h | 51 + .../WSN/B2/InvalidTopicExpressionFault.h | 51 + .../ONVIF/include/OASIS/WSN/B2/Message.h | 43 + .../WSN/B2/MultipleTopicsSpecifiedFault.h | 51 + .../WSN/B2/NoCurrentMessageOnTopicFault.h | 51 + .../OASIS/WSN/B2/NotificationMessageHolder.h | 182 + .../OASIS/WSN/B2/NotificationProducerRP.h | 188 + .../ONVIF/include/OASIS/WSN/B2/Notify.h | 83 + .../WSN/B2/NotifyMessageNotSupportedFault.h | 51 + .../include/OASIS/WSN/B2/PauseFailedFault.h | 51 + .../include/OASIS/WSN/B2/PauseSubscription.h | 43 + .../OASIS/WSN/B2/PauseSubscriptionResponse.h | 43 + .../include/OASIS/WSN/B2/QueryExpression.h | 76 + .../ONVIF/include/OASIS/WSN/B2/Renew.h | 79 + .../include/OASIS/WSN/B2/RenewResponse.h | 114 + .../include/OASIS/WSN/B2/ResumeFailedFault.h | 51 + .../include/OASIS/WSN/B2/ResumeSubscription.h | 43 + .../OASIS/WSN/B2/ResumeSubscriptionResponse.h | 43 + .../ONVIF/include/OASIS/WSN/B2/Subscribe.h | 184 + .../WSN/B2/SubscribeCreationFailedFault.h | 51 + .../include/OASIS/WSN/B2/SubscribeResponse.h | 145 + .../OASIS/WSN/B2/SubscriptionManagerRP.h | 184 + .../include/OASIS/WSN/B2/SubscriptionPolicy.h | 43 + .../include/OASIS/WSN/B2/TopicExpression.h | 76 + .../B2/TopicExpressionDialectUnknownFault.h | 51 + .../OASIS/WSN/B2/TopicNotSupportedFault.h | 51 + .../WSN/B2/UnableToCreatePullPointFault.h | 51 + .../WSN/B2/UnableToDestroyPullPointFault.h | 51 + .../WSN/B2/UnableToDestroySubscriptionFault.h | 51 + .../OASIS/WSN/B2/UnableToGetMessagesFault.h | 51 + .../UnacceptableInitialTerminationTimeFault.h | 120 + .../WSN/B2/UnacceptableTerminationTimeFault.h | 120 + .../WSN/B2/UnrecognizedPolicyRequestFault.h | 90 + .../ONVIF/include/OASIS/WSN/B2/Unsubscribe.h | 43 + .../OASIS/WSN/B2/UnsubscribeResponse.h | 43 + .../WSN/B2/UnsupportedPolicyRequestFault.h | 90 + .../ONVIF/include/OASIS/WSN/B2/UseRaw.h | 43 + .../include/OASIS/WSN/T1/Documentation.h | 43 + .../OASIS/WSN/T1/ExtensibleDocumented.h | 86 + .../include/OASIS/WSN/T1/QueryExpression.h | 76 + .../ONVIF/include/OASIS/WSN/T1/Topic.h | 79 + .../include/OASIS/WSN/T1/TopicNamespace.h | 172 + .../ONVIF/include/OASIS/WSN/T1/TopicSet.h | 46 + .../ONVIF/include/OASIS/WSRF/BF2/BaseFault.h | 227 + .../include/OASIS/WSRF/BF2/Description.h | 76 + .../ONVIF/include/OASIS/WSRF/BF2/ErrorCode.h | 76 + .../ONVIF/include/OASIS/WSRF/BF2/FaultCause.h | 43 + .../ONVIF/include/ONVIF/AACDecOptions.h | 103 + .../ONVIF/include/ONVIF/AbsoluteFocus.h | 87 + .../include/ONVIF/AbsoluteFocusOptions.h | 113 + .../include/ONVIF/ActionEngineEventPayload.h | 181 + .../ONVIF/ActionEngineEventPayloadExtension.h | 41 + .../ONVIF/include/ONVIF/ActiveConnection.h | 86 + .../include/ONVIF/AnalyticsCapabilities.h | 116 + .../ONVIF/AnalyticsDeviceCapabilities.h | 135 + .../AnalyticsDeviceEngineConfiguration.h | 121 + ...lyticsDeviceEngineConfigurationExtension.h | 41 + .../include/ONVIF/AnalyticsDeviceExtension.h | 41 + .../ONVIF/include/ONVIF/AnalyticsEngine.h | 78 + .../ONVIF/AnalyticsEngineConfiguration.h | 122 + .../AnalyticsEngineConfigurationExtension.h | 41 + .../include/ONVIF/AnalyticsEngineControl.h | 278 + .../include/ONVIF/AnalyticsEngineInput.h | 138 + .../include/ONVIF/AnalyticsEngineInputInfo.h | 115 + .../ONVIF/AnalyticsEngineInputInfoExtension.h | 41 + .../ONVIF/include/ONVIF/AnalyticsState.h | 103 + .../include/ONVIF/AnalyticsStateInformation.h | 103 + .../samples/ONVIF/include/ONVIF/AnyHolder.h | 41 + .../ONVIF/include/ONVIF/ArrayOfFileProgress.h | 122 + .../ONVIF/ArrayOfFileProgressExtension.h | 41 + .../ONVIF/include/ONVIF/AttachmentData.h | 107 + .../ONVIF/include/ONVIF/AudioAttributes.h | 116 + .../ONVIF/include/ONVIF/AudioClassCandidate.h | 94 + .../include/ONVIF/AudioClassDescriptor.h | 122 + .../ONVIF/AudioClassDescriptorExtension.h | 41 + .../include/ONVIF/AudioDecoderConfiguration.h | 47 + .../ONVIF/AudioDecoderConfigurationOptions.h | 179 + ...udioDecoderConfigurationOptionsExtension.h | 41 + .../ONVIF/AudioEncoder2Configuration.h | 158 + .../ONVIF/AudioEncoder2ConfigurationOptions.h | 132 + .../include/ONVIF/AudioEncoderConfiguration.h | 178 + .../ONVIF/AudioEncoderConfigurationOption.h | 132 + .../ONVIF/AudioEncoderConfigurationOptions.h | 82 + .../samples/ONVIF/include/ONVIF/AudioOutput.h | 44 + .../include/ONVIF/AudioOutputConfiguration.h | 129 + .../ONVIF/AudioOutputConfigurationOptions.h | 150 + .../samples/ONVIF/include/ONVIF/AudioSource.h | 67 + .../include/ONVIF/AudioSourceConfiguration.h | 77 + .../ONVIF/AudioSourceConfigurationOptions.h | 120 + .../ONVIF/AudioSourceOptionsExtension.h | 41 + .../include/ONVIF/BacklightCompensation.h | 94 + .../include/ONVIF/BacklightCompensation20.h | 95 + .../ONVIF/BacklightCompensationOptions.h | 111 + .../ONVIF/BacklightCompensationOptions20.h | 120 + .../samples/ONVIF/include/ONVIF/BackupFile.h | 103 + .../samples/ONVIF/include/ONVIF/BinaryData.h | 105 + .../ONVIF/include/ONVIF/Capabilities.h | 275 + .../include/ONVIF/CapabilitiesExtension.h | 307 + .../include/ONVIF/CapabilitiesExtension2.h | 41 + .../samples/ONVIF/include/ONVIF/CellLayout.h | 118 + .../samples/ONVIF/include/ONVIF/Certificate.h | 103 + .../ONVIF/CertificateGenerationParameters.h | 203 + ...CertificateGenerationParametersExtension.h | 41 + .../include/ONVIF/CertificateInformation.h | 378 + .../ONVIF/CertificateInformationExtension.h | 41 + .../ONVIF/include/ONVIF/CertificateStatus.h | 94 + .../ONVIF/include/ONVIF/CertificateUsage.h | 74 + .../include/ONVIF/CertificateWithPrivateKey.h | 133 + .../ONVIF/include/ONVIF/CodingCapabilities.h | 145 + .../samples/ONVIF/include/ONVIF/Color.h | 165 + .../ONVIF/include/ONVIF/ColorCluster.h | 135 + .../ONVIF/include/ONVIF/ColorCovariance.h | 211 + .../ONVIF/include/ONVIF/ColorDescriptor.h | 113 + .../ONVIF/include/ONVIF/ColorOptions.h | 122 + .../ONVIF/include/ONVIF/ColorspaceRange.h | 162 + .../samples/ONVIF/include/ONVIF/Config.h | 134 + .../ONVIF/include/ONVIF/ConfigDescription.h | 228 + .../ONVIF/ConfigDescriptionExtension.h | 41 + .../ONVIF/include/ONVIF/ConfigurationEntity.h | 124 + .../ONVIF/include/ONVIF/ContinuousFocus.h | 64 + .../include/ONVIF/ContinuousFocusOptions.h | 73 + .../ONVIF/include/ONVIF/DNSInformation.h | 219 + .../include/ONVIF/DNSInformationExtension.h | 41 + RemotingNG/samples/ONVIF/include/ONVIF/Date.h | 107 + .../samples/ONVIF/include/ONVIF/DateTime.h | 104 + .../ONVIF/include/ONVIF/DateTimeRange.h | 111 + .../samples/ONVIF/include/ONVIF/Defogging.h | 134 + .../ONVIF/include/ONVIF/DefoggingExtension.h | 41 + .../ONVIF/include/ONVIF/DefoggingOptions.h | 102 + .../include/ONVIF/Device/AddIPAddressFilter.h | 74 + .../ONVIF/Device/AddIPAddressFilterResponse.h | 42 + .../ONVIF/include/ONVIF/Device/AddScopes.h | 82 + .../include/ONVIF/Device/AddScopesResponse.h | 42 + .../ONVIF/include/ONVIF/Device/Capabilities.h | 42 + .../include/ONVIF/Device/CreateCertificate.h | 174 + .../ONVIF/Device/CreateCertificateResponse.h | 74 + .../ONVIF/Device/CreateDot1XConfiguration.h | 74 + .../Device/CreateDot1XConfigurationResponse.h | 42 + .../ONVIF/Device/CreateStorageConfiguration.h | 74 + .../CreateStorageConfigurationResponse.h | 73 + .../ONVIF/include/ONVIF/Device/CreateUsers.h | 82 + .../ONVIF/Device/CreateUsersResponse.h | 42 + .../include/ONVIF/Device/DeleteCertificates.h | 81 + .../ONVIF/Device/DeleteCertificatesResponse.h | 42 + .../ONVIF/Device/DeleteDot1XConfiguration.h | 82 + .../Device/DeleteDot1XConfigurationResponse.h | 42 + .../include/ONVIF/Device/DeleteGeoLocation.h | 82 + .../ONVIF/Device/DeleteGeoLocationResponse.h | 42 + .../ONVIF/Device/DeleteStorageConfiguration.h | 73 + .../DeleteStorageConfigurationResponse.h | 42 + .../ONVIF/include/ONVIF/Device/DeleteUsers.h | 81 + .../ONVIF/Device/DeleteUsersResponse.h | 42 + .../include/ONVIF/Device/DeviceBinding.h | 856 + .../ONVIF/Device/DeviceServiceCapabilities.h | 175 + .../ONVIF/include/ONVIF/Device/Extension.h | 42 + .../ONVIF/include/ONVIF/Device/Extension_1.h | 42 + .../ONVIF/include/ONVIF/Device/Extension_2.h | 42 + .../include/ONVIF/Device/GetAccessPolicy.h | 42 + .../ONVIF/Device/GetAccessPolicyResponse.h | 74 + .../GetAuthFailureWarningConfiguration.h | 42 + ...tAuthFailureWarningConfigurationResponse.h | 108 + .../Device/GetAuthFailureWarningOptions.h | 42 + .../GetAuthFailureWarningOptionsResponse.h | 104 + .../include/ONVIF/Device/GetCACertificates.h | 42 + .../ONVIF/Device/GetCACertificatesResponse.h | 83 + .../include/ONVIF/Device/GetCapabilities.h | 82 + .../ONVIF/Device/GetCapabilitiesResponse.h | 74 + .../ONVIF/Device/GetCertificateInformation.h | 73 + .../GetCertificateInformationResponse.h | 74 + .../include/ONVIF/Device/GetCertificates.h | 42 + .../ONVIF/Device/GetCertificatesResponse.h | 83 + .../ONVIF/Device/GetCertificatesStatus.h | 42 + .../Device/GetCertificatesStatusResponse.h | 83 + .../ONVIF/Device/GetClientCertificateMode.h | 42 + .../Device/GetClientCertificateModeResponse.h | 65 + .../ONVIF/include/ONVIF/Device/GetDNS.h | 42 + .../include/ONVIF/Device/GetDNSResponse.h | 74 + .../include/ONVIF/Device/GetDPAddresses.h | 42 + .../ONVIF/Device/GetDPAddressesResponse.h | 83 + .../ONVIF/Device/GetDeviceInformation.h | 42 + .../Device/GetDeviceInformationResponse.h | 190 + .../include/ONVIF/Device/GetDiscoveryMode.h | 42 + .../ONVIF/Device/GetDiscoveryModeResponse.h | 73 + .../ONVIF/Device/GetDot11Capabilities.h | 42 + .../Device/GetDot11CapabilitiesResponse.h | 74 + .../include/ONVIF/Device/GetDot11Status.h | 73 + .../ONVIF/Device/GetDot11StatusResponse.h | 74 + .../ONVIF/Device/GetDot1XConfiguration.h | 73 + .../Device/GetDot1XConfigurationResponse.h | 74 + .../ONVIF/Device/GetDot1XConfigurations.h | 42 + .../Device/GetDot1XConfigurationsResponse.h | 83 + .../include/ONVIF/Device/GetDynamicDNS.h | 42 + .../ONVIF/Device/GetDynamicDNSResponse.h | 74 + .../ONVIF/Device/GetEndpointReference.h | 42 + .../Device/GetEndpointReferenceResponse.h | 73 + .../include/ONVIF/Device/GetGeoLocation.h | 42 + .../ONVIF/Device/GetGeoLocationResponse.h | 83 + .../ONVIF/include/ONVIF/Device/GetHostname.h | 42 + .../ONVIF/Device/GetHostnameResponse.h | 74 + .../include/ONVIF/Device/GetIPAddressFilter.h | 42 + .../ONVIF/Device/GetIPAddressFilterResponse.h | 74 + .../ONVIF/include/ONVIF/Device/GetNTP.h | 42 + .../include/ONVIF/Device/GetNTPResponse.h | 74 + .../ONVIF/Device/GetNetworkDefaultGateway.h | 42 + .../Device/GetNetworkDefaultGatewayResponse.h | 74 + .../ONVIF/Device/GetNetworkInterfaces.h | 42 + .../Device/GetNetworkInterfacesResponse.h | 82 + .../ONVIF/Device/GetNetworkProtocols.h | 42 + .../Device/GetNetworkProtocolsResponse.h | 83 + .../GetPasswordComplexityConfiguration.h | 42 + ...tPasswordComplexityConfigurationResponse.h | 177 + .../Device/GetPasswordComplexityOptions.h | 42 + .../GetPasswordComplexityOptionsResponse.h | 218 + .../Device/GetPasswordHistoryConfiguration.h | 42 + .../GetPasswordHistoryConfigurationResponse.h | 87 + .../include/ONVIF/Device/GetPkcs10Request.h | 143 + .../ONVIF/Device/GetPkcs10RequestResponse.h | 74 + .../include/ONVIF/Device/GetRelayOutputs.h | 42 + .../ONVIF/Device/GetRelayOutputsResponse.h | 83 + .../ONVIF/Device/GetRemoteDiscoveryMode.h | 42 + .../Device/GetRemoteDiscoveryModeResponse.h | 73 + .../include/ONVIF/Device/GetRemoteUser.h | 42 + .../ONVIF/Device/GetRemoteUserResponse.h | 83 + .../ONVIF/include/ONVIF/Device/GetScopes.h | 42 + .../include/ONVIF/Device/GetScopesResponse.h | 82 + .../ONVIF/Device/GetServiceCapabilities.h | 42 + .../Device/GetServiceCapabilitiesResponse.h | 74 + .../ONVIF/include/ONVIF/Device/GetServices.h | 65 + .../ONVIF/Device/GetServicesResponse.h | 82 + .../ONVIF/Device/GetStorageConfiguration.h | 73 + .../Device/GetStorageConfigurationResponse.h | 74 + .../ONVIF/Device/GetStorageConfigurations.h | 42 + .../Device/GetStorageConfigurationsResponse.h | 83 + .../include/ONVIF/Device/GetSystemBackup.h | 42 + .../ONVIF/Device/GetSystemBackupResponse.h | 82 + .../ONVIF/Device/GetSystemDateAndTime.h | 42 + .../Device/GetSystemDateAndTimeResponse.h | 74 + .../ONVIF/include/ONVIF/Device/GetSystemLog.h | 74 + .../ONVIF/Device/GetSystemLogResponse.h | 74 + .../Device/GetSystemSupportInformation.h | 42 + .../GetSystemSupportInformationResponse.h | 74 + .../include/ONVIF/Device/GetSystemUris.h | 42 + .../ONVIF/Device/GetSystemUrisResponse.h | 180 + .../ONVIF/include/ONVIF/Device/GetUsers.h | 42 + .../include/ONVIF/Device/GetUsersResponse.h | 83 + .../ONVIF/include/ONVIF/Device/GetWsdlUrl.h | 42 + .../include/ONVIF/Device/GetWsdlUrlResponse.h | 74 + .../ONVIF/Device/GetZeroConfiguration.h | 42 + .../Device/GetZeroConfigurationResponse.h | 74 + .../include/ONVIF/Device/LoadCACertificates.h | 82 + .../ONVIF/Device/LoadCACertificatesResponse.h | 42 + .../Device/LoadCertificateWithPrivateKey.h | 82 + .../LoadCertificateWithPrivateKeyResponse.h | 42 + .../include/ONVIF/Device/LoadCertificates.h | 82 + .../ONVIF/Device/LoadCertificatesResponse.h | 42 + .../include/ONVIF/Device/MiscCapabilities.h | 83 + .../ONVIF/Device/NetworkCapabilities.h | 252 + .../ONVIF/Device/RemoveIPAddressFilter.h | 74 + .../Device/RemoveIPAddressFilterResponse.h | 42 + .../ONVIF/include/ONVIF/Device/RemoveScopes.h | 82 + .../ONVIF/Device/RemoveScopesResponse.h | 83 + .../include/ONVIF/Device/RestoreSystem.h | 82 + .../ONVIF/Device/RestoreSystemResponse.h | 42 + .../ONVIF/Device/ScanAvailableDot11Networks.h | 73 + .../ScanAvailableDot11NetworksResponse.h | 83 + .../ONVIF/Device/SecurityCapabilities.h | 576 + .../ONVIF/Device/SendAuxiliaryCommand.h | 73 + .../Device/SendAuxiliaryCommandResponse.h | 74 + .../ONVIF/include/ONVIF/Device/Service.h | 174 + .../include/ONVIF/Device/SetAccessPolicy.h | 74 + .../ONVIF/Device/SetAccessPolicyResponse.h | 42 + .../SetAuthFailureWarningConfiguration.h | 108 + ...tAuthFailureWarningConfigurationResponse.h | 42 + .../ONVIF/Device/SetCertificatesStatus.h | 83 + .../Device/SetCertificatesStatusResponse.h | 42 + .../ONVIF/Device/SetClientCertificateMode.h | 65 + .../Device/SetClientCertificateModeResponse.h | 42 + .../ONVIF/include/ONVIF/Device/SetDNS.h | 143 + .../include/ONVIF/Device/SetDNSResponse.h | 42 + .../include/ONVIF/Device/SetDPAddresses.h | 83 + .../ONVIF/Device/SetDPAddressesResponse.h | 42 + .../include/ONVIF/Device/SetDiscoveryMode.h | 73 + .../ONVIF/Device/SetDiscoveryModeResponse.h | 42 + .../ONVIF/Device/SetDot1XConfiguration.h | 74 + .../Device/SetDot1XConfigurationResponse.h | 42 + .../include/ONVIF/Device/SetDynamicDNS.h | 134 + .../ONVIF/Device/SetDynamicDNSResponse.h | 42 + .../include/ONVIF/Device/SetGeoLocation.h | 82 + .../ONVIF/Device/SetGeoLocationResponse.h | 42 + .../ONVIF/Device/SetHashingAlgorithm.h | 73 + .../Device/SetHashingAlgorithmResponse.h | 42 + .../ONVIF/include/ONVIF/Device/SetHostname.h | 73 + .../ONVIF/Device/SetHostnameFromDHCP.h | 65 + .../Device/SetHostnameFromDHCPResponse.h | 65 + .../ONVIF/Device/SetHostnameResponse.h | 42 + .../include/ONVIF/Device/SetIPAddressFilter.h | 74 + .../ONVIF/Device/SetIPAddressFilterResponse.h | 42 + .../ONVIF/include/ONVIF/Device/SetNTP.h | 105 + .../include/ONVIF/Device/SetNTPResponse.h | 42 + .../ONVIF/Device/SetNetworkDefaultGateway.h | 121 + .../Device/SetNetworkDefaultGatewayResponse.h | 42 + .../ONVIF/Device/SetNetworkInterfaces.h | 104 + .../Device/SetNetworkInterfacesResponse.h | 65 + .../ONVIF/Device/SetNetworkProtocols.h | 82 + .../Device/SetNetworkProtocolsResponse.h | 42 + .../SetPasswordComplexityConfiguration.h | 177 + ...tPasswordComplexityConfigurationResponse.h | 42 + .../Device/SetPasswordHistoryConfiguration.h | 87 + .../SetPasswordHistoryConfigurationResponse.h | 42 + .../ONVIF/Device/SetRelayOutputSettings.h | 104 + .../Device/SetRelayOutputSettingsResponse.h | 42 + .../ONVIF/Device/SetRelayOutputState.h | 103 + .../Device/SetRelayOutputStateResponse.h | 42 + .../ONVIF/Device/SetRemoteDiscoveryMode.h | 73 + .../Device/SetRemoteDiscoveryModeResponse.h | 42 + .../include/ONVIF/Device/SetRemoteUser.h | 83 + .../ONVIF/Device/SetRemoteUserResponse.h | 42 + .../ONVIF/include/ONVIF/Device/SetScopes.h | 82 + .../include/ONVIF/Device/SetScopesResponse.h | 42 + .../ONVIF/Device/SetStorageConfiguration.h | 74 + .../Device/SetStorageConfigurationResponse.h | 42 + .../ONVIF/Device/SetSystemDateAndTime.h | 166 + .../Device/SetSystemDateAndTimeResponse.h | 42 + .../ONVIF/Device/SetSystemFactoryDefault.h | 73 + .../Device/SetSystemFactoryDefaultResponse.h | 42 + .../ONVIF/include/ONVIF/Device/SetUser.h | 82 + .../include/ONVIF/Device/SetUserResponse.h | 42 + .../ONVIF/Device/SetZeroConfiguration.h | 95 + .../Device/SetZeroConfigurationResponse.h | 42 + .../ONVIF/Device/StartFirmwareUpgrade.h | 42 + .../Device/StartFirmwareUpgradeResponse.h | 133 + .../include/ONVIF/Device/StartSystemRestore.h | 42 + .../ONVIF/Device/StartSystemRestoreResponse.h | 104 + .../ONVIF/Device/StorageConfiguration.h | 77 + .../ONVIF/Device/StorageConfigurationData.h | 239 + .../include/ONVIF/Device/SystemCapabilities.h | 530 + .../ONVIF/include/ONVIF/Device/SystemReboot.h | 42 + .../ONVIF/Device/SystemRebootResponse.h | 73 + .../ONVIF/Device/UpgradeSystemFirmware.h | 74 + .../Device/UpgradeSystemFirmwareResponse.h | 74 + .../include/ONVIF/Device/UserCredential.h | 144 + .../ONVIF/include/ONVIF/DeviceCapabilities.h | 241 + .../ONVIF/DeviceCapabilitiesExtension.h | 41 + .../ONVIF/include/ONVIF/DeviceEntity.h | 73 + .../include/ONVIF/DeviceIO/Capabilities.h | 229 + .../include/ONVIF/DeviceIO/DeviceIOBinding.h | 303 + .../DigitalInputConfigurationOptions.h | 81 + .../ONVIF/include/ONVIF/DeviceIO/Get.h | 42 + .../DeviceIO/GetAudioOutputConfiguration.h | 73 + .../GetAudioOutputConfigurationOptions.h | 73 + ...tAudioOutputConfigurationOptionsResponse.h | 74 + .../GetAudioOutputConfigurationResponse.h | 74 + .../DeviceIO/GetAudioSourceConfiguration.h | 73 + .../GetAudioSourceConfigurationOptions.h | 73 + ...tAudioSourceConfigurationOptionsResponse.h | 74 + .../GetAudioSourceConfigurationResponse.h | 74 + .../GetDigitalInputConfigurationOptions.h | 74 + ...DigitalInputConfigurationOptionsResponse.h | 74 + .../include/ONVIF/DeviceIO/GetDigitalInputs.h | 42 + .../ONVIF/DeviceIO/GetDigitalInputsResponse.h | 83 + .../ONVIF/DeviceIO/GetRelayOutputOptions.h | 74 + .../DeviceIO/GetRelayOutputOptionsResponse.h | 83 + .../include/ONVIF/DeviceIO/GetResponse.h | 82 + .../DeviceIO/GetSerialPortConfiguration.h | 73 + .../GetSerialPortConfigurationOptions.h | 73 + ...etSerialPortConfigurationOptionsResponse.h | 74 + .../GetSerialPortConfigurationResponse.h | 74 + .../include/ONVIF/DeviceIO/GetSerialPorts.h | 42 + .../ONVIF/DeviceIO/GetSerialPortsResponse.h | 83 + .../ONVIF/DeviceIO/GetServiceCapabilities.h | 42 + .../DeviceIO/GetServiceCapabilitiesResponse.h | 74 + .../DeviceIO/GetVideoOutputConfiguration.h | 73 + .../GetVideoOutputConfigurationOptions.h | 73 + ...tVideoOutputConfigurationOptionsResponse.h | 74 + .../GetVideoOutputConfigurationResponse.h | 74 + .../include/ONVIF/DeviceIO/GetVideoOutputs.h | 42 + .../ONVIF/DeviceIO/GetVideoOutputsResponse.h | 83 + .../DeviceIO/GetVideoSourceConfiguration.h | 73 + .../GetVideoSourceConfigurationOptions.h | 73 + ...tVideoSourceConfigurationOptionsResponse.h | 74 + .../GetVideoSourceConfigurationResponse.h | 74 + .../include/ONVIF/DeviceIO/ParityBitList.h | 82 + .../ONVIF/DeviceIO/RelayOutputOptions.h | 204 + .../DeviceIO/RelayOutputOptionsExtension.h | 42 + .../ONVIF/DeviceIO/SendReceiveSerialCommand.h | 197 + .../SendReceiveSerialCommandResponse.h | 84 + .../ONVIF/include/ONVIF/DeviceIO/SerialData.h | 105 + .../ONVIF/include/ONVIF/DeviceIO/SerialPort.h | 45 + .../ONVIF/DeviceIO/SerialPortConfiguration.h | 197 + .../DeviceIO/SerialPortConfigurationOptions.h | 194 + .../DeviceIO/SetAudioOutputConfiguration.h | 96 + .../SetAudioOutputConfigurationResponse.h | 42 + .../DeviceIO/SetAudioSourceConfiguration.h | 96 + .../SetAudioSourceConfigurationResponse.h | 42 + .../DeviceIO/SetDigitalInputConfigurations.h | 82 + .../SetDigitalInputConfigurationsResponse.h | 42 + .../ONVIF/DeviceIO/SetRelayOutputSettings.h | 74 + .../DeviceIO/SetRelayOutputSettingsResponse.h | 42 + .../DeviceIO/SetSerialPortConfiguration.h | 96 + .../SetSerialPortConfigurationResponse.h | 42 + .../DeviceIO/SetVideoOutputConfiguration.h | 96 + .../SetVideoOutputConfigurationResponse.h | 42 + .../DeviceIO/SetVideoSourceConfiguration.h | 96 + .../SetVideoSourceConfigurationResponse.h | 42 + .../include/ONVIF/DeviceIOCapabilities.h | 179 + .../ONVIF/include/ONVIF/DigitalInput.h | 77 + .../ONVIF/include/ONVIF/DisplayCapabilities.h | 95 + .../include/ONVIF/Dot11AvailableNetworks.h | 286 + .../ONVIF/Dot11AvailableNetworksExtension.h | 41 + .../ONVIF/include/ONVIF/Dot11Capabilities.h | 149 + .../ONVIF/include/ONVIF/Dot11Configuration.h | 190 + .../samples/ONVIF/include/ONVIF/Dot11PSKSet.h | 143 + .../include/ONVIF/Dot11PSKSetExtension.h | 41 + .../ONVIF/Dot11SecurityConfiguration.h | 204 + .../Dot11SecurityConfigurationExtension.h | 41 + .../samples/ONVIF/include/ONVIF/Dot11Status.h | 222 + .../ONVIF/include/ONVIF/Dot1XConfiguration.h | 262 + .../ONVIF/Dot1XConfigurationExtension.h | 41 + .../ONVIF/include/ONVIF/Dot3Configuration.h | 41 + .../ONVIF/include/ONVIF/DurationRange.h | 102 + .../include/ONVIF/DynamicDNSInformation.h | 172 + .../ONVIF/DynamicDNSInformationExtension.h | 41 + .../include/ONVIF/EAPMethodConfiguration.h | 145 + .../samples/ONVIF/include/ONVIF/EFlip.h | 72 + .../ONVIF/include/ONVIF/EFlipOptions.h | 121 + .../include/ONVIF/EFlipOptionsExtension.h | 41 + .../ONVIF/include/ONVIF/EapMethodExtension.h | 41 + .../samples/ONVIF/include/ONVIF/ElementItem.h | 73 + .../include/ONVIF/ElementItemDescription.h | 104 + .../ONVIF/include/ONVIF/EngineConfiguration.h | 104 + .../ONVIF/include/ONVIF/EventCapabilities.h | 137 + .../samples/ONVIF/include/ONVIF/EventFilter.h | 42 + .../ONVIF/include/ONVIF/EventSubscription.h | 119 + .../samples/ONVIF/include/ONVIF/Exposure.h | 321 + .../samples/ONVIF/include/ONVIF/Exposure20.h | 340 + .../ONVIF/include/ONVIF/ExposureOptions.h | 380 + .../ONVIF/include/ONVIF/ExposureOptions20.h | 398 + .../ONVIF/include/ONVIF/FileProgress.h | 94 + .../samples/ONVIF/include/ONVIF/Filter.h | 103 + .../ONVIF/include/ONVIF/FindEventResult.h | 187 + .../ONVIF/include/ONVIF/FindEventResultList.h | 112 + .../ONVIF/include/ONVIF/FindMetadataResult.h | 136 + .../include/ONVIF/FindMetadataResultList.h | 112 + .../include/ONVIF/FindPTZPositionResult.h | 166 + .../include/ONVIF/FindPTZPositionResultList.h | 112 + .../include/ONVIF/FindRecordingResultList.h | 112 + .../samples/ONVIF/include/ONVIF/FloatItems.h | 73 + .../samples/ONVIF/include/ONVIF/FloatRange.h | 86 + .../ONVIF/include/ONVIF/FocusConfiguration.h | 136 + .../include/ONVIF/FocusConfiguration20.h | 217 + .../ONVIF/FocusConfiguration20Extension.h | 41 + .../samples/ONVIF/include/ONVIF/FocusMove.h | 147 + .../ONVIF/include/ONVIF/FocusOptions.h | 170 + .../ONVIF/include/ONVIF/FocusOptions20.h | 213 + .../include/ONVIF/FocusOptions20Extension.h | 73 + .../samples/ONVIF/include/ONVIF/FocusStatus.h | 123 + .../ONVIF/include/ONVIF/FocusStatus20.h | 163 + .../include/ONVIF/FocusStatus20Extension.h | 41 + .../ONVIF/include/ONVIF/G711DecOptions.h | 103 + .../ONVIF/include/ONVIF/G726DecOptions.h | 103 + .../GenericEapPwdConfigurationExtension.h | 41 + .../samples/ONVIF/include/ONVIF/GeoLocation.h | 113 + .../ONVIF/include/ONVIF/GeoOrientation.h | 113 + .../ONVIF/GetRecordingJobsResponseItem.h | 103 + .../include/ONVIF/GetRecordingsResponseItem.h | 133 + .../include/ONVIF/GetTracksResponseItem.h | 103 + .../include/ONVIF/GetTracksResponseList.h | 82 + .../ONVIF/include/ONVIF/H264Configuration.h | 94 + .../ONVIF/include/ONVIF/H264DecOptions.h | 178 + .../samples/ONVIF/include/ONVIF/H264Options.h | 207 + .../ONVIF/include/ONVIF/H264Options2.h | 80 + .../ONVIF/include/ONVIF/HostnameInformation.h | 134 + .../ONVIF/HostnameInformationExtension.h | 41 + .../ONVIF/include/ONVIF/IOCapabilities.h | 127 + .../include/ONVIF/IOCapabilitiesExtension.h | 134 + .../include/ONVIF/IOCapabilitiesExtension2.h | 41 + .../samples/ONVIF/include/ONVIF/IPAddress.h | 133 + .../ONVIF/include/ONVIF/IPAddressFilter.h | 191 + .../include/ONVIF/IPAddressFilterExtension.h | 41 + .../ONVIF/include/ONVIF/IPv4Configuration.h | 173 + .../include/ONVIF/IPv4NetworkInterface.h | 95 + .../IPv4NetworkInterfaceSetConfiguration.h | 127 + .../ONVIF/include/ONVIF/IPv6Configuration.h | 287 + .../ONVIF/IPv6ConfigurationExtension.h | 41 + .../include/ONVIF/IPv6NetworkInterface.h | 104 + .../IPv6NetworkInterfaceSetConfiguration.h | 157 + .../ONVIF/include/ONVIF/ImageStabilization.h | 134 + .../ONVIF/ImageStabilizationExtension.h | 41 + .../include/ONVIF/ImageStabilizationOptions.h | 152 + .../ImageStabilizationOptionsExtension.h | 41 + .../ONVIF/include/ONVIF/ImagingCapabilities.h | 73 + .../ONVIF/include/ONVIF/ImagingOptions.h | 348 + .../ONVIF/include/ONVIF/ImagingOptions20.h | 403 + .../include/ONVIF/ImagingOptions20Extension.h | 115 + .../ONVIF/ImagingOptions20Extension2.h | 115 + .../ONVIF/ImagingOptions20Extension3.h | 179 + .../ONVIF/ImagingOptions20Extension4.h | 41 + .../ONVIF/include/ONVIF/ImagingSettings.h | 361 + .../ONVIF/include/ONVIF/ImagingSettings20.h | 361 + .../include/ONVIF/ImagingSettingsExtension.h | 41 + .../ONVIF/ImagingSettingsExtension20.h | 115 + .../ONVIF/ImagingSettingsExtension202.h | 122 + .../ONVIF/ImagingSettingsExtension203.h | 179 + .../ONVIF/ImagingSettingsExtension204.h | 41 + .../ONVIF/include/ONVIF/ImagingStatus.h | 73 + .../ONVIF/include/ONVIF/ImagingStatus20.h | 115 + .../include/ONVIF/ImagingStatus20Extension.h | 41 + .../samples/ONVIF/include/ONVIF/IntItems.h | 73 + .../samples/ONVIF/include/ONVIF/IntRange.h | 86 + .../ONVIF/include/ONVIF/IntRectangle.h | 132 + .../ONVIF/include/ONVIF/IntRectangleRange.h | 161 + .../include/ONVIF/IrCutFilterAutoAdjustment.h | 164 + .../IrCutFilterAutoAdjustmentExtension.h | 41 + .../ONVIF/IrCutFilterAutoAdjustmentOptions.h | 174 + ...rCutFilterAutoAdjustmentOptionsExtension.h | 41 + .../samples/ONVIF/include/ONVIF/ItemList.h | 161 + .../ONVIF/include/ONVIF/ItemListDescription.h | 161 + .../ONVIF/ItemListDescriptionExtension.h | 41 + .../ONVIF/include/ONVIF/ItemListExtension.h | 41 + .../ONVIF/include/ONVIF/JpegDecOptions.h | 141 + .../samples/ONVIF/include/ONVIF/JpegOptions.h | 141 + .../ONVIF/include/ONVIF/JpegOptions2.h | 78 + .../samples/ONVIF/include/ONVIF/Layout.h | 121 + .../ONVIF/include/ONVIF/LayoutExtension.h | 41 + .../ONVIF/include/ONVIF/LayoutOptions.h | 121 + .../include/ONVIF/LayoutOptionsExtension.h | 41 + .../ONVIF/include/ONVIF/LensDescription.h | 156 + .../samples/ONVIF/include/ONVIF/LensOffset.h | 90 + .../ONVIF/include/ONVIF/LensProjection.h | 108 + .../ONVIF/include/ONVIF/LocalLocation.h | 113 + .../ONVIF/include/ONVIF/LocalOrientation.h | 113 + .../ONVIF/include/ONVIF/LocationEntity.h | 319 + .../ONVIF/include/ONVIF/MaximumNumberOfOSDs.h | 181 + .../Media/AddAudioDecoderConfiguration.h | 103 + .../AddAudioDecoderConfigurationResponse.h | 42 + .../Media/AddAudioEncoderConfiguration.h | 103 + .../AddAudioEncoderConfigurationResponse.h | 42 + .../ONVIF/Media/AddAudioOutputConfiguration.h | 103 + .../AddAudioOutputConfigurationResponse.h | 42 + .../ONVIF/Media/AddAudioSourceConfiguration.h | 103 + .../AddAudioSourceConfigurationResponse.h | 42 + .../ONVIF/Media/AddMetadataConfiguration.h | 103 + .../Media/AddMetadataConfigurationResponse.h | 42 + .../include/ONVIF/Media/AddPTZConfiguration.h | 103 + .../ONVIF/Media/AddPTZConfigurationResponse.h | 42 + .../Media/AddVideoAnalyticsConfiguration.h | 103 + .../AddVideoAnalyticsConfigurationResponse.h | 42 + .../Media/AddVideoEncoderConfiguration.h | 103 + .../AddVideoEncoderConfigurationResponse.h | 42 + .../ONVIF/Media/AddVideoSourceConfiguration.h | 103 + .../AddVideoSourceConfigurationResponse.h | 42 + .../ONVIF/include/ONVIF/Media/Capabilities.h | 243 + .../ONVIF/include/ONVIF/Media/CreateOSD.h | 74 + .../include/ONVIF/Media/CreateOSDResponse.h | 73 + .../ONVIF/include/ONVIF/Media/CreateProfile.h | 104 + .../ONVIF/Media/CreateProfileResponse.h | 74 + .../ONVIF/include/ONVIF/Media/DeleteOSD.h | 73 + .../include/ONVIF/Media/DeleteOSDResponse.h | 42 + .../ONVIF/include/ONVIF/Media/DeleteProfile.h | 73 + .../ONVIF/Media/DeleteProfileResponse.h | 42 + .../Media/GetAudioDecoderConfiguration.h | 73 + .../GetAudioDecoderConfigurationOptions.h | 105 + ...AudioDecoderConfigurationOptionsResponse.h | 74 + .../GetAudioDecoderConfigurationResponse.h | 74 + .../Media/GetAudioDecoderConfigurations.h | 42 + .../GetAudioDecoderConfigurationsResponse.h | 83 + .../Media/GetAudioEncoderConfiguration.h | 73 + .../GetAudioEncoderConfigurationOptions.h | 105 + ...AudioEncoderConfigurationOptionsResponse.h | 74 + .../GetAudioEncoderConfigurationResponse.h | 74 + .../Media/GetAudioEncoderConfigurations.h | 42 + .../GetAudioEncoderConfigurationsResponse.h | 83 + .../ONVIF/Media/GetAudioOutputConfiguration.h | 73 + .../GetAudioOutputConfigurationOptions.h | 105 + ...tAudioOutputConfigurationOptionsResponse.h | 74 + .../GetAudioOutputConfigurationResponse.h | 74 + .../Media/GetAudioOutputConfigurations.h | 42 + .../GetAudioOutputConfigurationsResponse.h | 83 + .../include/ONVIF/Media/GetAudioOutputs.h | 42 + .../ONVIF/Media/GetAudioOutputsResponse.h | 83 + .../ONVIF/Media/GetAudioSourceConfiguration.h | 73 + .../GetAudioSourceConfigurationOptions.h | 105 + ...tAudioSourceConfigurationOptionsResponse.h | 74 + .../GetAudioSourceConfigurationResponse.h | 74 + .../Media/GetAudioSourceConfigurations.h | 42 + .../GetAudioSourceConfigurationsResponse.h | 83 + .../include/ONVIF/Media/GetAudioSources.h | 42 + .../ONVIF/Media/GetAudioSourcesResponse.h | 83 + .../GetCompatibleAudioDecoderConfigurations.h | 73 + ...atibleAudioDecoderConfigurationsResponse.h | 83 + .../GetCompatibleAudioEncoderConfigurations.h | 73 + ...atibleAudioEncoderConfigurationsResponse.h | 83 + .../GetCompatibleAudioOutputConfigurations.h | 73 + ...patibleAudioOutputConfigurationsResponse.h | 83 + .../GetCompatibleAudioSourceConfigurations.h | 73 + ...patibleAudioSourceConfigurationsResponse.h | 83 + .../GetCompatibleMetadataConfigurations.h | 73 + ...CompatibleMetadataConfigurationsResponse.h | 83 + ...etCompatibleVideoAnalyticsConfigurations.h | 73 + ...ibleVideoAnalyticsConfigurationsResponse.h | 83 + .../GetCompatibleVideoEncoderConfigurations.h | 73 + ...atibleVideoEncoderConfigurationsResponse.h | 83 + .../GetCompatibleVideoSourceConfigurations.h | 73 + ...patibleVideoSourceConfigurationsResponse.h | 83 + ...tGuaranteedNumberOfVideoEncoderInstances.h | 73 + ...eedNumberOfVideoEncoderInstancesResponse.h | 132 + .../ONVIF/Media/GetMetadataConfiguration.h | 73 + .../Media/GetMetadataConfigurationOptions.h | 105 + .../GetMetadataConfigurationOptionsResponse.h | 74 + .../Media/GetMetadataConfigurationResponse.h | 74 + .../ONVIF/Media/GetMetadataConfigurations.h | 42 + .../Media/GetMetadataConfigurationsResponse.h | 83 + .../ONVIF/include/ONVIF/Media/GetOSD.h | 73 + .../ONVIF/include/ONVIF/Media/GetOSDOptions.h | 73 + .../ONVIF/Media/GetOSDOptionsResponse.h | 74 + .../include/ONVIF/Media/GetOSDResponse.h | 74 + .../ONVIF/include/ONVIF/Media/GetOSDs.h | 74 + .../include/ONVIF/Media/GetOSDsResponse.h | 83 + .../ONVIF/include/ONVIF/Media/GetProfile.h | 73 + .../include/ONVIF/Media/GetProfileResponse.h | 74 + .../ONVIF/include/ONVIF/Media/GetProfiles.h | 42 + .../include/ONVIF/Media/GetProfilesResponse.h | 83 + .../ONVIF/Media/GetServiceCapabilities.h | 42 + .../Media/GetServiceCapabilitiesResponse.h | 74 + .../include/ONVIF/Media/GetSnapshotUri.h | 73 + .../ONVIF/Media/GetSnapshotUriResponse.h | 74 + .../ONVIF/include/ONVIF/Media/GetStreamUri.h | 104 + .../ONVIF/Media/GetStreamUriResponse.h | 74 + .../Media/GetVideoAnalyticsConfiguration.h | 73 + .../GetVideoAnalyticsConfigurationResponse.h | 74 + .../Media/GetVideoAnalyticsConfigurations.h | 42 + .../GetVideoAnalyticsConfigurationsResponse.h | 83 + .../Media/GetVideoEncoderConfiguration.h | 73 + .../GetVideoEncoderConfigurationOptions.h | 105 + ...VideoEncoderConfigurationOptionsResponse.h | 74 + .../GetVideoEncoderConfigurationResponse.h | 74 + .../Media/GetVideoEncoderConfigurations.h | 42 + .../GetVideoEncoderConfigurationsResponse.h | 83 + .../ONVIF/Media/GetVideoSourceConfiguration.h | 73 + .../GetVideoSourceConfigurationOptions.h | 105 + ...tVideoSourceConfigurationOptionsResponse.h | 74 + .../GetVideoSourceConfigurationResponse.h | 74 + .../Media/GetVideoSourceConfigurations.h | 42 + .../GetVideoSourceConfigurationsResponse.h | 83 + .../include/ONVIF/Media/GetVideoSourceModes.h | 73 + .../ONVIF/Media/GetVideoSourceModesResponse.h | 82 + .../include/ONVIF/Media/GetVideoSources.h | 42 + .../ONVIF/Media/GetVideoSourcesResponse.h | 83 + .../ONVIF/include/ONVIF/Media/MediaBinding.h | 717 + .../include/ONVIF/Media/ProfileCapabilities.h | 67 + .../Media/RemoveAudioDecoderConfiguration.h | 73 + .../RemoveAudioDecoderConfigurationResponse.h | 42 + .../Media/RemoveAudioEncoderConfiguration.h | 73 + .../RemoveAudioEncoderConfigurationResponse.h | 42 + .../Media/RemoveAudioOutputConfiguration.h | 73 + .../RemoveAudioOutputConfigurationResponse.h | 42 + .../Media/RemoveAudioSourceConfiguration.h | 73 + .../RemoveAudioSourceConfigurationResponse.h | 42 + .../ONVIF/Media/RemoveMetadataConfiguration.h | 73 + .../RemoveMetadataConfigurationResponse.h | 42 + .../ONVIF/Media/RemovePTZConfiguration.h | 73 + .../Media/RemovePTZConfigurationResponse.h | 42 + .../Media/RemoveVideoAnalyticsConfiguration.h | 73 + ...emoveVideoAnalyticsConfigurationResponse.h | 42 + .../Media/RemoveVideoEncoderConfiguration.h | 73 + .../RemoveVideoEncoderConfigurationResponse.h | 42 + .../Media/RemoveVideoSourceConfiguration.h | 73 + .../RemoveVideoSourceConfigurationResponse.h | 42 + .../Media/SetAudioDecoderConfiguration.h | 96 + .../SetAudioDecoderConfigurationResponse.h | 42 + .../Media/SetAudioEncoderConfiguration.h | 96 + .../SetAudioEncoderConfigurationResponse.h | 42 + .../ONVIF/Media/SetAudioOutputConfiguration.h | 96 + .../SetAudioOutputConfigurationResponse.h | 42 + .../ONVIF/Media/SetAudioSourceConfiguration.h | 96 + .../SetAudioSourceConfigurationResponse.h | 42 + .../ONVIF/Media/SetMetadataConfiguration.h | 96 + .../Media/SetMetadataConfigurationResponse.h | 42 + .../ONVIF/include/ONVIF/Media/SetOSD.h | 74 + .../include/ONVIF/Media/SetOSDResponse.h | 42 + .../ONVIF/Media/SetSynchronizationPoint.h | 73 + .../Media/SetSynchronizationPointResponse.h | 42 + .../Media/SetVideoAnalyticsConfiguration.h | 96 + .../SetVideoAnalyticsConfigurationResponse.h | 42 + .../Media/SetVideoEncoderConfiguration.h | 96 + .../SetVideoEncoderConfigurationResponse.h | 42 + .../ONVIF/Media/SetVideoSourceConfiguration.h | 96 + .../SetVideoSourceConfigurationResponse.h | 42 + .../include/ONVIF/Media/SetVideoSourceMode.h | 103 + .../ONVIF/Media/SetVideoSourceModeResponse.h | 65 + .../ONVIF/Media/StartMulticastStreaming.h | 73 + .../Media/StartMulticastStreamingResponse.h | 42 + .../ONVIF/Media/StopMulticastStreaming.h | 73 + .../Media/StopMulticastStreamingResponse.h | 42 + .../ONVIF/Media/StreamingCapabilities.h | 160 + .../include/ONVIF/Media/VideoSourceMode.h | 269 + .../ONVIF/Media/VideoSourceModeExtension.h | 42 + .../ONVIF/include/ONVIF/MediaAttributes.h | 179 + .../ONVIF/include/ONVIF/MediaCapabilities.h | 143 + .../ONVIF/MediaCapabilitiesExtension.h | 73 + .../samples/ONVIF/include/ONVIF/MediaUri.h | 145 + .../samples/ONVIF/include/ONVIF/Message.h | 241 + .../ONVIF/include/ONVIF/MessageDescription.h | 198 + .../ONVIF/MessageDescriptionExtension.h | 41 + .../ONVIF/include/ONVIF/MessageExtension.h | 41 + .../samples/ONVIF/include/ONVIF/Messages.h | 79 + .../ONVIF/include/ONVIF/MetadataAttributes.h | 146 + .../include/ONVIF/MetadataConfiguration.h | 341 + .../ONVIF/MetadataConfigurationExtension.h | 41 + .../ONVIF/MetadataConfigurationOptions.h | 159 + .../MetadataConfigurationOptionsExtension.h | 121 + .../MetadataConfigurationOptionsExtension2.h | 41 + .../ONVIF/include/ONVIF/MetadataFilter.h | 72 + .../ONVIF/include/ONVIF/MetadataInput.h | 122 + .../include/ONVIF/MetadataInputExtension.h | 41 + .../ONVIF/include/ONVIF/MotionExpression.h | 104 + .../ONVIF/MotionExpressionConfiguration.h | 73 + .../samples/ONVIF/include/ONVIF/MoveOptions.h | 147 + .../ONVIF/include/ONVIF/MoveOptions20.h | 147 + .../ONVIF/include/ONVIF/Mpeg4Configuration.h | 94 + .../ONVIF/include/ONVIF/Mpeg4DecOptions.h | 178 + .../ONVIF/include/ONVIF/Mpeg4Options.h | 207 + .../ONVIF/include/ONVIF/Mpeg4Options2.h | 80 + .../include/ONVIF/MulticastConfiguration.h | 137 + .../ONVIF/include/ONVIF/NTPInformation.h | 181 + .../include/ONVIF/NTPInformationExtension.h | 41 + .../ONVIF/include/ONVIF/NetworkCapabilities.h | 171 + .../ONVIF/NetworkCapabilitiesExtension.h | 105 + .../ONVIF/NetworkCapabilitiesExtension2.h | 41 + .../ONVIF/include/ONVIF/NetworkGateway.h | 120 + .../samples/ONVIF/include/ONVIF/NetworkHost.h | 203 + .../include/ONVIF/NetworkHostExtension.h | 41 + .../ONVIF/include/ONVIF/NetworkInterface.h | 234 + .../ONVIF/NetworkInterfaceConnectionSetting.h | 115 + .../include/ONVIF/NetworkInterfaceExtension.h | 190 + .../ONVIF/NetworkInterfaceExtension2.h | 41 + .../include/ONVIF/NetworkInterfaceInfo.h | 125 + .../include/ONVIF/NetworkInterfaceLink.h | 132 + .../ONVIF/NetworkInterfaceSetConfiguration.h | 223 + ...etworkInterfaceSetConfigurationExtension.h | 161 + ...tworkInterfaceSetConfigurationExtension2.h | 41 + .../ONVIF/include/ONVIF/NetworkProtocol.h | 163 + .../include/ONVIF/NetworkProtocolExtension.h | 41 + .../include/ONVIF/NetworkZeroConfiguration.h | 171 + .../ONVIF/NetworkZeroConfigurationExtension.h | 122 + .../NetworkZeroConfigurationExtension2.h | 41 + .../ONVIF/include/ONVIF/NoiseReduction.h | 64 + .../include/ONVIF/NoiseReductionOptions.h | 64 + .../samples/ONVIF/include/ONVIF/ONVIF.h | 56 + .../samples/ONVIF/include/ONVIF/OSDColor.h | 97 + .../ONVIF/include/ONVIF/OSDColorOptions.h | 147 + .../include/ONVIF/OSDColorOptionsExtension.h | 41 + .../ONVIF/include/ONVIF/OSDConfiguration.h | 238 + .../include/ONVIF/OSDConfigurationExtension.h | 41 + .../include/ONVIF/OSDConfigurationOptions.h | 251 + .../ONVIF/OSDConfigurationOptionsExtension.h | 41 + .../ONVIF/include/ONVIF/OSDImgConfiguration.h | 113 + .../ONVIF/OSDImgConfigurationExtension.h | 41 + .../ONVIF/include/ONVIF/OSDImgOptions.h | 229 + .../include/ONVIF/OSDImgOptionsExtension.h | 41 + .../ONVIF/include/ONVIF/OSDPosConfiguration.h | 144 + .../ONVIF/OSDPosConfigurationExtension.h | 41 + .../ONVIF/include/ONVIF/OSDReference.h | 74 + .../include/ONVIF/OSDTextConfiguration.h | 309 + .../ONVIF/OSDTextConfigurationExtension.h | 41 + .../ONVIF/include/ONVIF/OSDTextOptions.h | 290 + .../include/ONVIF/OSDTextOptionsExtension.h | 41 + .../ONVIF/include/ONVIF/OnvifVersion.h | 86 + .../ONVIF/include/ONVIF/PTControlDirection.h | 147 + .../ONVIF/PTControlDirectionExtension.h | 41 + .../include/ONVIF/PTControlDirectionOptions.h | 147 + .../PTControlDirectionOptionsExtension.h | 41 + .../ONVIF/include/ONVIF/PTZCapabilities.h | 73 + .../ONVIF/include/ONVIF/PTZConfiguration.h | 492 + .../include/ONVIF/PTZConfigurationExtension.h | 115 + .../ONVIF/PTZConfigurationExtension2.h | 41 + .../include/ONVIF/PTZConfigurationOptions.h | 214 + .../include/ONVIF/PTZConfigurationOptions2.h | 41 + .../samples/ONVIF/include/ONVIF/PTZFilter.h | 86 + .../ONVIF/include/ONVIF/PTZMoveStatus.h | 104 + .../samples/ONVIF/include/ONVIF/PTZNode.h | 271 + .../ONVIF/include/ONVIF/PTZNodeExtension.h | 115 + .../ONVIF/include/ONVIF/PTZNodeExtension2.h | 41 + .../ONVIF/include/ONVIF/PTZPositionFilter.h | 124 + .../samples/ONVIF/include/ONVIF/PTZPreset.h | 144 + .../include/ONVIF/PTZPresetTourExtension.h | 41 + .../include/ONVIF/PTZPresetTourOptions.h | 125 + .../include/ONVIF/PTZPresetTourPresetDetail.h | 167 + .../ONVIF/PTZPresetTourPresetDetailOptions.h | 207 + ...TZPresetTourPresetDetailOptionsExtension.h | 41 + .../ONVIF/include/ONVIF/PTZPresetTourSpot.h | 175 + .../ONVIF/PTZPresetTourSpotExtension.h | 41 + .../include/ONVIF/PTZPresetTourSpotOptions.h | 104 + .../ONVIF/PTZPresetTourStartingCondition.h | 188 + .../PTZPresetTourStartingConditionExtension.h | 41 + .../PTZPresetTourStartingConditionOptions.h | 185 + ...setTourStartingConditionOptionsExtension.h | 41 + .../ONVIF/include/ONVIF/PTZPresetTourStatus.h | 144 + .../ONVIF/PTZPresetTourStatusExtension.h | 41 + .../include/ONVIF/PTZPresetTourSupported.h | 142 + .../ONVIF/PTZPresetTourSupportedExtension.h | 41 + .../ONVIF/PTZPresetTourTypeExtension.h | 41 + .../samples/ONVIF/include/ONVIF/PTZSpaces.h | 389 + .../ONVIF/include/ONVIF/PTZSpacesExtension.h | 41 + .../samples/ONVIF/include/ONVIF/PTZSpeed.h | 115 + .../samples/ONVIF/include/ONVIF/PTZStatus.h | 179 + .../include/ONVIF/PTZStatusFilterOptions.h | 169 + .../ONVIF/PTZStatusFilterOptionsExtension.h | 41 + .../samples/ONVIF/include/ONVIF/PTZVector.h | 115 + .../ONVIF/include/ONVIF/PanTiltLimits.h | 73 + .../ONVIF/include/ONVIF/PaneConfiguration.h | 232 + .../samples/ONVIF/include/ONVIF/PaneLayout.h | 103 + .../ONVIF/include/ONVIF/PaneLayoutOptions.h | 121 + .../ONVIF/include/ONVIF/PaneOptionExtension.h | 41 + .../samples/ONVIF/include/ONVIF/Polygon.h | 81 + .../ONVIF/include/ONVIF/PolygonOptions.h | 105 + .../samples/ONVIF/include/ONVIF/Polyline.h | 81 + .../ONVIF/include/ONVIF/PolylineArray.h | 121 + .../ONVIF/PolylineArrayConfiguration.h | 73 + .../include/ONVIF/PolylineArrayExtension.h | 41 + .../ONVIF/include/ONVIF/PrefixedIPv4Address.h | 94 + .../ONVIF/include/ONVIF/PrefixedIPv6Address.h | 94 + .../samples/ONVIF/include/ONVIF/PresetTour.h | 264 + .../samples/ONVIF/include/ONVIF/Profile.h | 389 + .../ONVIF/include/ONVIF/ProfileCapabilities.h | 64 + .../ONVIF/include/ONVIF/ProfileExtension.h | 147 + .../ONVIF/include/ONVIF/ProfileExtension2.h | 41 + .../ONVIF/include/ONVIF/ProfileStatus.h | 122 + .../include/ONVIF/ProfileStatusExtension.h | 41 + .../ONVIF/RealTimeStreamingCapabilities.h | 149 + .../RealTimeStreamingCapabilitiesExtension.h | 41 + .../samples/ONVIF/include/ONVIF/Receiver.h | 103 + .../include/ONVIF/ReceiverCapabilities.h | 179 + .../include/ONVIF/ReceiverConfiguration.h | 133 + .../include/ONVIF/ReceiverStateInformation.h | 94 + .../include/ONVIF/RecordingCapabilities.h | 179 + .../include/ONVIF/RecordingConfiguration.h | 171 + .../ONVIF/include/ONVIF/RecordingEncryption.h | 171 + .../include/ONVIF/RecordingEventFilter.h | 142 + .../include/ONVIF/RecordingInformation.h | 269 + .../include/ONVIF/RecordingJobConfiguration.h | 264 + .../RecordingJobConfigurationExtension.h | 41 + .../ONVIF/include/ONVIF/RecordingJobSource.h | 176 + .../ONVIF/RecordingJobSourceExtension.h | 41 + .../ONVIF/RecordingJobStateInformation.h | 180 + .../RecordingJobStateInformationExtension.h | 41 + .../include/ONVIF/RecordingJobStateSource.h | 133 + .../include/ONVIF/RecordingJobStateTrack.h | 161 + .../include/ONVIF/RecordingJobStateTracks.h | 82 + .../ONVIF/include/ONVIF/RecordingJobTrack.h | 102 + .../ONVIF/RecordingSourceInformation.h | 190 + .../ONVIF/include/ONVIF/RecordingSummary.h | 132 + .../ONVIF/RecordingTargetConfiguration.h | 260 + .../samples/ONVIF/include/ONVIF/Rectangle.h | 136 + .../ONVIF/include/ONVIF/RelativeFocus.h | 87 + .../include/ONVIF/RelativeFocusOptions.h | 103 + .../include/ONVIF/RelativeFocusOptions20.h | 113 + .../samples/ONVIF/include/ONVIF/RelayOutput.h | 76 + .../ONVIF/include/ONVIF/RelayOutputSettings.h | 131 + .../samples/ONVIF/include/ONVIF/RemoteUser.h | 124 + .../ONVIF/include/ONVIF/ReplayCapabilities.h | 73 + .../ONVIF/include/ONVIF/ReplayConfiguration.h | 72 + .../samples/ONVIF/include/ONVIF/Reverse.h | 72 + .../ONVIF/include/ONVIF/ReverseOptions.h | 121 + .../include/ONVIF/ReverseOptionsExtension.h | 41 + .../samples/ONVIF/include/ONVIF/Rotate.h | 134 + .../ONVIF/include/ONVIF/RotateExtension.h | 41 + .../ONVIF/include/ONVIF/RotateOptions.h | 175 + .../include/ONVIF/RotateOptionsExtension.h | 41 + .../include/ONVIF/RuleEngineConfiguration.h | 122 + .../ONVIF/RuleEngineConfigurationExtension.h | 41 + .../ONVIF/include/ONVIF/SceneOrientation.h | 103 + .../samples/ONVIF/include/ONVIF/Scope.h | 103 + .../ONVIF/include/ONVIF/SearchCapabilities.h | 95 + .../samples/ONVIF/include/ONVIF/SearchScope.h | 190 + .../include/ONVIF/SearchScopeExtension.h | 41 + .../include/ONVIF/SecurityCapabilities.h | 251 + .../ONVIF/SecurityCapabilitiesExtension.h | 104 + .../ONVIF/SecurityCapabilitiesExtension2.h | 116 + .../samples/ONVIF/include/ONVIF/SimpleItem.h | 104 + .../include/ONVIF/SimpleItemDescription.h | 104 + .../include/ONVIF/SourceIdentification.h | 149 + .../ONVIF/SourceIdentificationExtension.h | 41 + .../ONVIF/include/ONVIF/SourceReference.h | 105 + .../ONVIF/include/ONVIF/Space1DDescription.h | 104 + .../ONVIF/include/ONVIF/Space2DDescription.h | 133 + .../ONVIF/include/ONVIF/SphericalCoordinate.h | 113 + .../include/ONVIF/StorageReferencePath.h | 142 + .../ONVIF/StorageReferencePathExtension.h | 41 + .../samples/ONVIF/include/ONVIF/StreamSetup.h | 103 + .../samples/ONVIF/include/ONVIF/StringItems.h | 80 + .../ONVIF/include/ONVIF/SubscriptionPolicy.h | 41 + .../ONVIF/include/ONVIF/SupportInformation.h | 113 + .../include/ONVIF/SupportedAnalyticsModules.h | 184 + .../SupportedAnalyticsModulesExtension.h | 41 + .../ONVIF/include/ONVIF/SupportedRules.h | 184 + .../include/ONVIF/SupportedRulesExtension.h | 41 + .../ONVIF/include/ONVIF/SystemCapabilities.h | 247 + .../ONVIF/SystemCapabilitiesExtension.h | 171 + .../ONVIF/SystemCapabilitiesExtension2.h | 41 + .../ONVIF/include/ONVIF/SystemDateTime.h | 227 + .../include/ONVIF/SystemDateTimeExtension.h | 41 + .../samples/ONVIF/include/ONVIF/SystemLog.h | 113 + .../ONVIF/include/ONVIF/SystemLogUri.h | 104 + .../ONVIF/include/ONVIF/SystemLogUriList.h | 82 + .../ONVIF/include/ONVIF/TLSConfiguration.h | 72 + RemotingNG/samples/ONVIF/include/ONVIF/Time.h | 107 + .../samples/ONVIF/include/ONVIF/TimeZone.h | 72 + .../ONVIF/include/ONVIF/ToneCompensation.h | 134 + .../include/ONVIF/ToneCompensationExtension.h | 41 + .../include/ONVIF/ToneCompensationOptions.h | 102 + .../ONVIF/include/ONVIF/TrackAttributes.h | 209 + .../include/ONVIF/TrackAttributesExtension.h | 41 + .../ONVIF/include/ONVIF/TrackConfiguration.h | 102 + .../ONVIF/include/ONVIF/TrackInformation.h | 198 + .../ONVIF/include/ONVIF/Transformation.h | 145 + .../include/ONVIF/TransformationExtension.h | 41 + .../samples/ONVIF/include/ONVIF/Transport.h | 112 + RemotingNG/samples/ONVIF/include/ONVIF/User.h | 171 + .../ONVIF/include/ONVIF/UserExtension.h | 41 + .../samples/ONVIF/include/ONVIF/Vector.h | 90 + .../samples/ONVIF/include/ONVIF/Vector1D.h | 98 + .../samples/ONVIF/include/ONVIF/Vector2D.h | 120 + .../ONVIF/VideoAnalyticsConfiguration.h | 108 + .../ONVIF/include/ONVIF/VideoAttributes.h | 158 + .../ONVIF/VideoDecoderConfigurationOptions.h | 179 + ...ideoDecoderConfigurationOptionsExtension.h | 41 + .../ONVIF/VideoEncoder2Configuration.h | 276 + .../ONVIF/VideoEncoder2ConfigurationOptions.h | 334 + .../include/ONVIF/VideoEncoderConfiguration.h | 313 + .../ONVIF/VideoEncoderConfigurationOptions.h | 232 + .../ONVIF/VideoEncoderOptionsExtension.h | 179 + .../ONVIF/VideoEncoderOptionsExtension2.h | 41 + .../samples/ONVIF/include/ONVIF/VideoOutput.h | 191 + .../include/ONVIF/VideoOutputConfiguration.h | 77 + .../ONVIF/VideoOutputConfigurationOptions.h | 41 + .../include/ONVIF/VideoOutputExtension.h | 41 + .../ONVIF/include/ONVIF/VideoRateControl.h | 107 + .../ONVIF/include/ONVIF/VideoRateControl2.h | 109 + .../ONVIF/include/ONVIF/VideoResolution.h | 86 + .../ONVIF/include/ONVIF/VideoResolution2.h | 86 + .../samples/ONVIF/include/ONVIF/VideoSource.h | 168 + .../include/ONVIF/VideoSourceConfiguration.h | 177 + .../ONVIF/VideoSourceConfigurationExtension.h | 115 + .../VideoSourceConfigurationExtension2.h | 122 + .../ONVIF/VideoSourceConfigurationOptions.h | 173 + ...VideoSourceConfigurationOptionsExtension.h | 115 + ...ideoSourceConfigurationOptionsExtension2.h | 81 + .../include/ONVIF/VideoSourceExtension.h | 115 + .../include/ONVIF/VideoSourceExtension2.h | 41 + .../ONVIF/include/ONVIF/WhiteBalance.h | 115 + .../ONVIF/include/ONVIF/WhiteBalance20.h | 156 + .../include/ONVIF/WhiteBalance20Extension.h | 41 + .../ONVIF/include/ONVIF/WhiteBalanceOptions.h | 140 + .../include/ONVIF/WhiteBalanceOptions20.h | 182 + .../ONVIF/WhiteBalanceOptions20Extension.h | 41 + .../ONVIF/include/ONVIF/WideDynamicRange.h | 94 + .../ONVIF/include/ONVIF/WideDynamicRange20.h | 95 + .../include/ONVIF/WideDynamicRangeOptions.h | 111 + .../include/ONVIF/WideDynamicRangeOptions20.h | 120 + .../samples/ONVIF/include/ONVIF/ZoomLimits.h | 73 + .../include/W3/Addressing/AttributedAny.h | 42 + .../include/W3/Addressing/AttributedQName.h | 75 + .../include/W3/Addressing/AttributedURI.h | 76 + .../W3/Addressing/AttributedUnsignedLong.h | 68 + .../include/W3/Addressing/EndpointReference.h | 147 + .../ONVIF/include/W3/Addressing/Metadata.h | 42 + .../include/W3/Addressing/ProblemAction.h | 116 + .../W3/Addressing/ReferenceParameters.h | 42 + .../ONVIF/include/W3/Addressing/RelatesTo.h | 76 + .../ONVIF/include/W3/SOAP/Envelope/Body.h | 43 + .../ONVIF/include/W3/SOAP/Envelope/Detail.h | 43 + .../ONVIF/include/W3/SOAP/Envelope/Envelope.h | 117 + .../ONVIF/include/W3/SOAP/Envelope/Fault.h | 208 + .../include/W3/SOAP/Envelope/Faultcode.h | 116 + .../include/W3/SOAP/Envelope/Faultreason.h | 83 + .../ONVIF/include/W3/SOAP/Envelope/Header.h | 43 + .../include/W3/SOAP/Envelope/NotUnderstood.h | 75 + .../include/W3/SOAP/Envelope/Reasontext.h | 76 + .../ONVIF/include/W3/SOAP/Envelope/Subcode.h | 116 + .../include/W3/SOAP/Envelope/SupportedEnv.h | 75 + .../ONVIF/include/W3/SOAP/Envelope/Upgrade.h | 83 + .../ONVIF/include/W3/XMLMIME/Base64Binary.h | 75 + .../ONVIF/include/W3/XMLMIME/HexBinary.h | 75 + .../samples/ONVIF/include/W3/XOP/Include.h | 75 + RemotingNG/samples/ONVIF/src/Amalgamated.cpp | 26685 ++++++++++++++++ .../wsdl/ver10/accesscontrol/wsdl/index.html | 7 + .../ver10/accessrules/wsdl/accessrules.wsdl | 702 + .../wsdl/ver10/accessrules/wsdl/index.html | 7 + .../ONVIF/wsdl/ver10/actionengine.wsdl | 1265 + .../wsdl/advancedsecurity.wsdl | 3390 ++ .../ver10/advancedsecurity/wsdl/index.html | 7 + .../ver10/advancedsecurity/wsdl/security.wsdl | 3312 ++ .../ONVIF/wsdl/ver10/analyticsdevice.wsdl | 709 + .../wsdl/ver10/appmgmt/wsdl/appmgmt.wsdl | 502 + .../ONVIF/wsdl/ver10/appmgmt/wsdl/index.html | 7 + .../wsdl/authenticationbehavior.wsdl | 1382 + .../authenticationbehavior/wsdl/index.html | 7 + .../ver10/credential/wsdl/credential.wsdl | 2018 ++ .../wsdl/ver10/credential/wsdl/index.html | 7 + .../wsdl/ver10/device/wsdl/devicemgmt.wsdl | 4509 +++ .../samples/ONVIF/wsdl/ver10/deviceio.wsdl | 1414 + .../samples/ONVIF/wsdl/ver10/display.wsdl | 521 + .../ONVIF/wsdl/ver10/display/display.wsdl | 383 + .../ONVIF/wsdl/ver10/display/wsdl/index.htm | 383 + .../wsdl/ver10/doorcontrol/wsdl/index.html | 7 + .../wsdl/ver10/events/wsdl/bw-2-vs-mod.wsdl | 449 + .../wsdl/ver10/events/wsdl/event-vs.wsdl | 952 + .../ONVIF/wsdl/ver10/events/wsdl/event.wsdl | 952 + .../ONVIF/wsdl/ver10/events/wsdl/index.html | 7 + .../ONVIF/wsdl/ver10/federatedsearch.wsdl | 344 + .../ONVIF/wsdl/ver10/media/wsdl/media.wsdl | 3684 +++ .../ONVIF/wsdl/ver10/pacs/accesscontrol.wsdl | 1942 ++ .../ONVIF/wsdl/ver10/pacs/doorcontrol.wsdl | 1792 ++ .../samples/ONVIF/wsdl/ver10/pacs/types.xsd | 181 + .../ver10/provisioning/wsdl/provisioning.wsdl | 588 + .../samples/ONVIF/wsdl/ver10/receiver.wsdl | 398 + .../samples/ONVIF/wsdl/ver10/recording.wsdl | 1169 + .../samples/ONVIF/wsdl/ver10/replay.wsdl | 221 + .../ONVIF/wsdl/ver10/schedule/wsdl/index.html | 7 + .../wsdl/ver10/schedule/wsdl/schedule.wsdl | 1383 + .../ONVIF/wsdl/ver10/schema/common.xsd | 402 + .../wsdl/ver10/schema/metadatastream.xsd | 479 + .../samples/ONVIF/wsdl/ver10/schema/onvif.xsd | 9117 ++++++ .../samples/ONVIF/wsdl/ver10/search.wsdl | 882 + .../ONVIF/wsdl/ver10/thermal/wsdl/index.html | 7 + .../wsdl/ver10/thermal/wsdl/thermal.wsdl | 777 + .../ONVIF/wsdl/ver10/topics/topicns.xml | 13 + .../ONVIF/wsdl/ver10/uplink/wsdl/index.html | 7 + .../ONVIF/wsdl/ver10/uplink/wsdl/uplink.wsdl | 222 + RemotingNG/samples/ONVIFClient/CMakeLists.txt | 15 + RemotingNG/samples/ONVIFClient/Makefile | 30 + RemotingNG/samples/ONVIFClient/RemoteGen.xml | 41 + .../WSN/B2/CreatePullPointDeserializer.h | 59 + .../B2/CreatePullPointResponseDeserializer.h | 66 + .../B2/CreatePullPointResponseSerializer.h | 59 + .../OASIS/WSN/B2/CreatePullPointSerializer.h | 55 + .../WSN/B2/DestroyPullPointDeserializer.h | 59 + .../B2/DestroyPullPointResponseDeserializer.h | 59 + .../B2/DestroyPullPointResponseSerializer.h | 55 + .../OASIS/WSN/B2/DestroyPullPointSerializer.h | 55 + .../include/OASIS/WSN/B2/FilterDeserializer.h | 59 + .../include/OASIS/WSN/B2/FilterSerializer.h | 55 + .../WSN/B2/GetCurrentMessageDeserializer.h | 66 + .../GetCurrentMessageResponseDeserializer.h | 59 + .../B2/GetCurrentMessageResponseSerializer.h | 55 + .../WSN/B2/GetCurrentMessageSerializer.h | 59 + .../OASIS/WSN/B2/GetMessagesDeserializer.h | 64 + .../WSN/B2/GetMessagesResponseDeserializer.h | 66 + .../WSN/B2/GetMessagesResponseSerializer.h | 59 + .../OASIS/WSN/B2/GetMessagesSerializer.h | 57 + .../WSN/B2/InvalidFilterFaultDeserializer.h | 95 + .../WSN/B2/InvalidFilterFaultSerializer.h | 77 + ...essageContentExpressionFaultDeserializer.h | 90 + ...dMessageContentExpressionFaultSerializer.h | 75 + ...cerPropertiesExpressionFaultDeserializer.h | 90 + ...ducerPropertiesExpressionFaultSerializer.h | 75 + .../InvalidTopicExpressionFaultDeserializer.h | 90 + .../InvalidTopicExpressionFaultSerializer.h | 75 + .../OASIS/WSN/B2/MessageDeserializer.h | 59 + .../include/OASIS/WSN/B2/MessageSerializer.h | 55 + ...MultipleTopicsSpecifiedFaultDeserializer.h | 90 + .../MultipleTopicsSpecifiedFaultSerializer.h | 75 + ...NoCurrentMessageOnTopicFaultDeserializer.h | 90 + .../NoCurrentMessageOnTopicFaultSerializer.h | 75 + .../NotificationMessageHolderDeserializer.h | 79 + .../B2/NotificationMessageHolderSerializer.h | 66 + .../B2/NotificationProducerRPDeserializer.h | 77 + .../WSN/B2/NotificationProducerRPSerializer.h | 66 + .../include/OASIS/WSN/B2/NotifyDeserializer.h | 66 + ...tifyMessageNotSupportedFaultDeserializer.h | 90 + ...NotifyMessageNotSupportedFaultSerializer.h | 75 + .../include/OASIS/WSN/B2/NotifySerializer.h | 59 + .../WSN/B2/PauseFailedFaultDeserializer.h | 90 + .../OASIS/WSN/B2/PauseFailedFaultSerializer.h | 75 + .../WSN/B2/PauseSubscriptionDeserializer.h | 59 + .../PauseSubscriptionResponseDeserializer.h | 59 + .../B2/PauseSubscriptionResponseSerializer.h | 55 + .../WSN/B2/PauseSubscriptionSerializer.h | 55 + .../WSN/B2/QueryExpressionDeserializer.h | 80 + .../OASIS/WSN/B2/QueryExpressionSerializer.h | 73 + .../include/OASIS/WSN/B2/RenewDeserializer.h | 66 + .../OASIS/WSN/B2/RenewResponseDeserializer.h | 71 + .../OASIS/WSN/B2/RenewResponseSerializer.h | 62 + .../include/OASIS/WSN/B2/RenewSerializer.h | 59 + .../WSN/B2/ResumeFailedFaultDeserializer.h | 90 + .../WSN/B2/ResumeFailedFaultSerializer.h | 75 + .../WSN/B2/ResumeSubscriptionDeserializer.h | 59 + .../ResumeSubscriptionResponseDeserializer.h | 59 + .../B2/ResumeSubscriptionResponseSerializer.h | 55 + .../WSN/B2/ResumeSubscriptionSerializer.h | 55 + ...SubscribeCreationFailedFaultDeserializer.h | 90 + .../SubscribeCreationFailedFaultSerializer.h | 75 + .../OASIS/WSN/B2/SubscribeDeserializer.h | 81 + .../WSN/B2/SubscribeResponseDeserializer.h | 76 + .../WSN/B2/SubscribeResponseSerializer.h | 65 + .../OASIS/WSN/B2/SubscribeSerializer.h | 68 + .../B2/SubscriptionManagerRPDeserializer.h | 81 + .../WSN/B2/SubscriptionManagerRPSerializer.h | 68 + .../WSN/B2/SubscriptionPolicyDeserializer.h | 59 + .../WSN/B2/SubscriptionPolicySerializer.h | 55 + .../WSN/B2/TopicExpressionDeserializer.h | 80 + ...xpressionDialectUnknownFaultDeserializer.h | 90 + ...cExpressionDialectUnknownFaultSerializer.h | 75 + .../OASIS/WSN/B2/TopicExpressionSerializer.h | 73 + .../B2/TopicNotSupportedFaultDeserializer.h | 90 + .../WSN/B2/TopicNotSupportedFaultSerializer.h | 75 + ...UnableToCreatePullPointFaultDeserializer.h | 90 + .../UnableToCreatePullPointFaultSerializer.h | 75 + ...nableToDestroyPullPointFaultDeserializer.h | 90 + .../UnableToDestroyPullPointFaultSerializer.h | 75 + ...leToDestroySubscriptionFaultDeserializer.h | 90 + ...ableToDestroySubscriptionFaultSerializer.h | 75 + .../B2/UnableToGetMessagesFaultDeserializer.h | 90 + .../B2/UnableToGetMessagesFaultSerializer.h | 75 + ...eInitialTerminationTimeFaultDeserializer.h | 102 + ...bleInitialTerminationTimeFaultSerializer.h | 82 + ...ceptableTerminationTimeFaultDeserializer.h | 102 + ...acceptableTerminationTimeFaultSerializer.h | 82 + ...recognizedPolicyRequestFaultDeserializer.h | 95 + ...UnrecognizedPolicyRequestFaultSerializer.h | 77 + .../OASIS/WSN/B2/UnsubscribeDeserializer.h | 59 + .../WSN/B2/UnsubscribeResponseDeserializer.h | 59 + .../WSN/B2/UnsubscribeResponseSerializer.h | 55 + .../OASIS/WSN/B2/UnsubscribeSerializer.h | 55 + ...nsupportedPolicyRequestFaultDeserializer.h | 95 + .../UnsupportedPolicyRequestFaultSerializer.h | 77 + .../include/OASIS/WSN/B2/UseRawDeserializer.h | 59 + .../include/OASIS/WSN/B2/UseRawSerializer.h | 55 + .../OASIS/WSN/T1/DocumentationDeserializer.h | 59 + .../OASIS/WSN/T1/DocumentationSerializer.h | 55 + .../WSN/T1/ExtensibleDocumentedDeserializer.h | 66 + .../WSN/T1/ExtensibleDocumentedSerializer.h | 59 + .../WSN/T1/QueryExpressionDeserializer.h | 80 + .../OASIS/WSN/T1/QueryExpressionSerializer.h | 73 + .../include/OASIS/WSN/T1/TopicDeserializer.h | 91 + .../OASIS/WSN/T1/TopicNamespaceDeserializer.h | 106 + .../OASIS/WSN/T1/TopicNamespaceSerializer.h | 89 + .../include/OASIS/WSN/T1/TopicSerializer.h | 81 + .../OASIS/WSN/T1/TopicSetDeserializer.h | 70 + .../include/OASIS/WSN/T1/TopicSetSerializer.h | 63 + .../OASIS/WSRF/BF2/BaseFaultDeserializer.h | 86 + .../OASIS/WSRF/BF2/BaseFaultSerializer.h | 71 + .../OASIS/WSRF/BF2/DescriptionDeserializer.h | 64 + .../OASIS/WSRF/BF2/DescriptionSerializer.h | 57 + .../OASIS/WSRF/BF2/ErrorCodeDeserializer.h | 64 + .../OASIS/WSRF/BF2/ErrorCodeSerializer.h | 57 + .../OASIS/WSRF/BF2/FaultCauseDeserializer.h | 59 + .../OASIS/WSRF/BF2/FaultCauseSerializer.h | 55 + .../include/ONVIF/AACDecOptionsDeserializer.h | 69 + .../include/ONVIF/AACDecOptionsSerializer.h | 60 + .../include/ONVIF/AbsoluteFocusDeserializer.h | 67 + .../ONVIF/AbsoluteFocusOptionsDeserializer.h | 69 + .../ONVIF/AbsoluteFocusOptionsSerializer.h | 60 + .../include/ONVIF/AbsoluteFocusSerializer.h | 58 + .../ActionEngineEventPayloadDeserializer.h | 79 + ...nEngineEventPayloadExtensionDeserializer.h | 59 + ...ionEngineEventPayloadExtensionSerializer.h | 55 + .../ActionEngineEventPayloadSerializer.h | 66 + .../ONVIF/ActiveConnectionDeserializer.h | 67 + .../ONVIF/ActiveConnectionSerializer.h | 58 + .../ONVIF/AnalyticsCapabilitiesDeserializer.h | 70 + .../ONVIF/AnalyticsCapabilitiesSerializer.h | 59 + .../AnalyticsDeviceCapabilitiesDeserializer.h | 72 + .../AnalyticsDeviceCapabilitiesSerializer.h | 61 + ...icsDeviceEngineConfigurationDeserializer.h | 71 + ...EngineConfigurationExtensionDeserializer.h | 59 + ...ceEngineConfigurationExtensionSerializer.h | 55 + ...yticsDeviceEngineConfigurationSerializer.h | 62 + .../AnalyticsDeviceExtensionDeserializer.h | 59 + .../AnalyticsDeviceExtensionSerializer.h | 55 + ...AnalyticsEngineConfigurationDeserializer.h | 71 + ...EngineConfigurationExtensionDeserializer.h | 59 + ...csEngineConfigurationExtensionSerializer.h | 55 + .../AnalyticsEngineConfigurationSerializer.h | 62 + .../AnalyticsEngineControlDeserializer.h | 127 + .../ONVIF/AnalyticsEngineControlSerializer.h | 100 + .../ONVIF/AnalyticsEngineDeserializer.h | 107 + .../ONVIF/AnalyticsEngineInputDeserializer.h | 117 + .../AnalyticsEngineInputInfoDeserializer.h | 71 + ...ticsEngineInputInfoExtensionDeserializer.h | 59 + ...lyticsEngineInputInfoExtensionSerializer.h | 55 + .../AnalyticsEngineInputInfoSerializer.h | 62 + .../ONVIF/AnalyticsEngineInputSerializer.h | 98 + .../include/ONVIF/AnalyticsEngineSerializer.h | 92 + .../ONVIF/AnalyticsStateDeserializer.h | 67 + .../AnalyticsStateInformationDeserializer.h | 69 + .../AnalyticsStateInformationSerializer.h | 60 + .../include/ONVIF/AnalyticsStateSerializer.h | 58 + .../include/ONVIF/AnyHolderDeserializer.h | 59 + .../include/ONVIF/AnyHolderSerializer.h | 55 + .../ONVIF/ArrayOfFileProgressDeserializer.h | 71 + ...ArrayOfFileProgressExtensionDeserializer.h | 59 + .../ArrayOfFileProgressExtensionSerializer.h | 55 + .../ONVIF/ArrayOfFileProgressSerializer.h | 62 + .../ONVIF/AttachmentDataDeserializer.h | 87 + .../include/ONVIF/AttachmentDataSerializer.h | 79 + .../ONVIF/AudioAttributesDeserializer.h | 70 + .../include/ONVIF/AudioAttributesSerializer.h | 59 + .../ONVIF/AudioClassCandidateDeserializer.h | 67 + .../ONVIF/AudioClassCandidateSerializer.h | 58 + .../ONVIF/AudioClassDescriptorDeserializer.h | 71 + ...udioClassDescriptorExtensionDeserializer.h | 59 + .../AudioClassDescriptorExtensionSerializer.h | 55 + .../ONVIF/AudioClassDescriptorSerializer.h | 62 + .../AudioDecoderConfigurationDeserializer.h | 100 + ...oDecoderConfigurationOptionsDeserializer.h | 81 + ...onfigurationOptionsExtensionDeserializer.h | 59 + ...rConfigurationOptionsExtensionSerializer.h | 55 + ...dioDecoderConfigurationOptionsSerializer.h | 68 + .../AudioDecoderConfigurationSerializer.h | 88 + .../AudioEncoder2ConfigurationDeserializer.h | 116 + ...Encoder2ConfigurationOptionsDeserializer.h | 72 + ...ioEncoder2ConfigurationOptionsSerializer.h | 61 + .../AudioEncoder2ConfigurationSerializer.h | 95 + .../AudioEncoderConfigurationDeserializer.h | 119 + ...ioEncoderConfigurationOptionDeserializer.h | 72 + ...udioEncoderConfigurationOptionSerializer.h | 61 + ...oEncoderConfigurationOptionsDeserializer.h | 66 + ...dioEncoderConfigurationOptionsSerializer.h | 59 + .../AudioEncoderConfigurationSerializer.h | 96 + .../AudioOutputConfigurationDeserializer.h | 111 + ...ioOutputConfigurationOptionsDeserializer.h | 72 + ...udioOutputConfigurationOptionsSerializer.h | 61 + .../AudioOutputConfigurationSerializer.h | 92 + .../include/ONVIF/AudioOutputDeserializer.h | 92 + .../include/ONVIF/AudioOutputSerializer.h | 85 + .../AudioSourceConfigurationDeserializer.h | 105 + ...ioSourceConfigurationOptionsDeserializer.h | 69 + ...udioSourceConfigurationOptionsSerializer.h | 60 + .../AudioSourceConfigurationSerializer.h | 90 + .../include/ONVIF/AudioSourceDeserializer.h | 97 + .../AudioSourceOptionsExtensionDeserializer.h | 59 + .../AudioSourceOptionsExtensionSerializer.h | 55 + .../include/ONVIF/AudioSourceSerializer.h | 87 + .../BacklightCompensation20Deserializer.h | 67 + .../ONVIF/BacklightCompensation20Serializer.h | 58 + .../ONVIF/BacklightCompensationDeserializer.h | 67 + ...cklightCompensationOptions20Deserializer.h | 69 + ...BacklightCompensationOptions20Serializer.h | 60 + ...BacklightCompensationOptionsDeserializer.h | 69 + .../BacklightCompensationOptionsSerializer.h | 60 + .../ONVIF/BacklightCompensationSerializer.h | 58 + .../include/ONVIF/BackupFileDeserializer.h | 69 + .../include/ONVIF/BackupFileSerializer.h | 60 + .../include/ONVIF/BinaryDataDeserializer.h | 85 + .../include/ONVIF/BinaryDataSerializer.h | 75 + .../include/ONVIF/CapabilitiesDeserializer.h | 96 + .../CapabilitiesExtension2Deserializer.h | 59 + .../ONVIF/CapabilitiesExtension2Serializer.h | 55 + .../ONVIF/CapabilitiesExtensionDeserializer.h | 101 + .../ONVIF/CapabilitiesExtensionSerializer.h | 80 + .../include/ONVIF/CapabilitiesSerializer.h | 77 + .../include/ONVIF/CellLayoutDeserializer.h | 91 + .../include/ONVIF/CellLayoutSerializer.h | 79 + .../include/ONVIF/CertificateDeserializer.h | 69 + ...tificateGenerationParametersDeserializer.h | 78 + ...enerationParametersExtensionDeserializer.h | 59 + ...eGenerationParametersExtensionSerializer.h | 55 + ...ertificateGenerationParametersSerializer.h | 63 + .../CertificateInformationDeserializer.h | 100 + ...tificateInformationExtensionDeserializer.h | 59 + ...ertificateInformationExtensionSerializer.h | 55 + .../ONVIF/CertificateInformationSerializer.h | 73 + .../include/ONVIF/CertificateSerializer.h | 60 + .../ONVIF/CertificateStatusDeserializer.h | 67 + .../ONVIF/CertificateStatusSerializer.h | 58 + .../ONVIF/CertificateUsageDeserializer.h | 64 + .../ONVIF/CertificateUsageSerializer.h | 57 + .../CertificateWithPrivateKeyDeserializer.h | 72 + .../CertificateWithPrivateKeySerializer.h | 61 + .../ONVIF/CodingCapabilitiesDeserializer.h | 76 + .../ONVIF/CodingCapabilitiesSerializer.h | 65 + .../include/ONVIF/ColorClusterDeserializer.h | 74 + .../include/ONVIF/ColorClusterSerializer.h | 63 + .../ONVIF/ColorCovarianceDeserializer.h | 104 + .../include/ONVIF/ColorCovarianceSerializer.h | 85 + .../ONVIF/ColorDescriptorDeserializer.h | 69 + .../include/ONVIF/ColorDescriptorSerializer.h | 60 + .../include/ONVIF/ColorDeserializer.h | 96 + .../include/ONVIF/ColorOptionsDeserializer.h | 71 + .../include/ONVIF/ColorOptionsSerializer.h | 62 + .../include/ONVIF/ColorSerializer.h | 81 + .../ONVIF/ColorspaceRangeDeserializer.h | 75 + .../include/ONVIF/ColorspaceRangeSerializer.h | 62 + .../ONVIF/ConfigDescriptionDeserializer.h | 105 + .../ConfigDescriptionExtensionDeserializer.h | 59 + .../ConfigDescriptionExtensionSerializer.h | 55 + .../ONVIF/ConfigDescriptionSerializer.h | 87 + .../include/ONVIF/ConfigDeserializer.h | 91 + .../include/ONVIF/ConfigSerializer.h | 79 + .../ONVIF/ConfigurationEntityDeserializer.h | 88 + .../ONVIF/ConfigurationEntitySerializer.h | 76 + .../ONVIF/ContinuousFocusDeserializer.h | 64 + .../ContinuousFocusOptionsDeserializer.h | 66 + .../ONVIF/ContinuousFocusOptionsSerializer.h | 59 + .../include/ONVIF/ContinuousFocusSerializer.h | 57 + .../ONVIF/DNSInformationDeserializer.h | 80 + .../DNSInformationExtensionDeserializer.h | 59 + .../ONVIF/DNSInformationExtensionSerializer.h | 55 + .../include/ONVIF/DNSInformationSerializer.h | 65 + .../include/ONVIF/DateDeserializer.h | 70 + .../include/ONVIF/DateSerializer.h | 59 + .../include/ONVIF/DateTimeDeserializer.h | 71 + .../include/ONVIF/DateTimeRangeDeserializer.h | 71 + .../include/ONVIF/DateTimeRangeSerializer.h | 62 + .../include/ONVIF/DateTimeSerializer.h | 62 + .../include/ONVIF/DefoggingDeserializer.h | 72 + .../ONVIF/DefoggingExtensionDeserializer.h | 59 + .../ONVIF/DefoggingExtensionSerializer.h | 55 + .../ONVIF/DefoggingOptionsDeserializer.h | 67 + .../ONVIF/DefoggingOptionsSerializer.h | 58 + .../include/ONVIF/DefoggingSerializer.h | 61 + .../Device/AddIPAddressFilterDeserializer.h | 66 + .../AddIPAddressFilterResponseDeserializer.h | 59 + .../AddIPAddressFilterResponseSerializer.h | 55 + .../Device/AddIPAddressFilterSerializer.h | 59 + .../ONVIF/Device/AddScopesDeserializer.h | 64 + .../Device/AddScopesResponseDeserializer.h | 59 + .../Device/AddScopesResponseSerializer.h | 55 + .../ONVIF/Device/AddScopesSerializer.h | 57 + .../ONVIF/Device/CapabilitiesDeserializer.h | 59 + .../ONVIF/Device/CapabilitiesSerializer.h | 55 + .../Device/CreateCertificateDeserializer.h | 77 + .../CreateCertificateResponseDeserializer.h | 66 + .../CreateCertificateResponseSerializer.h | 59 + .../Device/CreateCertificateSerializer.h | 64 + .../CreateDot1XConfigurationDeserializer.h | 66 + ...teDot1XConfigurationResponseDeserializer.h | 59 + ...eateDot1XConfigurationResponseSerializer.h | 55 + .../CreateDot1XConfigurationSerializer.h | 59 + .../CreateStorageConfigurationDeserializer.h | 66 + ...StorageConfigurationResponseDeserializer.h | 64 + ...teStorageConfigurationResponseSerializer.h | 57 + .../CreateStorageConfigurationSerializer.h | 59 + .../ONVIF/Device/CreateUsersDeserializer.h | 66 + .../Device/CreateUsersResponseDeserializer.h | 59 + .../Device/CreateUsersResponseSerializer.h | 55 + .../ONVIF/Device/CreateUsersSerializer.h | 59 + .../Device/DeleteCertificatesDeserializer.h | 64 + .../DeleteCertificatesResponseDeserializer.h | 59 + .../DeleteCertificatesResponseSerializer.h | 55 + .../Device/DeleteCertificatesSerializer.h | 57 + .../DeleteDot1XConfigurationDeserializer.h | 64 + ...teDot1XConfigurationResponseDeserializer.h | 59 + ...leteDot1XConfigurationResponseSerializer.h | 55 + .../DeleteDot1XConfigurationSerializer.h | 57 + .../Device/DeleteGeoLocationDeserializer.h | 66 + .../DeleteGeoLocationResponseDeserializer.h | 59 + .../DeleteGeoLocationResponseSerializer.h | 55 + .../Device/DeleteGeoLocationSerializer.h | 59 + .../DeleteStorageConfigurationDeserializer.h | 64 + ...StorageConfigurationResponseDeserializer.h | 59 + ...teStorageConfigurationResponseSerializer.h | 55 + .../DeleteStorageConfigurationSerializer.h | 57 + .../ONVIF/Device/DeleteUsersDeserializer.h | 64 + .../Device/DeleteUsersResponseDeserializer.h | 59 + .../Device/DeleteUsersResponseSerializer.h | 55 + .../ONVIF/Device/DeleteUsersSerializer.h | 57 + .../ONVIF/Device/DeviceBindingClientHelper.h | 78 + .../include/ONVIF/Device/DeviceBindingProxy.h | 251 + .../ONVIF/Device/DeviceBindingProxyFactory.h | 44 + .../DeviceServiceCapabilitiesDeserializer.h | 81 + .../DeviceServiceCapabilitiesSerializer.h | 68 + .../ONVIF/Device/ExtensionDeserializer.h | 59 + .../ONVIF/Device/ExtensionSerializer.h | 55 + .../ONVIF/Device/Extension_1Deserializer.h | 59 + .../ONVIF/Device/Extension_1Serializer.h | 55 + .../ONVIF/Device/Extension_2Deserializer.h | 59 + .../ONVIF/Device/Extension_2Serializer.h | 55 + .../Device/GetAccessPolicyDeserializer.h | 59 + .../GetAccessPolicyResponseDeserializer.h | 66 + .../GetAccessPolicyResponseSerializer.h | 59 + .../ONVIF/Device/GetAccessPolicySerializer.h | 55 + ...hFailureWarningConfigurationDeserializer.h | 59 + ...WarningConfigurationResponseDeserializer.h | 70 + ...reWarningConfigurationResponseSerializer.h | 59 + ...uthFailureWarningConfigurationSerializer.h | 55 + ...GetAuthFailureWarningOptionsDeserializer.h | 59 + ...ailureWarningOptionsResponseDeserializer.h | 69 + ...hFailureWarningOptionsResponseSerializer.h | 60 + .../GetAuthFailureWarningOptionsSerializer.h | 55 + .../Device/GetCACertificatesDeserializer.h | 59 + .../GetCACertificatesResponseDeserializer.h | 66 + .../GetCACertificatesResponseSerializer.h | 59 + .../Device/GetCACertificatesSerializer.h | 55 + .../Device/GetCapabilitiesDeserializer.h | 64 + .../GetCapabilitiesResponseDeserializer.h | 66 + .../GetCapabilitiesResponseSerializer.h | 59 + .../ONVIF/Device/GetCapabilitiesSerializer.h | 57 + .../GetCertificateInformationDeserializer.h | 64 + ...rtificateInformationResponseDeserializer.h | 66 + ...CertificateInformationResponseSerializer.h | 59 + .../GetCertificateInformationSerializer.h | 57 + .../Device/GetCertificatesDeserializer.h | 59 + .../GetCertificatesResponseDeserializer.h | 66 + .../GetCertificatesResponseSerializer.h | 59 + .../ONVIF/Device/GetCertificatesSerializer.h | 55 + .../GetCertificatesStatusDeserializer.h | 59 + ...etCertificatesStatusResponseDeserializer.h | 66 + .../GetCertificatesStatusResponseSerializer.h | 59 + .../Device/GetCertificatesStatusSerializer.h | 55 + .../GetClientCertificateModeDeserializer.h | 59 + ...lientCertificateModeResponseDeserializer.h | 64 + ...tClientCertificateModeResponseSerializer.h | 57 + .../GetClientCertificateModeSerializer.h | 55 + .../include/ONVIF/Device/GetDNSDeserializer.h | 59 + .../ONVIF/Device/GetDNSResponseDeserializer.h | 66 + .../ONVIF/Device/GetDNSResponseSerializer.h | 59 + .../include/ONVIF/Device/GetDNSSerializer.h | 55 + .../ONVIF/Device/GetDPAddressesDeserializer.h | 59 + .../GetDPAddressesResponseDeserializer.h | 66 + .../Device/GetDPAddressesResponseSerializer.h | 59 + .../ONVIF/Device/GetDPAddressesSerializer.h | 55 + .../Device/GetDeviceInformationDeserializer.h | 59 + ...GetDeviceInformationResponseDeserializer.h | 76 + .../GetDeviceInformationResponseSerializer.h | 61 + .../Device/GetDeviceInformationSerializer.h | 55 + .../Device/GetDiscoveryModeDeserializer.h | 59 + .../GetDiscoveryModeResponseDeserializer.h | 64 + .../GetDiscoveryModeResponseSerializer.h | 57 + .../ONVIF/Device/GetDiscoveryModeSerializer.h | 55 + .../Device/GetDot11CapabilitiesDeserializer.h | 59 + ...GetDot11CapabilitiesResponseDeserializer.h | 66 + .../GetDot11CapabilitiesResponseSerializer.h | 59 + .../Device/GetDot11CapabilitiesSerializer.h | 55 + .../ONVIF/Device/GetDot11StatusDeserializer.h | 64 + .../GetDot11StatusResponseDeserializer.h | 66 + .../Device/GetDot11StatusResponseSerializer.h | 59 + .../ONVIF/Device/GetDot11StatusSerializer.h | 57 + .../GetDot1XConfigurationDeserializer.h | 64 + ...etDot1XConfigurationResponseDeserializer.h | 66 + .../GetDot1XConfigurationResponseSerializer.h | 59 + .../Device/GetDot1XConfigurationSerializer.h | 57 + .../GetDot1XConfigurationsDeserializer.h | 59 + ...tDot1XConfigurationsResponseDeserializer.h | 66 + ...GetDot1XConfigurationsResponseSerializer.h | 59 + .../Device/GetDot1XConfigurationsSerializer.h | 55 + .../ONVIF/Device/GetDynamicDNSDeserializer.h | 59 + .../GetDynamicDNSResponseDeserializer.h | 66 + .../Device/GetDynamicDNSResponseSerializer.h | 59 + .../ONVIF/Device/GetDynamicDNSSerializer.h | 55 + .../Device/GetEndpointReferenceDeserializer.h | 59 + ...GetEndpointReferenceResponseDeserializer.h | 64 + .../GetEndpointReferenceResponseSerializer.h | 57 + .../Device/GetEndpointReferenceSerializer.h | 55 + .../ONVIF/Device/GetGeoLocationDeserializer.h | 59 + .../GetGeoLocationResponseDeserializer.h | 66 + .../Device/GetGeoLocationResponseSerializer.h | 59 + .../ONVIF/Device/GetGeoLocationSerializer.h | 55 + .../ONVIF/Device/GetHostnameDeserializer.h | 59 + .../Device/GetHostnameResponseDeserializer.h | 66 + .../Device/GetHostnameResponseSerializer.h | 59 + .../ONVIF/Device/GetHostnameSerializer.h | 55 + .../Device/GetIPAddressFilterDeserializer.h | 59 + .../GetIPAddressFilterResponseDeserializer.h | 66 + .../GetIPAddressFilterResponseSerializer.h | 59 + .../Device/GetIPAddressFilterSerializer.h | 55 + .../include/ONVIF/Device/GetNTPDeserializer.h | 59 + .../ONVIF/Device/GetNTPResponseDeserializer.h | 66 + .../ONVIF/Device/GetNTPResponseSerializer.h | 59 + .../include/ONVIF/Device/GetNTPSerializer.h | 55 + .../GetNetworkDefaultGatewayDeserializer.h | 59 + ...etworkDefaultGatewayResponseDeserializer.h | 66 + ...tNetworkDefaultGatewayResponseSerializer.h | 59 + .../GetNetworkDefaultGatewaySerializer.h | 55 + .../Device/GetNetworkInterfacesDeserializer.h | 59 + ...GetNetworkInterfacesResponseDeserializer.h | 66 + .../GetNetworkInterfacesResponseSerializer.h | 59 + .../Device/GetNetworkInterfacesSerializer.h | 55 + .../Device/GetNetworkProtocolsDeserializer.h | 59 + .../GetNetworkProtocolsResponseDeserializer.h | 66 + .../GetNetworkProtocolsResponseSerializer.h | 59 + .../Device/GetNetworkProtocolsSerializer.h | 55 + ...swordComplexityConfigurationDeserializer.h | 59 + ...plexityConfigurationResponseDeserializer.h | 79 + ...omplexityConfigurationResponseSerializer.h | 62 + ...asswordComplexityConfigurationSerializer.h | 55 + ...GetPasswordComplexityOptionsDeserializer.h | 59 + ...ordComplexityOptionsResponseDeserializer.h | 81 + ...swordComplexityOptionsResponseSerializer.h | 64 + .../GetPasswordComplexityOptionsSerializer.h | 55 + ...PasswordHistoryConfigurationDeserializer.h | 59 + ...HistoryConfigurationResponseDeserializer.h | 67 + ...rdHistoryConfigurationResponseSerializer.h | 58 + ...etPasswordHistoryConfigurationSerializer.h | 55 + .../Device/GetPkcs10RequestDeserializer.h | 72 + .../GetPkcs10RequestResponseDeserializer.h | 66 + .../GetPkcs10RequestResponseSerializer.h | 59 + .../ONVIF/Device/GetPkcs10RequestSerializer.h | 61 + .../Device/GetRelayOutputsDeserializer.h | 59 + .../GetRelayOutputsResponseDeserializer.h | 66 + .../GetRelayOutputsResponseSerializer.h | 59 + .../ONVIF/Device/GetRelayOutputsSerializer.h | 55 + .../GetRemoteDiscoveryModeDeserializer.h | 59 + ...tRemoteDiscoveryModeResponseDeserializer.h | 64 + ...GetRemoteDiscoveryModeResponseSerializer.h | 57 + .../Device/GetRemoteDiscoveryModeSerializer.h | 55 + .../ONVIF/Device/GetRemoteUserDeserializer.h | 59 + .../GetRemoteUserResponseDeserializer.h | 66 + .../Device/GetRemoteUserResponseSerializer.h | 59 + .../ONVIF/Device/GetRemoteUserSerializer.h | 55 + .../ONVIF/Device/GetScopesDeserializer.h | 59 + .../Device/GetScopesResponseDeserializer.h | 66 + .../Device/GetScopesResponseSerializer.h | 59 + .../ONVIF/Device/GetScopesSerializer.h | 55 + .../GetServiceCapabilitiesDeserializer.h | 59 + ...tServiceCapabilitiesResponseDeserializer.h | 66 + ...GetServiceCapabilitiesResponseSerializer.h | 59 + .../Device/GetServiceCapabilitiesSerializer.h | 55 + .../ONVIF/Device/GetServicesDeserializer.h | 64 + .../Device/GetServicesResponseDeserializer.h | 66 + .../Device/GetServicesResponseSerializer.h | 59 + .../ONVIF/Device/GetServicesSerializer.h | 57 + .../GetStorageConfigurationDeserializer.h | 64 + ...StorageConfigurationResponseDeserializer.h | 66 + ...etStorageConfigurationResponseSerializer.h | 59 + .../GetStorageConfigurationSerializer.h | 57 + .../GetStorageConfigurationsDeserializer.h | 59 + ...torageConfigurationsResponseDeserializer.h | 66 + ...tStorageConfigurationsResponseSerializer.h | 59 + .../GetStorageConfigurationsSerializer.h | 55 + .../Device/GetSystemBackupDeserializer.h | 59 + .../GetSystemBackupResponseDeserializer.h | 66 + .../GetSystemBackupResponseSerializer.h | 59 + .../ONVIF/Device/GetSystemBackupSerializer.h | 55 + .../Device/GetSystemDateAndTimeDeserializer.h | 59 + ...GetSystemDateAndTimeResponseDeserializer.h | 66 + .../GetSystemDateAndTimeResponseSerializer.h | 59 + .../Device/GetSystemDateAndTimeSerializer.h | 55 + .../ONVIF/Device/GetSystemLogDeserializer.h | 66 + .../Device/GetSystemLogResponseDeserializer.h | 66 + .../Device/GetSystemLogResponseSerializer.h | 59 + .../ONVIF/Device/GetSystemLogSerializer.h | 59 + .../GetSystemSupportInformationDeserializer.h | 59 + ...emSupportInformationResponseDeserializer.h | 66 + ...stemSupportInformationResponseSerializer.h | 59 + .../GetSystemSupportInformationSerializer.h | 55 + .../ONVIF/Device/GetSystemUrisDeserializer.h | 59 + .../GetSystemUrisResponseDeserializer.h | 77 + .../Device/GetSystemUrisResponseSerializer.h | 64 + .../ONVIF/Device/GetSystemUrisSerializer.h | 55 + .../ONVIF/Device/GetUsersDeserializer.h | 59 + .../Device/GetUsersResponseDeserializer.h | 66 + .../ONVIF/Device/GetUsersResponseSerializer.h | 59 + .../include/ONVIF/Device/GetUsersSerializer.h | 55 + .../ONVIF/Device/GetWsdlUrlDeserializer.h | 59 + .../Device/GetWsdlUrlResponseDeserializer.h | 64 + .../Device/GetWsdlUrlResponseSerializer.h | 57 + .../ONVIF/Device/GetWsdlUrlSerializer.h | 55 + .../Device/GetZeroConfigurationDeserializer.h | 59 + ...GetZeroConfigurationResponseDeserializer.h | 66 + .../GetZeroConfigurationResponseSerializer.h | 59 + .../Device/GetZeroConfigurationSerializer.h | 55 + .../include/ONVIF/Device/IDeviceBinding.h | 246 + .../Device/LoadCACertificatesDeserializer.h | 66 + .../LoadCACertificatesResponseDeserializer.h | 59 + .../LoadCACertificatesResponseSerializer.h | 55 + .../Device/LoadCACertificatesSerializer.h | 59 + ...oadCertificateWithPrivateKeyDeserializer.h | 66 + ...ficateWithPrivateKeyResponseDeserializer.h | 59 + ...tificateWithPrivateKeyResponseSerializer.h | 55 + .../LoadCertificateWithPrivateKeySerializer.h | 59 + .../Device/LoadCertificatesDeserializer.h | 66 + .../LoadCertificatesResponseDeserializer.h | 59 + .../LoadCertificatesResponseSerializer.h | 55 + .../ONVIF/Device/LoadCertificatesSerializer.h | 59 + .../Device/MiscCapabilitiesDeserializer.h | 80 + .../ONVIF/Device/MiscCapabilitiesSerializer.h | 73 + .../Device/NetworkCapabilitiesDeserializer.h | 112 + .../Device/NetworkCapabilitiesSerializer.h | 89 + .../RemoveIPAddressFilterDeserializer.h | 66 + ...emoveIPAddressFilterResponseDeserializer.h | 59 + .../RemoveIPAddressFilterResponseSerializer.h | 55 + .../Device/RemoveIPAddressFilterSerializer.h | 59 + .../ONVIF/Device/RemoveScopesDeserializer.h | 64 + .../Device/RemoveScopesResponseDeserializer.h | 64 + .../Device/RemoveScopesResponseSerializer.h | 57 + .../ONVIF/Device/RemoveScopesSerializer.h | 57 + .../ONVIF/Device/RestoreSystemDeserializer.h | 66 + .../RestoreSystemResponseDeserializer.h | 59 + .../Device/RestoreSystemResponseSerializer.h | 55 + .../ONVIF/Device/RestoreSystemSerializer.h | 59 + .../ScanAvailableDot11NetworksDeserializer.h | 64 + ...ailableDot11NetworksResponseDeserializer.h | 66 + ...AvailableDot11NetworksResponseSerializer.h | 59 + .../ScanAvailableDot11NetworksSerializer.h | 57 + .../Device/SecurityCapabilitiesDeserializer.h | 160 + .../Device/SecurityCapabilitiesSerializer.h | 113 + .../Device/SendAuxiliaryCommandDeserializer.h | 64 + ...SendAuxiliaryCommandResponseDeserializer.h | 64 + .../SendAuxiliaryCommandResponseSerializer.h | 57 + .../Device/SendAuxiliaryCommandSerializer.h | 57 + .../ONVIF/Device/ServiceDeserializer.h | 77 + .../include/ONVIF/Device/ServiceSerializer.h | 64 + .../Device/SetAccessPolicyDeserializer.h | 66 + .../SetAccessPolicyResponseDeserializer.h | 59 + .../SetAccessPolicyResponseSerializer.h | 55 + .../ONVIF/Device/SetAccessPolicySerializer.h | 59 + ...hFailureWarningConfigurationDeserializer.h | 70 + ...WarningConfigurationResponseDeserializer.h | 59 + ...reWarningConfigurationResponseSerializer.h | 55 + ...uthFailureWarningConfigurationSerializer.h | 59 + .../SetCertificatesStatusDeserializer.h | 66 + ...etCertificatesStatusResponseDeserializer.h | 59 + .../SetCertificatesStatusResponseSerializer.h | 55 + .../Device/SetCertificatesStatusSerializer.h | 59 + .../SetClientCertificateModeDeserializer.h | 64 + ...lientCertificateModeResponseDeserializer.h | 59 + ...tClientCertificateModeResponseSerializer.h | 55 + .../SetClientCertificateModeSerializer.h | 57 + .../include/ONVIF/Device/SetDNSDeserializer.h | 72 + .../ONVIF/Device/SetDNSResponseDeserializer.h | 59 + .../ONVIF/Device/SetDNSResponseSerializer.h | 55 + .../include/ONVIF/Device/SetDNSSerializer.h | 61 + .../ONVIF/Device/SetDPAddressesDeserializer.h | 66 + .../SetDPAddressesResponseDeserializer.h | 59 + .../Device/SetDPAddressesResponseSerializer.h | 55 + .../ONVIF/Device/SetDPAddressesSerializer.h | 59 + .../Device/SetDiscoveryModeDeserializer.h | 64 + .../SetDiscoveryModeResponseDeserializer.h | 59 + .../SetDiscoveryModeResponseSerializer.h | 55 + .../ONVIF/Device/SetDiscoveryModeSerializer.h | 57 + .../SetDot1XConfigurationDeserializer.h | 66 + ...etDot1XConfigurationResponseDeserializer.h | 59 + .../SetDot1XConfigurationResponseSerializer.h | 55 + .../Device/SetDot1XConfigurationSerializer.h | 59 + .../ONVIF/Device/SetDynamicDNSDeserializer.h | 70 + .../SetDynamicDNSResponseDeserializer.h | 59 + .../Device/SetDynamicDNSResponseSerializer.h | 55 + .../ONVIF/Device/SetDynamicDNSSerializer.h | 59 + .../ONVIF/Device/SetGeoLocationDeserializer.h | 66 + .../SetGeoLocationResponseDeserializer.h | 59 + .../Device/SetGeoLocationResponseSerializer.h | 55 + .../ONVIF/Device/SetGeoLocationSerializer.h | 59 + .../Device/SetHashingAlgorithmDeserializer.h | 64 + .../SetHashingAlgorithmResponseDeserializer.h | 59 + .../SetHashingAlgorithmResponseSerializer.h | 55 + .../Device/SetHashingAlgorithmSerializer.h | 57 + .../ONVIF/Device/SetHostnameDeserializer.h | 64 + .../Device/SetHostnameFromDHCPDeserializer.h | 64 + .../SetHostnameFromDHCPResponseDeserializer.h | 64 + .../SetHostnameFromDHCPResponseSerializer.h | 57 + .../Device/SetHostnameFromDHCPSerializer.h | 57 + .../Device/SetHostnameResponseDeserializer.h | 59 + .../Device/SetHostnameResponseSerializer.h | 55 + .../ONVIF/Device/SetHostnameSerializer.h | 57 + .../Device/SetIPAddressFilterDeserializer.h | 66 + .../SetIPAddressFilterResponseDeserializer.h | 59 + .../SetIPAddressFilterResponseSerializer.h | 55 + .../Device/SetIPAddressFilterSerializer.h | 59 + .../include/ONVIF/Device/SetNTPDeserializer.h | 69 + .../ONVIF/Device/SetNTPResponseDeserializer.h | 59 + .../ONVIF/Device/SetNTPResponseSerializer.h | 55 + .../include/ONVIF/Device/SetNTPSerializer.h | 60 + .../SetNetworkDefaultGatewayDeserializer.h | 67 + ...etworkDefaultGatewayResponseDeserializer.h | 59 + ...tNetworkDefaultGatewayResponseSerializer.h | 55 + .../SetNetworkDefaultGatewaySerializer.h | 58 + .../Device/SetNetworkInterfacesDeserializer.h | 69 + ...SetNetworkInterfacesResponseDeserializer.h | 64 + .../SetNetworkInterfacesResponseSerializer.h | 57 + .../Device/SetNetworkInterfacesSerializer.h | 60 + .../Device/SetNetworkProtocolsDeserializer.h | 66 + .../SetNetworkProtocolsResponseDeserializer.h | 59 + .../SetNetworkProtocolsResponseSerializer.h | 55 + .../Device/SetNetworkProtocolsSerializer.h | 59 + ...swordComplexityConfigurationDeserializer.h | 79 + ...plexityConfigurationResponseDeserializer.h | 59 + ...omplexityConfigurationResponseSerializer.h | 55 + ...asswordComplexityConfigurationSerializer.h | 62 + ...PasswordHistoryConfigurationDeserializer.h | 67 + ...HistoryConfigurationResponseDeserializer.h | 59 + ...rdHistoryConfigurationResponseSerializer.h | 55 + ...etPasswordHistoryConfigurationSerializer.h | 58 + .../SetRelayOutputSettingsDeserializer.h | 69 + ...tRelayOutputSettingsResponseDeserializer.h | 59 + ...SetRelayOutputSettingsResponseSerializer.h | 55 + .../Device/SetRelayOutputSettingsSerializer.h | 60 + .../Device/SetRelayOutputStateDeserializer.h | 67 + .../SetRelayOutputStateResponseDeserializer.h | 59 + .../SetRelayOutputStateResponseSerializer.h | 55 + .../Device/SetRelayOutputStateSerializer.h | 58 + .../SetRemoteDiscoveryModeDeserializer.h | 64 + ...tRemoteDiscoveryModeResponseDeserializer.h | 59 + ...SetRemoteDiscoveryModeResponseSerializer.h | 55 + .../Device/SetRemoteDiscoveryModeSerializer.h | 57 + .../ONVIF/Device/SetRemoteUserDeserializer.h | 66 + .../SetRemoteUserResponseDeserializer.h | 59 + .../Device/SetRemoteUserResponseSerializer.h | 55 + .../ONVIF/Device/SetRemoteUserSerializer.h | 59 + .../ONVIF/Device/SetScopesDeserializer.h | 64 + .../Device/SetScopesResponseDeserializer.h | 59 + .../Device/SetScopesResponseSerializer.h | 55 + .../ONVIF/Device/SetScopesSerializer.h | 57 + .../SetStorageConfigurationDeserializer.h | 66 + ...StorageConfigurationResponseDeserializer.h | 59 + ...etStorageConfigurationResponseSerializer.h | 55 + .../SetStorageConfigurationSerializer.h | 59 + .../Device/SetSystemDateAndTimeDeserializer.h | 77 + ...SetSystemDateAndTimeResponseDeserializer.h | 59 + .../SetSystemDateAndTimeResponseSerializer.h | 55 + .../Device/SetSystemDateAndTimeSerializer.h | 64 + .../SetSystemFactoryDefaultDeserializer.h | 64 + ...SystemFactoryDefaultResponseDeserializer.h | 59 + ...etSystemFactoryDefaultResponseSerializer.h | 55 + .../SetSystemFactoryDefaultSerializer.h | 57 + .../ONVIF/Device/SetUserDeserializer.h | 66 + .../Device/SetUserResponseDeserializer.h | 59 + .../ONVIF/Device/SetUserResponseSerializer.h | 55 + .../include/ONVIF/Device/SetUserSerializer.h | 59 + .../Device/SetZeroConfigurationDeserializer.h | 67 + ...SetZeroConfigurationResponseDeserializer.h | 59 + .../SetZeroConfigurationResponseSerializer.h | 55 + .../Device/SetZeroConfigurationSerializer.h | 58 + .../Device/StartFirmwareUpgradeDeserializer.h | 59 + ...StartFirmwareUpgradeResponseDeserializer.h | 70 + .../StartFirmwareUpgradeResponseSerializer.h | 59 + .../Device/StartFirmwareUpgradeSerializer.h | 55 + .../Device/StartSystemRestoreDeserializer.h | 59 + .../StartSystemRestoreResponseDeserializer.h | 67 + .../StartSystemRestoreResponseSerializer.h | 58 + .../Device/StartSystemRestoreSerializer.h | 55 + .../StorageConfigurationDataDeserializer.h | 102 + .../StorageConfigurationDataSerializer.h | 84 + .../Device/StorageConfigurationDeserializer.h | 99 + .../Device/StorageConfigurationSerializer.h | 89 + .../Device/SystemCapabilitiesDeserializer.h | 152 + .../Device/SystemCapabilitiesSerializer.h | 109 + .../ONVIF/Device/SystemRebootDeserializer.h | 59 + .../Device/SystemRebootResponseDeserializer.h | 64 + .../Device/SystemRebootResponseSerializer.h | 57 + .../ONVIF/Device/SystemRebootSerializer.h | 55 + .../UpgradeSystemFirmwareDeserializer.h | 66 + ...pgradeSystemFirmwareResponseDeserializer.h | 64 + .../UpgradeSystemFirmwareResponseSerializer.h | 57 + .../Device/UpgradeSystemFirmwareSerializer.h | 59 + .../ONVIF/Device/UserCredentialDeserializer.h | 72 + .../ONVIF/Device/UserCredentialSerializer.h | 61 + .../ONVIF/DeviceCapabilitiesDeserializer.h | 89 + .../DeviceCapabilitiesExtensionDeserializer.h | 59 + .../DeviceCapabilitiesExtensionSerializer.h | 55 + .../ONVIF/DeviceCapabilitiesSerializer.h | 72 + .../include/ONVIF/DeviceEntityDeserializer.h | 80 + .../include/ONVIF/DeviceEntitySerializer.h | 73 + .../ONVIF/DeviceIO/CapabilitiesDeserializer.h | 108 + .../ONVIF/DeviceIO/CapabilitiesSerializer.h | 87 + .../DeviceIO/DeviceIOBindingClientHelper.h | 78 + .../ONVIF/DeviceIO/DeviceIOBindingProxy.h | 111 + .../DeviceIO/DeviceIOBindingProxyFactory.h | 44 + ...talInputConfigurationOptionsDeserializer.h | 64 + ...gitalInputConfigurationOptionsSerializer.h | 57 + .../GetAudioOutputConfigurationDeserializer.h | 64 + ...ioOutputConfigurationOptionsDeserializer.h | 64 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...utConfigurationOptionsResponseSerializer.h | 59 + ...udioOutputConfigurationOptionsSerializer.h | 57 + ...oOutputConfigurationResponseDeserializer.h | 66 + ...dioOutputConfigurationResponseSerializer.h | 59 + .../GetAudioOutputConfigurationSerializer.h | 57 + .../GetAudioSourceConfigurationDeserializer.h | 64 + ...ioSourceConfigurationOptionsDeserializer.h | 64 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...ceConfigurationOptionsResponseSerializer.h | 59 + ...udioSourceConfigurationOptionsSerializer.h | 57 + ...oSourceConfigurationResponseDeserializer.h | 66 + ...dioSourceConfigurationResponseSerializer.h | 59 + .../GetAudioSourceConfigurationSerializer.h | 57 + .../include/ONVIF/DeviceIO/GetDeserializer.h | 59 + ...talInputConfigurationOptionsDeserializer.h | 64 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...utConfigurationOptionsResponseSerializer.h | 59 + ...gitalInputConfigurationOptionsSerializer.h | 57 + .../DeviceIO/GetDigitalInputsDeserializer.h | 59 + .../GetDigitalInputsResponseDeserializer.h | 66 + .../GetDigitalInputsResponseSerializer.h | 59 + .../DeviceIO/GetDigitalInputsSerializer.h | 55 + .../GetRelayOutputOptionsDeserializer.h | 64 + ...etRelayOutputOptionsResponseDeserializer.h | 66 + .../GetRelayOutputOptionsResponseSerializer.h | 59 + .../GetRelayOutputOptionsSerializer.h | 57 + .../ONVIF/DeviceIO/GetResponseDeserializer.h | 64 + .../ONVIF/DeviceIO/GetResponseSerializer.h | 57 + .../GetSerialPortConfigurationDeserializer.h | 64 + ...rialPortConfigurationOptionsDeserializer.h | 64 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...rtConfigurationOptionsResponseSerializer.h | 59 + ...SerialPortConfigurationOptionsSerializer.h | 57 + ...ialPortConfigurationResponseDeserializer.h | 66 + ...erialPortConfigurationResponseSerializer.h | 59 + .../GetSerialPortConfigurationSerializer.h | 57 + .../DeviceIO/GetSerialPortsDeserializer.h | 59 + .../GetSerialPortsResponseDeserializer.h | 66 + .../GetSerialPortsResponseSerializer.h | 59 + .../ONVIF/DeviceIO/GetSerialPortsSerializer.h | 55 + .../include/ONVIF/DeviceIO/GetSerializer.h | 55 + .../GetServiceCapabilitiesDeserializer.h | 59 + ...tServiceCapabilitiesResponseDeserializer.h | 66 + ...GetServiceCapabilitiesResponseSerializer.h | 59 + .../GetServiceCapabilitiesSerializer.h | 55 + .../GetVideoOutputConfigurationDeserializer.h | 64 + ...eoOutputConfigurationOptionsDeserializer.h | 64 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...utConfigurationOptionsResponseSerializer.h | 59 + ...ideoOutputConfigurationOptionsSerializer.h | 57 + ...oOutputConfigurationResponseDeserializer.h | 66 + ...deoOutputConfigurationResponseSerializer.h | 59 + .../GetVideoOutputConfigurationSerializer.h | 57 + .../DeviceIO/GetVideoOutputsDeserializer.h | 59 + .../GetVideoOutputsResponseDeserializer.h | 66 + .../GetVideoOutputsResponseSerializer.h | 59 + .../DeviceIO/GetVideoOutputsSerializer.h | 55 + .../GetVideoSourceConfigurationDeserializer.h | 64 + ...eoSourceConfigurationOptionsDeserializer.h | 64 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...ceConfigurationOptionsResponseSerializer.h | 59 + ...ideoSourceConfigurationOptionsSerializer.h | 57 + ...oSourceConfigurationResponseDeserializer.h | 66 + ...deoSourceConfigurationResponseSerializer.h | 59 + .../GetVideoSourceConfigurationSerializer.h | 57 + .../include/ONVIF/DeviceIO/IDeviceIOBinding.h | 106 + .../DeviceIO/ParityBitListDeserializer.h | 64 + .../ONVIF/DeviceIO/ParityBitListSerializer.h | 57 + .../DeviceIO/RelayOutputOptionsDeserializer.h | 96 + .../RelayOutputOptionsExtensionDeserializer.h | 59 + .../RelayOutputOptionsExtensionSerializer.h | 55 + .../DeviceIO/RelayOutputOptionsSerializer.h | 80 + .../SendReceiveSerialCommandDeserializer.h | 78 + ...ReceiveSerialCommandResponseDeserializer.h | 66 + ...ndReceiveSerialCommandResponseSerializer.h | 59 + .../SendReceiveSerialCommandSerializer.h | 63 + .../ONVIF/DeviceIO/SerialDataDeserializer.h | 67 + .../ONVIF/DeviceIO/SerialDataSerializer.h | 58 + .../SerialPortConfigurationDeserializer.h | 98 + ...rialPortConfigurationOptionsDeserializer.h | 100 + ...SerialPortConfigurationOptionsSerializer.h | 84 + .../SerialPortConfigurationSerializer.h | 80 + .../ONVIF/DeviceIO/SerialPortDeserializer.h | 92 + .../ONVIF/DeviceIO/SerialPortSerializer.h | 85 + .../SetAudioOutputConfigurationDeserializer.h | 69 + ...oOutputConfigurationResponseDeserializer.h | 59 + ...dioOutputConfigurationResponseSerializer.h | 55 + .../SetAudioOutputConfigurationSerializer.h | 60 + .../SetAudioSourceConfigurationDeserializer.h | 69 + ...oSourceConfigurationResponseDeserializer.h | 59 + ...dioSourceConfigurationResponseSerializer.h | 55 + .../SetAudioSourceConfigurationSerializer.h | 60 + ...etDigitalInputConfigurationsDeserializer.h | 66 + ...lInputConfigurationsResponseDeserializer.h | 59 + ...talInputConfigurationsResponseSerializer.h | 55 + .../SetDigitalInputConfigurationsSerializer.h | 59 + .../SetRelayOutputSettingsDeserializer.h | 66 + ...tRelayOutputSettingsResponseDeserializer.h | 59 + ...SetRelayOutputSettingsResponseSerializer.h | 55 + .../SetRelayOutputSettingsSerializer.h | 59 + .../SetSerialPortConfigurationDeserializer.h | 69 + ...ialPortConfigurationResponseDeserializer.h | 59 + ...erialPortConfigurationResponseSerializer.h | 55 + .../SetSerialPortConfigurationSerializer.h | 60 + .../SetVideoOutputConfigurationDeserializer.h | 69 + ...oOutputConfigurationResponseDeserializer.h | 59 + ...deoOutputConfigurationResponseSerializer.h | 55 + .../SetVideoOutputConfigurationSerializer.h | 60 + .../SetVideoSourceConfigurationDeserializer.h | 69 + ...oSourceConfigurationResponseDeserializer.h | 59 + ...deoSourceConfigurationResponseSerializer.h | 55 + .../SetVideoSourceConfigurationSerializer.h | 60 + .../ONVIF/DeviceIOCapabilitiesDeserializer.h | 79 + .../ONVIF/DeviceIOCapabilitiesSerializer.h | 62 + .../include/ONVIF/DigitalInputDeserializer.h | 103 + .../include/ONVIF/DigitalInputSerializer.h | 93 + .../ONVIF/DisplayCapabilitiesDeserializer.h | 67 + .../ONVIF/DisplayCapabilitiesSerializer.h | 58 + .../Dot11AvailableNetworksDeserializer.h | 84 + ...11AvailableNetworksExtensionDeserializer.h | 59 + ...ot11AvailableNetworksExtensionSerializer.h | 55 + .../ONVIF/Dot11AvailableNetworksSerializer.h | 65 + .../ONVIF/Dot11CapabilitiesDeserializer.h | 76 + .../ONVIF/Dot11CapabilitiesSerializer.h | 61 + .../ONVIF/Dot11ConfigurationDeserializer.h | 78 + .../ONVIF/Dot11ConfigurationSerializer.h | 63 + .../include/ONVIF/Dot11PSKSetDeserializer.h | 72 + .../ONVIF/Dot11PSKSetExtensionDeserializer.h | 59 + .../ONVIF/Dot11PSKSetExtensionSerializer.h | 55 + .../include/ONVIF/Dot11PSKSetSerializer.h | 61 + .../Dot11SecurityConfigurationDeserializer.h | 80 + ...curityConfigurationExtensionDeserializer.h | 59 + ...SecurityConfigurationExtensionSerializer.h | 55 + .../Dot11SecurityConfigurationSerializer.h | 65 + .../include/ONVIF/Dot11StatusDeserializer.h | 79 + .../include/ONVIF/Dot11StatusSerializer.h | 62 + .../ONVIF/Dot1XConfigurationDeserializer.h | 86 + .../Dot1XConfigurationExtensionDeserializer.h | 59 + .../Dot1XConfigurationExtensionSerializer.h | 55 + .../ONVIF/Dot1XConfigurationSerializer.h | 67 + .../ONVIF/Dot3ConfigurationDeserializer.h | 59 + .../ONVIF/Dot3ConfigurationSerializer.h | 55 + .../include/ONVIF/DurationRangeDeserializer.h | 67 + .../include/ONVIF/DurationRangeSerializer.h | 58 + .../ONVIF/DynamicDNSInformationDeserializer.h | 75 + ...namicDNSInformationExtensionDeserializer.h | 59 + ...DynamicDNSInformationExtensionSerializer.h | 55 + .../ONVIF/DynamicDNSInformationSerializer.h | 62 + .../EAPMethodConfigurationDeserializer.h | 74 + .../ONVIF/EAPMethodConfigurationSerializer.h | 63 + .../include/ONVIF/EFlipDeserializer.h | 64 + .../include/ONVIF/EFlipOptionsDeserializer.h | 69 + .../ONVIF/EFlipOptionsExtensionDeserializer.h | 59 + .../ONVIF/EFlipOptionsExtensionSerializer.h | 55 + .../include/ONVIF/EFlipOptionsSerializer.h | 60 + .../include/ONVIF/EFlipSerializer.h | 57 + .../ONVIF/EapMethodExtensionDeserializer.h | 59 + .../ONVIF/EapMethodExtensionSerializer.h | 55 + .../ElementItemDescriptionDeserializer.h | 84 + .../ONVIF/ElementItemDescriptionSerializer.h | 75 + .../include/ONVIF/ElementItemDeserializer.h | 80 + .../include/ONVIF/ElementItemSerializer.h | 73 + .../ONVIF/EngineConfigurationDeserializer.h | 71 + .../ONVIF/EngineConfigurationSerializer.h | 62 + .../ONVIF/EventCapabilitiesDeserializer.h | 73 + .../ONVIF/EventCapabilitiesSerializer.h | 60 + .../include/ONVIF/EventFilterDeserializer.h | 63 + .../include/ONVIF/EventFilterSerializer.h | 59 + .../ONVIF/EventSubscriptionDeserializer.h | 71 + .../ONVIF/EventSubscriptionSerializer.h | 62 + .../include/ONVIF/Exposure20Deserializer.h | 99 + .../include/ONVIF/Exposure20Serializer.h | 70 + .../include/ONVIF/ExposureDeserializer.h | 99 + .../ONVIF/ExposureOptions20Deserializer.h | 96 + .../ONVIF/ExposureOptions20Serializer.h | 69 + .../ONVIF/ExposureOptionsDeserializer.h | 96 + .../include/ONVIF/ExposureOptionsSerializer.h | 69 + .../include/ONVIF/ExposureSerializer.h | 70 + .../include/ONVIF/FileProgressDeserializer.h | 67 + .../include/ONVIF/FileProgressSerializer.h | 58 + .../include/ONVIF/FilterDeserializer.h | 67 + .../include/ONVIF/FilterSerializer.h | 58 + .../ONVIF/FindEventResultDeserializer.h | 80 + .../ONVIF/FindEventResultListDeserializer.h | 69 + .../ONVIF/FindEventResultListSerializer.h | 60 + .../include/ONVIF/FindEventResultSerializer.h | 65 + .../ONVIF/FindMetadataResultDeserializer.h | 72 + .../FindMetadataResultListDeserializer.h | 69 + .../ONVIF/FindMetadataResultListSerializer.h | 60 + .../ONVIF/FindMetadataResultSerializer.h | 61 + .../ONVIF/FindPTZPositionResultDeserializer.h | 77 + .../FindPTZPositionResultListDeserializer.h | 69 + .../FindPTZPositionResultListSerializer.h | 60 + .../ONVIF/FindPTZPositionResultSerializer.h | 64 + .../FindRecordingResultListDeserializer.h | 69 + .../ONVIF/FindRecordingResultListSerializer.h | 60 + .../include/ONVIF/FloatItemsDeserializer.h | 64 + .../include/ONVIF/FloatItemsSerializer.h | 57 + .../include/ONVIF/FloatRangeDeserializer.h | 67 + .../include/ONVIF/FloatRangeSerializer.h | 58 + .../ONVIF/FocusConfiguration20Deserializer.h | 99 + ...ocusConfiguration20ExtensionDeserializer.h | 59 + .../FocusConfiguration20ExtensionSerializer.h | 55 + .../ONVIF/FocusConfiguration20Serializer.h | 81 + .../ONVIF/FocusConfigurationDeserializer.h | 73 + .../ONVIF/FocusConfigurationSerializer.h | 60 + .../include/ONVIF/FocusMoveDeserializer.h | 76 + .../include/ONVIF/FocusMoveSerializer.h | 65 + .../ONVIF/FocusOptions20Deserializer.h | 80 + .../FocusOptions20ExtensionDeserializer.h | 64 + .../ONVIF/FocusOptions20ExtensionSerializer.h | 57 + .../include/ONVIF/FocusOptions20Serializer.h | 65 + .../include/ONVIF/FocusOptionsDeserializer.h | 75 + .../include/ONVIF/FocusOptionsSerializer.h | 62 + .../include/ONVIF/FocusStatus20Deserializer.h | 75 + .../FocusStatus20ExtensionDeserializer.h | 59 + .../ONVIF/FocusStatus20ExtensionSerializer.h | 55 + .../include/ONVIF/FocusStatus20Serializer.h | 62 + .../include/ONVIF/FocusStatusDeserializer.h | 70 + .../include/ONVIF/FocusStatusSerializer.h | 59 + .../ONVIF/G711DecOptionsDeserializer.h | 69 + .../include/ONVIF/G711DecOptionsSerializer.h | 60 + .../ONVIF/G726DecOptionsDeserializer.h | 69 + .../include/ONVIF/G726DecOptionsSerializer.h | 60 + ...EapPwdConfigurationExtensionDeserializer.h | 59 + ...icEapPwdConfigurationExtensionSerializer.h | 55 + .../include/ONVIF/GeoLocationDeserializer.h | 88 + .../include/ONVIF/GeoLocationSerializer.h | 77 + .../ONVIF/GeoOrientationDeserializer.h | 88 + .../include/ONVIF/GeoOrientationSerializer.h | 77 + ...GetRecordingJobsResponseItemDeserializer.h | 69 + .../GetRecordingJobsResponseItemSerializer.h | 60 + .../GetRecordingsResponseItemDeserializer.h | 74 + .../GetRecordingsResponseItemSerializer.h | 63 + .../ONVIF/GetTracksResponseItemDeserializer.h | 69 + .../ONVIF/GetTracksResponseItemSerializer.h | 60 + .../ONVIF/GetTracksResponseListDeserializer.h | 66 + .../ONVIF/GetTracksResponseListSerializer.h | 59 + .../ONVIF/H264ConfigurationDeserializer.h | 67 + .../ONVIF/H264ConfigurationSerializer.h | 58 + .../ONVIF/H264DecOptionsDeserializer.h | 77 + .../include/ONVIF/H264DecOptionsSerializer.h | 64 + .../include/ONVIF/H264Options2Deserializer.h | 89 + .../include/ONVIF/H264Options2Serializer.h | 71 + .../include/ONVIF/H264OptionsDeserializer.h | 80 + .../include/ONVIF/H264OptionsSerializer.h | 65 + .../ONVIF/HostnameInformationDeserializer.h | 72 + ...HostnameInformationExtensionDeserializer.h | 59 + .../HostnameInformationExtensionSerializer.h | 55 + .../ONVIF/HostnameInformationSerializer.h | 61 + .../ONVIF/IOCapabilitiesDeserializer.h | 72 + .../IOCapabilitiesExtension2Deserializer.h | 59 + .../IOCapabilitiesExtension2Serializer.h | 55 + .../IOCapabilitiesExtensionDeserializer.h | 72 + .../ONVIF/IOCapabilitiesExtensionSerializer.h | 61 + .../include/ONVIF/IOCapabilitiesSerializer.h | 61 + .../include/ONVIF/IPAddressDeserializer.h | 70 + .../ONVIF/IPAddressFilterDeserializer.h | 81 + .../IPAddressFilterExtensionDeserializer.h | 59 + .../IPAddressFilterExtensionSerializer.h | 55 + .../include/ONVIF/IPAddressFilterSerializer.h | 68 + .../include/ONVIF/IPAddressSerializer.h | 59 + .../ONVIF/IPv4ConfigurationDeserializer.h | 75 + .../ONVIF/IPv4ConfigurationSerializer.h | 62 + .../ONVIF/IPv4NetworkInterfaceDeserializer.h | 69 + .../ONVIF/IPv4NetworkInterfaceSerializer.h | 60 + ...orkInterfaceSetConfigurationDeserializer.h | 72 + ...tworkInterfaceSetConfigurationSerializer.h | 61 + .../ONVIF/IPv6ConfigurationDeserializer.h | 86 + .../IPv6ConfigurationExtensionDeserializer.h | 59 + .../IPv6ConfigurationExtensionSerializer.h | 55 + .../ONVIF/IPv6ConfigurationSerializer.h | 67 + .../ONVIF/IPv6NetworkInterfaceDeserializer.h | 69 + .../ONVIF/IPv6NetworkInterfaceSerializer.h | 60 + ...orkInterfaceSetConfigurationDeserializer.h | 75 + ...tworkInterfaceSetConfigurationSerializer.h | 62 + .../ONVIF/ImageStabilizationDeserializer.h | 72 + .../ImageStabilizationExtensionDeserializer.h | 59 + .../ImageStabilizationExtensionSerializer.h | 55 + .../ImageStabilizationOptionsDeserializer.h | 74 + ...tabilizationOptionsExtensionDeserializer.h | 59 + ...eStabilizationOptionsExtensionSerializer.h | 55 + .../ImageStabilizationOptionsSerializer.h | 63 + .../ONVIF/ImageStabilizationSerializer.h | 61 + .../ONVIF/ImagingCapabilitiesDeserializer.h | 64 + .../ONVIF/ImagingCapabilitiesSerializer.h | 57 + .../ONVIF/ImagingOptions20Deserializer.h | 108 + .../ImagingOptions20Extension2Deserializer.h | 71 + .../ImagingOptions20Extension2Serializer.h | 62 + .../ImagingOptions20Extension3Deserializer.h | 81 + .../ImagingOptions20Extension3Serializer.h | 68 + .../ImagingOptions20Extension4Deserializer.h | 59 + .../ImagingOptions20Extension4Serializer.h | 55 + .../ImagingOptions20ExtensionDeserializer.h | 71 + .../ImagingOptions20ExtensionSerializer.h | 62 + .../ONVIF/ImagingOptions20Serializer.h | 81 + .../ONVIF/ImagingOptionsDeserializer.h | 103 + .../include/ONVIF/ImagingOptionsSerializer.h | 78 + .../ONVIF/ImagingSettings20Deserializer.h | 106 + .../ONVIF/ImagingSettings20Serializer.h | 79 + .../ONVIF/ImagingSettingsDeserializer.h | 106 + .../ImagingSettingsExtension202Deserializer.h | 71 + .../ImagingSettingsExtension202Serializer.h | 62 + .../ImagingSettingsExtension203Deserializer.h | 81 + .../ImagingSettingsExtension203Serializer.h | 68 + .../ImagingSettingsExtension204Deserializer.h | 59 + .../ImagingSettingsExtension204Serializer.h | 55 + .../ImagingSettingsExtension20Deserializer.h | 71 + .../ImagingSettingsExtension20Serializer.h | 62 + .../ImagingSettingsExtensionDeserializer.h | 59 + .../ImagingSettingsExtensionSerializer.h | 55 + .../include/ONVIF/ImagingSettingsSerializer.h | 79 + .../ONVIF/ImagingStatus20Deserializer.h | 71 + .../ImagingStatus20ExtensionDeserializer.h | 59 + .../ImagingStatus20ExtensionSerializer.h | 55 + .../include/ONVIF/ImagingStatus20Serializer.h | 62 + .../include/ONVIF/ImagingStatusDeserializer.h | 66 + .../include/ONVIF/ImagingStatusSerializer.h | 59 + .../include/ONVIF/IntItemsDeserializer.h | 64 + .../include/ONVIF/IntItemsSerializer.h | 57 + .../include/ONVIF/IntRangeDeserializer.h | 67 + .../include/ONVIF/IntRangeSerializer.h | 58 + .../include/ONVIF/IntRectangleDeserializer.h | 92 + .../ONVIF/IntRectangleRangeDeserializer.h | 75 + .../ONVIF/IntRectangleRangeSerializer.h | 62 + .../include/ONVIF/IntRectangleSerializer.h | 79 + .../IrCutFilterAutoAdjustmentDeserializer.h | 75 + ...ilterAutoAdjustmentExtensionDeserializer.h | 59 + ...tFilterAutoAdjustmentExtensionSerializer.h | 55 + ...tFilterAutoAdjustmentOptionsDeserializer.h | 77 + ...toAdjustmentOptionsExtensionDeserializer.h | 59 + ...AutoAdjustmentOptionsExtensionSerializer.h | 55 + ...CutFilterAutoAdjustmentOptionsSerializer.h | 64 + .../IrCutFilterAutoAdjustmentSerializer.h | 62 + .../ONVIF/ItemListDescriptionDeserializer.h | 76 + ...ItemListDescriptionExtensionDeserializer.h | 59 + .../ItemListDescriptionExtensionSerializer.h | 55 + .../ONVIF/ItemListDescriptionSerializer.h | 65 + .../include/ONVIF/ItemListDeserializer.h | 76 + .../ONVIF/ItemListExtensionDeserializer.h | 59 + .../ONVIF/ItemListExtensionSerializer.h | 55 + .../include/ONVIF/ItemListSerializer.h | 65 + .../ONVIF/JpegDecOptionsDeserializer.h | 74 + .../include/ONVIF/JpegDecOptionsSerializer.h | 63 + .../include/ONVIF/JpegOptions2Deserializer.h | 83 + .../include/ONVIF/JpegOptions2Serializer.h | 69 + .../include/ONVIF/JpegOptionsDeserializer.h | 74 + .../include/ONVIF/JpegOptionsSerializer.h | 63 + .../include/ONVIF/LayoutDeserializer.h | 71 + .../ONVIF/LayoutExtensionDeserializer.h | 59 + .../include/ONVIF/LayoutExtensionSerializer.h | 55 + .../include/ONVIF/LayoutOptionsDeserializer.h | 71 + .../LayoutOptionsExtensionDeserializer.h | 59 + .../ONVIF/LayoutOptionsExtensionSerializer.h | 55 + .../include/ONVIF/LayoutOptionsSerializer.h | 62 + .../include/ONVIF/LayoutSerializer.h | 62 + .../ONVIF/LensDescriptionDeserializer.h | 95 + .../include/ONVIF/LensDescriptionSerializer.h | 81 + .../include/ONVIF/LensOffsetDeserializer.h | 84 + .../include/ONVIF/LensOffsetSerializer.h | 75 + .../ONVIF/LensProjectionDeserializer.h | 70 + .../include/ONVIF/LensProjectionSerializer.h | 59 + .../include/ONVIF/LocalLocationDeserializer.h | 88 + .../include/ONVIF/LocalLocationSerializer.h | 77 + .../ONVIF/LocalOrientationDeserializer.h | 88 + .../ONVIF/LocalOrientationSerializer.h | 77 + .../ONVIF/LocationEntityDeserializer.h | 118 + .../include/ONVIF/LocationEntitySerializer.h | 94 + .../ONVIF/MaximumNumberOfOSDsDeserializer.h | 100 + .../ONVIF/MaximumNumberOfOSDsSerializer.h | 83 + ...AddAudioDecoderConfigurationDeserializer.h | 67 + ...DecoderConfigurationResponseDeserializer.h | 59 + ...ioDecoderConfigurationResponseSerializer.h | 55 + .../AddAudioDecoderConfigurationSerializer.h | 58 + ...AddAudioEncoderConfigurationDeserializer.h | 67 + ...EncoderConfigurationResponseDeserializer.h | 59 + ...ioEncoderConfigurationResponseSerializer.h | 55 + .../AddAudioEncoderConfigurationSerializer.h | 58 + .../AddAudioOutputConfigurationDeserializer.h | 67 + ...oOutputConfigurationResponseDeserializer.h | 59 + ...dioOutputConfigurationResponseSerializer.h | 55 + .../AddAudioOutputConfigurationSerializer.h | 58 + .../AddAudioSourceConfigurationDeserializer.h | 67 + ...oSourceConfigurationResponseDeserializer.h | 59 + ...dioSourceConfigurationResponseSerializer.h | 55 + .../AddAudioSourceConfigurationSerializer.h | 58 + .../AddMetadataConfigurationDeserializer.h | 67 + ...etadataConfigurationResponseDeserializer.h | 59 + ...dMetadataConfigurationResponseSerializer.h | 55 + .../AddMetadataConfigurationSerializer.h | 58 + .../Media/AddPTZConfigurationDeserializer.h | 67 + .../AddPTZConfigurationResponseDeserializer.h | 59 + .../AddPTZConfigurationResponseSerializer.h | 55 + .../Media/AddPTZConfigurationSerializer.h | 58 + ...dVideoAnalyticsConfigurationDeserializer.h | 67 + ...alyticsConfigurationResponseDeserializer.h | 59 + ...AnalyticsConfigurationResponseSerializer.h | 55 + ...AddVideoAnalyticsConfigurationSerializer.h | 58 + ...AddVideoEncoderConfigurationDeserializer.h | 67 + ...EncoderConfigurationResponseDeserializer.h | 59 + ...eoEncoderConfigurationResponseSerializer.h | 55 + .../AddVideoEncoderConfigurationSerializer.h | 58 + .../AddVideoSourceConfigurationDeserializer.h | 67 + ...oSourceConfigurationResponseDeserializer.h | 59 + ...deoSourceConfigurationResponseSerializer.h | 55 + .../AddVideoSourceConfigurationSerializer.h | 58 + .../ONVIF/Media/CapabilitiesDeserializer.h | 112 + .../ONVIF/Media/CapabilitiesSerializer.h | 90 + .../ONVIF/Media/CreateOSDDeserializer.h | 66 + .../Media/CreateOSDResponseDeserializer.h | 64 + .../ONVIF/Media/CreateOSDResponseSerializer.h | 57 + .../include/ONVIF/Media/CreateOSDSerializer.h | 59 + .../ONVIF/Media/CreateProfileDeserializer.h | 67 + .../Media/CreateProfileResponseDeserializer.h | 66 + .../Media/CreateProfileResponseSerializer.h | 59 + .../ONVIF/Media/CreateProfileSerializer.h | 58 + .../ONVIF/Media/DeleteOSDDeserializer.h | 64 + .../Media/DeleteOSDResponseDeserializer.h | 59 + .../ONVIF/Media/DeleteOSDResponseSerializer.h | 55 + .../include/ONVIF/Media/DeleteOSDSerializer.h | 57 + .../ONVIF/Media/DeleteProfileDeserializer.h | 64 + .../Media/DeleteProfileResponseDeserializer.h | 59 + .../Media/DeleteProfileResponseSerializer.h | 55 + .../ONVIF/Media/DeleteProfileSerializer.h | 57 + ...GetAudioDecoderConfigurationDeserializer.h | 64 + ...oDecoderConfigurationOptionsDeserializer.h | 67 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...erConfigurationOptionsResponseSerializer.h | 59 + ...dioDecoderConfigurationOptionsSerializer.h | 58 + ...DecoderConfigurationResponseDeserializer.h | 66 + ...ioDecoderConfigurationResponseSerializer.h | 59 + .../GetAudioDecoderConfigurationSerializer.h | 57 + ...etAudioDecoderConfigurationsDeserializer.h | 59 + ...ecoderConfigurationsResponseDeserializer.h | 66 + ...oDecoderConfigurationsResponseSerializer.h | 59 + .../GetAudioDecoderConfigurationsSerializer.h | 55 + ...GetAudioEncoderConfigurationDeserializer.h | 64 + ...oEncoderConfigurationOptionsDeserializer.h | 67 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...erConfigurationOptionsResponseSerializer.h | 59 + ...dioEncoderConfigurationOptionsSerializer.h | 58 + ...EncoderConfigurationResponseDeserializer.h | 66 + ...ioEncoderConfigurationResponseSerializer.h | 59 + .../GetAudioEncoderConfigurationSerializer.h | 57 + ...etAudioEncoderConfigurationsDeserializer.h | 59 + ...ncoderConfigurationsResponseDeserializer.h | 66 + ...oEncoderConfigurationsResponseSerializer.h | 59 + .../GetAudioEncoderConfigurationsSerializer.h | 55 + .../GetAudioOutputConfigurationDeserializer.h | 64 + ...ioOutputConfigurationOptionsDeserializer.h | 67 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...utConfigurationOptionsResponseSerializer.h | 59 + ...udioOutputConfigurationOptionsSerializer.h | 58 + ...oOutputConfigurationResponseDeserializer.h | 66 + ...dioOutputConfigurationResponseSerializer.h | 59 + .../GetAudioOutputConfigurationSerializer.h | 57 + ...GetAudioOutputConfigurationsDeserializer.h | 59 + ...OutputConfigurationsResponseDeserializer.h | 66 + ...ioOutputConfigurationsResponseSerializer.h | 59 + .../GetAudioOutputConfigurationsSerializer.h | 55 + .../ONVIF/Media/GetAudioOutputsDeserializer.h | 59 + .../GetAudioOutputsResponseDeserializer.h | 66 + .../Media/GetAudioOutputsResponseSerializer.h | 59 + .../ONVIF/Media/GetAudioOutputsSerializer.h | 55 + .../GetAudioSourceConfigurationDeserializer.h | 64 + ...ioSourceConfigurationOptionsDeserializer.h | 67 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...ceConfigurationOptionsResponseSerializer.h | 59 + ...udioSourceConfigurationOptionsSerializer.h | 58 + ...oSourceConfigurationResponseDeserializer.h | 66 + ...dioSourceConfigurationResponseSerializer.h | 59 + .../GetAudioSourceConfigurationSerializer.h | 57 + ...GetAudioSourceConfigurationsDeserializer.h | 59 + ...SourceConfigurationsResponseDeserializer.h | 66 + ...ioSourceConfigurationsResponseSerializer.h | 59 + .../GetAudioSourceConfigurationsSerializer.h | 55 + .../ONVIF/Media/GetAudioSourcesDeserializer.h | 59 + .../GetAudioSourcesResponseDeserializer.h | 66 + .../Media/GetAudioSourcesResponseSerializer.h | 59 + .../ONVIF/Media/GetAudioSourcesSerializer.h | 55 + ...leAudioDecoderConfigurationsDeserializer.h | 64 + ...ecoderConfigurationsResponseDeserializer.h | 66 + ...oDecoderConfigurationsResponseSerializer.h | 59 + ...ibleAudioDecoderConfigurationsSerializer.h | 57 + ...leAudioEncoderConfigurationsDeserializer.h | 64 + ...ncoderConfigurationsResponseDeserializer.h | 66 + ...oEncoderConfigurationsResponseSerializer.h | 59 + ...ibleAudioEncoderConfigurationsSerializer.h | 57 + ...bleAudioOutputConfigurationsDeserializer.h | 64 + ...OutputConfigurationsResponseDeserializer.h | 66 + ...ioOutputConfigurationsResponseSerializer.h | 59 + ...tibleAudioOutputConfigurationsSerializer.h | 57 + ...bleAudioSourceConfigurationsDeserializer.h | 64 + ...SourceConfigurationsResponseDeserializer.h | 66 + ...ioSourceConfigurationsResponseSerializer.h | 59 + ...tibleAudioSourceConfigurationsSerializer.h | 57 + ...atibleMetadataConfigurationsDeserializer.h | 64 + ...tadataConfigurationsResponseDeserializer.h | 66 + ...MetadataConfigurationsResponseSerializer.h | 59 + ...mpatibleMetadataConfigurationsSerializer.h | 57 + ...VideoAnalyticsConfigurationsDeserializer.h | 64 + ...lyticsConfigurationsResponseDeserializer.h | 66 + ...nalyticsConfigurationsResponseSerializer.h | 59 + ...leVideoAnalyticsConfigurationsSerializer.h | 57 + ...leVideoEncoderConfigurationsDeserializer.h | 64 + ...ncoderConfigurationsResponseDeserializer.h | 66 + ...oEncoderConfigurationsResponseSerializer.h | 59 + ...ibleVideoEncoderConfigurationsSerializer.h | 57 + ...bleVideoSourceConfigurationsDeserializer.h | 64 + ...SourceConfigurationsResponseDeserializer.h | 66 + ...eoSourceConfigurationsResponseSerializer.h | 59 + ...tibleVideoSourceConfigurationsSerializer.h | 57 + ...umberOfVideoEncoderInstancesDeserializer.h | 64 + ...ideoEncoderInstancesResponseDeserializer.h | 73 + ...fVideoEncoderInstancesResponseSerializer.h | 60 + ...dNumberOfVideoEncoderInstancesSerializer.h | 57 + .../GetMetadataConfigurationDeserializer.h | 64 + ...MetadataConfigurationOptionsDeserializer.h | 67 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...taConfigurationOptionsResponseSerializer.h | 59 + ...etMetadataConfigurationOptionsSerializer.h | 58 + ...etadataConfigurationResponseDeserializer.h | 66 + ...tMetadataConfigurationResponseSerializer.h | 59 + .../GetMetadataConfigurationSerializer.h | 57 + .../GetMetadataConfigurationsDeserializer.h | 59 + ...tadataConfigurationsResponseDeserializer.h | 66 + ...MetadataConfigurationsResponseSerializer.h | 59 + .../GetMetadataConfigurationsSerializer.h | 55 + .../include/ONVIF/Media/GetOSDDeserializer.h | 64 + .../ONVIF/Media/GetOSDOptionsDeserializer.h | 64 + .../Media/GetOSDOptionsResponseDeserializer.h | 66 + .../Media/GetOSDOptionsResponseSerializer.h | 59 + .../ONVIF/Media/GetOSDOptionsSerializer.h | 57 + .../ONVIF/Media/GetOSDResponseDeserializer.h | 66 + .../ONVIF/Media/GetOSDResponseSerializer.h | 59 + .../include/ONVIF/Media/GetOSDSerializer.h | 57 + .../include/ONVIF/Media/GetOSDsDeserializer.h | 64 + .../ONVIF/Media/GetOSDsResponseDeserializer.h | 66 + .../ONVIF/Media/GetOSDsResponseSerializer.h | 59 + .../include/ONVIF/Media/GetOSDsSerializer.h | 57 + .../ONVIF/Media/GetProfileDeserializer.h | 64 + .../Media/GetProfileResponseDeserializer.h | 66 + .../Media/GetProfileResponseSerializer.h | 59 + .../ONVIF/Media/GetProfileSerializer.h | 57 + .../ONVIF/Media/GetProfilesDeserializer.h | 59 + .../Media/GetProfilesResponseDeserializer.h | 66 + .../Media/GetProfilesResponseSerializer.h | 59 + .../ONVIF/Media/GetProfilesSerializer.h | 55 + .../GetServiceCapabilitiesDeserializer.h | 59 + ...tServiceCapabilitiesResponseDeserializer.h | 66 + ...GetServiceCapabilitiesResponseSerializer.h | 59 + .../Media/GetServiceCapabilitiesSerializer.h | 55 + .../ONVIF/Media/GetSnapshotUriDeserializer.h | 64 + .../GetSnapshotUriResponseDeserializer.h | 66 + .../Media/GetSnapshotUriResponseSerializer.h | 59 + .../ONVIF/Media/GetSnapshotUriSerializer.h | 57 + .../ONVIF/Media/GetStreamUriDeserializer.h | 69 + .../Media/GetStreamUriResponseDeserializer.h | 66 + .../Media/GetStreamUriResponseSerializer.h | 59 + .../ONVIF/Media/GetStreamUriSerializer.h | 60 + ...tVideoAnalyticsConfigurationDeserializer.h | 64 + ...alyticsConfigurationResponseDeserializer.h | 66 + ...AnalyticsConfigurationResponseSerializer.h | 59 + ...GetVideoAnalyticsConfigurationSerializer.h | 57 + ...VideoAnalyticsConfigurationsDeserializer.h | 59 + ...lyticsConfigurationsResponseDeserializer.h | 66 + ...nalyticsConfigurationsResponseSerializer.h | 59 + ...etVideoAnalyticsConfigurationsSerializer.h | 55 + ...GetVideoEncoderConfigurationDeserializer.h | 64 + ...oEncoderConfigurationOptionsDeserializer.h | 67 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...erConfigurationOptionsResponseSerializer.h | 59 + ...deoEncoderConfigurationOptionsSerializer.h | 58 + ...EncoderConfigurationResponseDeserializer.h | 66 + ...eoEncoderConfigurationResponseSerializer.h | 59 + .../GetVideoEncoderConfigurationSerializer.h | 57 + ...etVideoEncoderConfigurationsDeserializer.h | 59 + ...ncoderConfigurationsResponseDeserializer.h | 66 + ...oEncoderConfigurationsResponseSerializer.h | 59 + .../GetVideoEncoderConfigurationsSerializer.h | 55 + .../GetVideoSourceConfigurationDeserializer.h | 64 + ...eoSourceConfigurationOptionsDeserializer.h | 67 + ...ConfigurationOptionsResponseDeserializer.h | 66 + ...ceConfigurationOptionsResponseSerializer.h | 59 + ...ideoSourceConfigurationOptionsSerializer.h | 58 + ...oSourceConfigurationResponseDeserializer.h | 66 + ...deoSourceConfigurationResponseSerializer.h | 59 + .../GetVideoSourceConfigurationSerializer.h | 57 + ...GetVideoSourceConfigurationsDeserializer.h | 59 + ...SourceConfigurationsResponseDeserializer.h | 66 + ...eoSourceConfigurationsResponseSerializer.h | 59 + .../GetVideoSourceConfigurationsSerializer.h | 55 + .../Media/GetVideoSourceModesDeserializer.h | 64 + .../GetVideoSourceModesResponseDeserializer.h | 66 + .../GetVideoSourceModesResponseSerializer.h | 59 + .../Media/GetVideoSourceModesSerializer.h | 57 + .../ONVIF/Media/GetVideoSourcesDeserializer.h | 59 + .../GetVideoSourcesResponseDeserializer.h | 66 + .../Media/GetVideoSourcesResponseSerializer.h | 59 + .../ONVIF/Media/GetVideoSourcesSerializer.h | 55 + .../include/ONVIF/Media/IMediaBinding.h | 206 + .../ONVIF/Media/MediaBindingClientHelper.h | 78 + .../include/ONVIF/Media/MediaBindingProxy.h | 211 + .../ONVIF/Media/MediaBindingProxyFactory.h | 44 + .../Media/ProfileCapabilitiesDeserializer.h | 80 + .../Media/ProfileCapabilitiesSerializer.h | 73 + ...oveAudioDecoderConfigurationDeserializer.h | 64 + ...DecoderConfigurationResponseDeserializer.h | 59 + ...ioDecoderConfigurationResponseSerializer.h | 55 + ...emoveAudioDecoderConfigurationSerializer.h | 57 + ...oveAudioEncoderConfigurationDeserializer.h | 64 + ...EncoderConfigurationResponseDeserializer.h | 59 + ...ioEncoderConfigurationResponseSerializer.h | 55 + ...emoveAudioEncoderConfigurationSerializer.h | 57 + ...moveAudioOutputConfigurationDeserializer.h | 64 + ...oOutputConfigurationResponseDeserializer.h | 59 + ...dioOutputConfigurationResponseSerializer.h | 55 + ...RemoveAudioOutputConfigurationSerializer.h | 57 + ...moveAudioSourceConfigurationDeserializer.h | 64 + ...oSourceConfigurationResponseDeserializer.h | 59 + ...dioSourceConfigurationResponseSerializer.h | 55 + ...RemoveAudioSourceConfigurationSerializer.h | 57 + .../RemoveMetadataConfigurationDeserializer.h | 64 + ...etadataConfigurationResponseDeserializer.h | 59 + ...eMetadataConfigurationResponseSerializer.h | 55 + .../RemoveMetadataConfigurationSerializer.h | 57 + .../RemovePTZConfigurationDeserializer.h | 64 + ...movePTZConfigurationResponseDeserializer.h | 59 + ...RemovePTZConfigurationResponseSerializer.h | 55 + .../Media/RemovePTZConfigurationSerializer.h | 57 + ...eVideoAnalyticsConfigurationDeserializer.h | 64 + ...alyticsConfigurationResponseDeserializer.h | 59 + ...AnalyticsConfigurationResponseSerializer.h | 55 + ...oveVideoAnalyticsConfigurationSerializer.h | 57 + ...oveVideoEncoderConfigurationDeserializer.h | 64 + ...EncoderConfigurationResponseDeserializer.h | 59 + ...eoEncoderConfigurationResponseSerializer.h | 55 + ...emoveVideoEncoderConfigurationSerializer.h | 57 + ...moveVideoSourceConfigurationDeserializer.h | 64 + ...oSourceConfigurationResponseDeserializer.h | 59 + ...deoSourceConfigurationResponseSerializer.h | 55 + ...RemoveVideoSourceConfigurationSerializer.h | 57 + ...SetAudioDecoderConfigurationDeserializer.h | 69 + ...DecoderConfigurationResponseDeserializer.h | 59 + ...ioDecoderConfigurationResponseSerializer.h | 55 + .../SetAudioDecoderConfigurationSerializer.h | 60 + ...SetAudioEncoderConfigurationDeserializer.h | 69 + ...EncoderConfigurationResponseDeserializer.h | 59 + ...ioEncoderConfigurationResponseSerializer.h | 55 + .../SetAudioEncoderConfigurationSerializer.h | 60 + .../SetAudioOutputConfigurationDeserializer.h | 69 + ...oOutputConfigurationResponseDeserializer.h | 59 + ...dioOutputConfigurationResponseSerializer.h | 55 + .../SetAudioOutputConfigurationSerializer.h | 60 + .../SetAudioSourceConfigurationDeserializer.h | 69 + ...oSourceConfigurationResponseDeserializer.h | 59 + ...dioSourceConfigurationResponseSerializer.h | 55 + .../SetAudioSourceConfigurationSerializer.h | 60 + .../SetMetadataConfigurationDeserializer.h | 69 + ...etadataConfigurationResponseDeserializer.h | 59 + ...tMetadataConfigurationResponseSerializer.h | 55 + .../SetMetadataConfigurationSerializer.h | 60 + .../include/ONVIF/Media/SetOSDDeserializer.h | 66 + .../ONVIF/Media/SetOSDResponseDeserializer.h | 59 + .../ONVIF/Media/SetOSDResponseSerializer.h | 55 + .../include/ONVIF/Media/SetOSDSerializer.h | 59 + .../SetSynchronizationPointDeserializer.h | 64 + ...SynchronizationPointResponseDeserializer.h | 59 + ...etSynchronizationPointResponseSerializer.h | 55 + .../Media/SetSynchronizationPointSerializer.h | 57 + ...tVideoAnalyticsConfigurationDeserializer.h | 69 + ...alyticsConfigurationResponseDeserializer.h | 59 + ...AnalyticsConfigurationResponseSerializer.h | 55 + ...SetVideoAnalyticsConfigurationSerializer.h | 60 + ...SetVideoEncoderConfigurationDeserializer.h | 69 + ...EncoderConfigurationResponseDeserializer.h | 59 + ...eoEncoderConfigurationResponseSerializer.h | 55 + .../SetVideoEncoderConfigurationSerializer.h | 60 + .../SetVideoSourceConfigurationDeserializer.h | 69 + ...oSourceConfigurationResponseDeserializer.h | 59 + ...deoSourceConfigurationResponseSerializer.h | 55 + .../SetVideoSourceConfigurationSerializer.h | 60 + .../Media/SetVideoSourceModeDeserializer.h | 67 + .../SetVideoSourceModeResponseDeserializer.h | 64 + .../SetVideoSourceModeResponseSerializer.h | 57 + .../Media/SetVideoSourceModeSerializer.h | 58 + .../StartMulticastStreamingDeserializer.h | 64 + ...rtMulticastStreamingResponseDeserializer.h | 59 + ...tartMulticastStreamingResponseSerializer.h | 55 + .../Media/StartMulticastStreamingSerializer.h | 57 + .../StopMulticastStreamingDeserializer.h | 64 + ...opMulticastStreamingResponseDeserializer.h | 59 + ...StopMulticastStreamingResponseSerializer.h | 55 + .../Media/StopMulticastStreamingSerializer.h | 57 + .../Media/StreamingCapabilitiesDeserializer.h | 96 + .../Media/StreamingCapabilitiesSerializer.h | 81 + .../ONVIF/Media/VideoSourceModeDeserializer.h | 108 + .../VideoSourceModeExtensionDeserializer.h | 59 + .../VideoSourceModeExtensionSerializer.h | 55 + .../ONVIF/Media/VideoSourceModeSerializer.h | 86 + .../ONVIF/MediaAttributesDeserializer.h | 79 + .../include/ONVIF/MediaAttributesSerializer.h | 66 + .../ONVIF/MediaCapabilitiesDeserializer.h | 74 + .../MediaCapabilitiesExtensionDeserializer.h | 66 + .../MediaCapabilitiesExtensionSerializer.h | 59 + .../ONVIF/MediaCapabilitiesSerializer.h | 63 + .../include/ONVIF/MediaUriDeserializer.h | 73 + .../include/ONVIF/MediaUriSerializer.h | 60 + .../ONVIF/MessageDescriptionDeserializer.h | 98 + .../MessageDescriptionExtensionDeserializer.h | 59 + .../MessageDescriptionExtensionSerializer.h | 55 + .../ONVIF/MessageDescriptionSerializer.h | 82 + .../include/ONVIF/MessageDeserializer.h | 104 + .../ONVIF/MessageExtensionDeserializer.h | 59 + .../ONVIF/MessageExtensionSerializer.h | 55 + .../include/ONVIF/MessageSerializer.h | 84 + .../include/ONVIF/MessagesDeserializer.h | 115 + .../include/ONVIF/MessagesSerializer.h | 96 + .../ONVIF/MetadataAttributesDeserializer.h | 91 + .../ONVIF/MetadataAttributesSerializer.h | 77 + .../ONVIF/MetadataConfigurationDeserializer.h | 152 + ...tadataConfigurationExtensionDeserializer.h | 59 + ...MetadataConfigurationExtensionSerializer.h | 55 + ...MetadataConfigurationOptionsDeserializer.h | 96 + ...nfigurationOptionsExtension2Deserializer.h | 59 + ...ConfigurationOptionsExtension2Serializer.h | 55 + ...onfigurationOptionsExtensionDeserializer.h | 69 + ...aConfigurationOptionsExtensionSerializer.h | 60 + .../MetadataConfigurationOptionsSerializer.h | 82 + .../ONVIF/MetadataConfigurationSerializer.h | 118 + .../ONVIF/MetadataFilterDeserializer.h | 64 + .../include/ONVIF/MetadataFilterSerializer.h | 57 + .../include/ONVIF/MetadataInputDeserializer.h | 71 + .../MetadataInputExtensionDeserializer.h | 59 + .../ONVIF/MetadataInputExtensionSerializer.h | 55 + .../include/ONVIF/MetadataInputSerializer.h | 62 + ...otionExpressionConfigurationDeserializer.h | 66 + .../MotionExpressionConfigurationSerializer.h | 59 + .../ONVIF/MotionExpressionDeserializer.h | 85 + .../ONVIF/MotionExpressionSerializer.h | 75 + .../include/ONVIF/MoveOptions20Deserializer.h | 76 + .../include/ONVIF/MoveOptions20Serializer.h | 65 + .../include/ONVIF/MoveOptionsDeserializer.h | 76 + .../include/ONVIF/MoveOptionsSerializer.h | 65 + .../ONVIF/Mpeg4ConfigurationDeserializer.h | 67 + .../ONVIF/Mpeg4ConfigurationSerializer.h | 58 + .../ONVIF/Mpeg4DecOptionsDeserializer.h | 77 + .../include/ONVIF/Mpeg4DecOptionsSerializer.h | 64 + .../include/ONVIF/Mpeg4Options2Deserializer.h | 89 + .../include/ONVIF/Mpeg4Options2Serializer.h | 71 + .../include/ONVIF/Mpeg4OptionsDeserializer.h | 80 + .../include/ONVIF/Mpeg4OptionsSerializer.h | 65 + .../MulticastConfigurationDeserializer.h | 75 + .../ONVIF/MulticastConfigurationSerializer.h | 62 + .../ONVIF/NTPInformationDeserializer.h | 77 + .../NTPInformationExtensionDeserializer.h | 59 + .../ONVIF/NTPInformationExtensionSerializer.h | 55 + .../include/ONVIF/NTPInformationSerializer.h | 64 + .../ONVIF/NetworkCapabilitiesDeserializer.h | 78 + ...etworkCapabilitiesExtension2Deserializer.h | 59 + .../NetworkCapabilitiesExtension2Serializer.h | 55 + ...NetworkCapabilitiesExtensionDeserializer.h | 69 + .../NetworkCapabilitiesExtensionSerializer.h | 60 + .../ONVIF/NetworkCapabilitiesSerializer.h | 63 + .../ONVIF/NetworkGatewayDeserializer.h | 67 + .../include/ONVIF/NetworkGatewaySerializer.h | 58 + .../include/ONVIF/NetworkHostDeserializer.h | 80 + .../ONVIF/NetworkHostExtensionDeserializer.h | 59 + .../ONVIF/NetworkHostExtensionSerializer.h | 55 + .../include/ONVIF/NetworkHostSerializer.h | 65 + ...rkInterfaceConnectionSettingDeserializer.h | 70 + ...workInterfaceConnectionSettingSerializer.h | 59 + .../ONVIF/NetworkInterfaceDeserializer.h | 122 + .../NetworkInterfaceExtension2Deserializer.h | 59 + .../NetworkInterfaceExtension2Serializer.h | 55 + .../NetworkInterfaceExtensionDeserializer.h | 79 + .../NetworkInterfaceExtensionSerializer.h | 66 + .../ONVIF/NetworkInterfaceInfoDeserializer.h | 70 + .../ONVIF/NetworkInterfaceInfoSerializer.h | 59 + .../ONVIF/NetworkInterfaceLinkDeserializer.h | 72 + .../ONVIF/NetworkInterfaceLinkSerializer.h | 61 + .../ONVIF/NetworkInterfaceSerializer.h | 102 + ...orkInterfaceSetConfigurationDeserializer.h | 87 + ...ceSetConfigurationExtension2Deserializer.h | 59 + ...faceSetConfigurationExtension2Serializer.h | 55 + ...aceSetConfigurationExtensionDeserializer.h | 76 + ...rfaceSetConfigurationExtensionSerializer.h | 65 + ...tworkInterfaceSetConfigurationSerializer.h | 70 + .../ONVIF/NetworkProtocolDeserializer.h | 77 + .../NetworkProtocolExtensionDeserializer.h | 59 + .../NetworkProtocolExtensionSerializer.h | 55 + .../include/ONVIF/NetworkProtocolSerializer.h | 64 + .../NetworkZeroConfigurationDeserializer.h | 75 + ...kZeroConfigurationExtension2Deserializer.h | 59 + ...orkZeroConfigurationExtension2Serializer.h | 55 + ...rkZeroConfigurationExtensionDeserializer.h | 71 + ...workZeroConfigurationExtensionSerializer.h | 62 + .../NetworkZeroConfigurationSerializer.h | 62 + .../ONVIF/NoiseReductionDeserializer.h | 64 + .../ONVIF/NoiseReductionOptionsDeserializer.h | 64 + .../ONVIF/NoiseReductionOptionsSerializer.h | 57 + .../include/ONVIF/NoiseReductionSerializer.h | 57 + .../include/ONVIF/OSDColorDeserializer.h | 87 + .../ONVIF/OSDColorOptionsDeserializer.h | 76 + .../OSDColorOptionsExtensionDeserializer.h | 59 + .../OSDColorOptionsExtensionSerializer.h | 55 + .../include/ONVIF/OSDColorOptionsSerializer.h | 65 + .../include/ONVIF/OSDColorSerializer.h | 77 + .../ONVIF/OSDConfigurationDeserializer.h | 122 + .../OSDConfigurationExtensionDeserializer.h | 59 + .../OSDConfigurationExtensionSerializer.h | 55 + .../OSDConfigurationOptionsDeserializer.h | 87 + ...onfigurationOptionsExtensionDeserializer.h | 59 + ...DConfigurationOptionsExtensionSerializer.h | 55 + .../ONVIF/OSDConfigurationOptionsSerializer.h | 70 + .../ONVIF/OSDConfigurationSerializer.h | 102 + .../ONVIF/OSDImgConfigurationDeserializer.h | 69 + ...OSDImgConfigurationExtensionDeserializer.h | 59 + .../OSDImgConfigurationExtensionSerializer.h | 55 + .../ONVIF/OSDImgConfigurationSerializer.h | 60 + .../include/ONVIF/OSDImgOptionsDeserializer.h | 102 + .../OSDImgOptionsExtensionDeserializer.h | 59 + .../ONVIF/OSDImgOptionsExtensionSerializer.h | 55 + .../include/ONVIF/OSDImgOptionsSerializer.h | 84 + .../ONVIF/OSDPosConfigurationDeserializer.h | 74 + ...OSDPosConfigurationExtensionDeserializer.h | 59 + .../OSDPosConfigurationExtensionSerializer.h | 55 + .../ONVIF/OSDPosConfigurationSerializer.h | 63 + .../include/ONVIF/OSDReferenceDeserializer.h | 64 + .../include/ONVIF/OSDReferenceSerializer.h | 57 + .../ONVIF/OSDTextConfigurationDeserializer.h | 110 + ...SDTextConfigurationExtensionDeserializer.h | 59 + .../OSDTextConfigurationExtensionSerializer.h | 55 + .../ONVIF/OSDTextConfigurationSerializer.h | 86 + .../ONVIF/OSDTextOptionsDeserializer.h | 88 + .../OSDTextOptionsExtensionDeserializer.h | 59 + .../ONVIF/OSDTextOptionsExtensionSerializer.h | 55 + .../include/ONVIF/OSDTextOptionsSerializer.h | 69 + .../include/ONVIF/OnvifVersionDeserializer.h | 67 + .../include/ONVIF/OnvifVersionSerializer.h | 58 + .../ONVIF/PTControlDirectionDeserializer.h | 76 + .../PTControlDirectionExtensionDeserializer.h | 59 + .../PTControlDirectionExtensionSerializer.h | 55 + .../PTControlDirectionOptionsDeserializer.h | 76 + ...rolDirectionOptionsExtensionDeserializer.h | 59 + ...ntrolDirectionOptionsExtensionSerializer.h | 55 + .../PTControlDirectionOptionsSerializer.h | 65 + .../ONVIF/PTControlDirectionSerializer.h | 65 + .../ONVIF/PTZCapabilitiesDeserializer.h | 64 + .../include/ONVIF/PTZCapabilitiesSerializer.h | 57 + .../ONVIF/PTZConfigurationDeserializer.h | 165 + .../PTZConfigurationExtension2Deserializer.h | 59 + .../PTZConfigurationExtension2Serializer.h | 55 + .../PTZConfigurationExtensionDeserializer.h | 71 + .../PTZConfigurationExtensionSerializer.h | 62 + .../PTZConfigurationOptions2Deserializer.h | 59 + .../PTZConfigurationOptions2Serializer.h | 55 + .../PTZConfigurationOptionsDeserializer.h | 102 + .../ONVIF/PTZConfigurationOptionsSerializer.h | 86 + .../ONVIF/PTZConfigurationSerializer.h | 121 + .../include/ONVIF/PTZFilterDeserializer.h | 67 + .../include/ONVIF/PTZFilterSerializer.h | 58 + .../include/ONVIF/PTZMoveStatusDeserializer.h | 67 + .../include/ONVIF/PTZMoveStatusSerializer.h | 58 + .../include/ONVIF/PTZNodeDeserializer.h | 131 + .../ONVIF/PTZNodeExtension2Deserializer.h | 59 + .../ONVIF/PTZNodeExtension2Serializer.h | 55 + .../ONVIF/PTZNodeExtensionDeserializer.h | 71 + .../ONVIF/PTZNodeExtensionSerializer.h | 62 + .../include/ONVIF/PTZNodeSerializer.h | 106 + .../ONVIF/PTZPositionFilterDeserializer.h | 72 + .../ONVIF/PTZPositionFilterSerializer.h | 61 + .../include/ONVIF/PTZPresetDeserializer.h | 90 + .../include/ONVIF/PTZPresetSerializer.h | 78 + .../PTZPresetTourExtensionDeserializer.h | 59 + .../ONVIF/PTZPresetTourExtensionSerializer.h | 55 + .../ONVIF/PTZPresetTourOptionsDeserializer.h | 74 + .../ONVIF/PTZPresetTourOptionsSerializer.h | 63 + .../PTZPresetTourPresetDetailDeserializer.h | 77 + ...resetTourPresetDetailOptionsDeserializer.h | 82 + ...PresetDetailOptionsExtensionDeserializer.h | 59 + ...urPresetDetailOptionsExtensionSerializer.h | 55 + ...ZPresetTourPresetDetailOptionsSerializer.h | 67 + .../PTZPresetTourPresetDetailSerializer.h | 64 + .../ONVIF/PTZPresetTourSpotDeserializer.h | 79 + .../PTZPresetTourSpotExtensionDeserializer.h | 59 + .../PTZPresetTourSpotExtensionSerializer.h | 55 + .../PTZPresetTourSpotOptionsDeserializer.h | 71 + .../PTZPresetTourSpotOptionsSerializer.h | 62 + .../ONVIF/PTZPresetTourSpotSerializer.h | 66 + ...ZPresetTourStartingConditionDeserializer.h | 96 + ...urStartingConditionExtensionDeserializer.h | 59 + ...TourStartingConditionExtensionSerializer.h | 55 + ...TourStartingConditionOptionsDeserializer.h | 79 + ...ingConditionOptionsExtensionDeserializer.h | 59 + ...rtingConditionOptionsExtensionSerializer.h | 55 + ...etTourStartingConditionOptionsSerializer.h | 66 + ...PTZPresetTourStartingConditionSerializer.h | 80 + .../ONVIF/PTZPresetTourStatusDeserializer.h | 74 + ...PTZPresetTourStatusExtensionDeserializer.h | 59 + .../PTZPresetTourStatusExtensionSerializer.h | 55 + .../ONVIF/PTZPresetTourStatusSerializer.h | 63 + .../PTZPresetTourSupportedDeserializer.h | 72 + ...PresetTourSupportedExtensionDeserializer.h | 59 + ...TZPresetTourSupportedExtensionSerializer.h | 55 + .../ONVIF/PTZPresetTourSupportedSerializer.h | 61 + .../PTZPresetTourTypeExtensionDeserializer.h | 59 + .../PTZPresetTourTypeExtensionSerializer.h | 55 + .../include/ONVIF/PTZSpacesDeserializer.h | 94 + .../ONVIF/PTZSpacesExtensionDeserializer.h | 59 + .../ONVIF/PTZSpacesExtensionSerializer.h | 55 + .../include/ONVIF/PTZSpacesSerializer.h | 71 + .../include/ONVIF/PTZSpeedDeserializer.h | 71 + .../include/ONVIF/PTZSpeedSerializer.h | 62 + .../include/ONVIF/PTZStatusDeserializer.h | 79 + .../PTZStatusFilterOptionsDeserializer.h | 78 + ...StatusFilterOptionsExtensionDeserializer.h | 59 + ...TZStatusFilterOptionsExtensionSerializer.h | 55 + .../ONVIF/PTZStatusFilterOptionsSerializer.h | 63 + .../include/ONVIF/PTZStatusSerializer.h | 66 + .../include/ONVIF/PTZVectorDeserializer.h | 71 + .../include/ONVIF/PTZVectorSerializer.h | 62 + .../include/ONVIF/PanTiltLimitsDeserializer.h | 66 + .../include/ONVIF/PanTiltLimitsSerializer.h | 59 + .../ONVIF/PaneConfigurationDeserializer.h | 81 + .../ONVIF/PaneConfigurationSerializer.h | 64 + .../include/ONVIF/PaneLayoutDeserializer.h | 69 + .../ONVIF/PaneLayoutOptionsDeserializer.h | 71 + .../ONVIF/PaneLayoutOptionsSerializer.h | 62 + .../include/ONVIF/PaneLayoutSerializer.h | 60 + .../ONVIF/PaneOptionExtensionDeserializer.h | 59 + .../ONVIF/PaneOptionExtensionSerializer.h | 55 + .../include/ONVIF/PolygonDeserializer.h | 66 + .../ONVIF/PolygonOptionsDeserializer.h | 69 + .../include/ONVIF/PolygonOptionsSerializer.h | 60 + .../include/ONVIF/PolygonSerializer.h | 59 + .../PolylineArrayConfigurationDeserializer.h | 66 + .../PolylineArrayConfigurationSerializer.h | 59 + .../include/ONVIF/PolylineArrayDeserializer.h | 71 + .../PolylineArrayExtensionDeserializer.h | 59 + .../ONVIF/PolylineArrayExtensionSerializer.h | 55 + .../include/ONVIF/PolylineArraySerializer.h | 62 + .../include/ONVIF/PolylineDeserializer.h | 66 + .../include/ONVIF/PolylineSerializer.h | 59 + .../ONVIF/PrefixedIPv4AddressDeserializer.h | 67 + .../ONVIF/PrefixedIPv4AddressSerializer.h | 58 + .../ONVIF/PrefixedIPv6AddressDeserializer.h | 67 + .../ONVIF/PrefixedIPv6AddressSerializer.h | 58 + .../include/ONVIF/PresetTourDeserializer.h | 108 + .../include/ONVIF/PresetTourSerializer.h | 88 + .../ONVIF/ProfileCapabilitiesDeserializer.h | 64 + .../ONVIF/ProfileCapabilitiesSerializer.h | 57 + .../include/ONVIF/ProfileDeserializer.h | 129 + .../ONVIF/ProfileExtension2Deserializer.h | 59 + .../ONVIF/ProfileExtension2Serializer.h | 55 + .../ONVIF/ProfileExtensionDeserializer.h | 76 + .../ONVIF/ProfileExtensionSerializer.h | 65 + .../include/ONVIF/ProfileSerializer.h | 101 + .../include/ONVIF/ProfileStatusDeserializer.h | 71 + .../ProfileStatusExtensionDeserializer.h | 59 + .../ONVIF/ProfileStatusExtensionSerializer.h | 55 + .../include/ONVIF/ProfileStatusSerializer.h | 62 + ...ealTimeStreamingCapabilitiesDeserializer.h | 75 + ...reamingCapabilitiesExtensionDeserializer.h | 59 + ...StreamingCapabilitiesExtensionSerializer.h | 55 + .../RealTimeStreamingCapabilitiesSerializer.h | 62 + .../ONVIF/ReceiverCapabilitiesDeserializer.h | 79 + .../ONVIF/ReceiverCapabilitiesSerializer.h | 62 + .../ONVIF/ReceiverConfigurationDeserializer.h | 72 + .../ONVIF/ReceiverConfigurationSerializer.h | 61 + .../include/ONVIF/ReceiverDeserializer.h | 69 + .../include/ONVIF/ReceiverSerializer.h | 60 + .../ReceiverStateInformationDeserializer.h | 67 + .../ReceiverStateInformationSerializer.h | 58 + .../ONVIF/RecordingCapabilitiesDeserializer.h | 79 + .../ONVIF/RecordingCapabilitiesSerializer.h | 62 + .../RecordingConfigurationDeserializer.h | 77 + .../ONVIF/RecordingConfigurationSerializer.h | 64 + .../ONVIF/RecordingEncryptionDeserializer.h | 91 + .../ONVIF/RecordingEncryptionSerializer.h | 77 + .../ONVIF/RecordingEventFilterDeserializer.h | 72 + .../ONVIF/RecordingEventFilterSerializer.h | 61 + .../ONVIF/RecordingInformationDeserializer.h | 90 + .../ONVIF/RecordingInformationSerializer.h | 71 + .../RecordingJobConfigurationDeserializer.h | 106 + ...ingJobConfigurationExtensionDeserializer.h | 59 + ...rdingJobConfigurationExtensionSerializer.h | 55 + .../RecordingJobConfigurationSerializer.h | 86 + .../ONVIF/RecordingJobSourceDeserializer.h | 79 + .../RecordingJobSourceExtensionDeserializer.h | 59 + .../RecordingJobSourceExtensionSerializer.h | 55 + .../ONVIF/RecordingJobSourceSerializer.h | 66 + ...RecordingJobStateInformationDeserializer.h | 77 + ...JobStateInformationExtensionDeserializer.h | 59 + ...ngJobStateInformationExtensionSerializer.h | 55 + .../RecordingJobStateInformationSerializer.h | 64 + .../RecordingJobStateSourceDeserializer.h | 74 + .../ONVIF/RecordingJobStateSourceSerializer.h | 63 + .../RecordingJobStateTrackDeserializer.h | 73 + .../ONVIF/RecordingJobStateTrackSerializer.h | 60 + .../RecordingJobStateTracksDeserializer.h | 66 + .../ONVIF/RecordingJobStateTracksSerializer.h | 59 + .../ONVIF/RecordingJobTrackDeserializer.h | 67 + .../ONVIF/RecordingJobTrackSerializer.h | 58 + .../RecordingSourceInformationDeserializer.h | 76 + .../RecordingSourceInformationSerializer.h | 61 + .../ONVIF/RecordingSummaryDeserializer.h | 74 + .../ONVIF/RecordingSummarySerializer.h | 63 + ...RecordingTargetConfigurationDeserializer.h | 84 + .../RecordingTargetConfigurationSerializer.h | 65 + .../include/ONVIF/RectangleDeserializer.h | 92 + .../include/ONVIF/RectangleSerializer.h | 79 + .../include/ONVIF/RelativeFocusDeserializer.h | 67 + .../RelativeFocusOptions20Deserializer.h | 69 + .../ONVIF/RelativeFocusOptions20Serializer.h | 60 + .../ONVIF/RelativeFocusOptionsDeserializer.h | 69 + .../ONVIF/RelativeFocusOptionsSerializer.h | 60 + .../include/ONVIF/RelativeFocusSerializer.h | 58 + .../include/ONVIF/RelayOutputDeserializer.h | 99 + .../include/ONVIF/RelayOutputSerializer.h | 89 + .../ONVIF/RelayOutputSettingsDeserializer.h | 70 + .../ONVIF/RelayOutputSettingsSerializer.h | 59 + .../include/ONVIF/RemoteUserDeserializer.h | 70 + .../include/ONVIF/RemoteUserSerializer.h | 59 + .../ONVIF/ReplayCapabilitiesDeserializer.h | 64 + .../ONVIF/ReplayCapabilitiesSerializer.h | 57 + .../ONVIF/ReplayConfigurationDeserializer.h | 64 + .../ONVIF/ReplayConfigurationSerializer.h | 57 + .../include/ONVIF/ReverseDeserializer.h | 64 + .../ONVIF/ReverseOptionsDeserializer.h | 69 + .../ReverseOptionsExtensionDeserializer.h | 59 + .../ONVIF/ReverseOptionsExtensionSerializer.h | 55 + .../include/ONVIF/ReverseOptionsSerializer.h | 60 + .../include/ONVIF/ReverseSerializer.h | 57 + .../include/ONVIF/RotateDeserializer.h | 72 + .../ONVIF/RotateExtensionDeserializer.h | 59 + .../include/ONVIF/RotateExtensionSerializer.h | 55 + .../include/ONVIF/RotateOptionsDeserializer.h | 95 + .../RotateOptionsExtensionDeserializer.h | 59 + .../ONVIF/RotateOptionsExtensionSerializer.h | 55 + .../include/ONVIF/RotateOptionsSerializer.h | 81 + .../include/ONVIF/RotateSerializer.h | 61 + .../RuleEngineConfigurationDeserializer.h | 71 + ...EngineConfigurationExtensionDeserializer.h | 59 + ...leEngineConfigurationExtensionSerializer.h | 55 + .../ONVIF/RuleEngineConfigurationSerializer.h | 62 + .../ONVIF/SceneOrientationDeserializer.h | 67 + .../ONVIF/SceneOrientationSerializer.h | 58 + .../include/ONVIF/ScopeDeserializer.h | 67 + .../include/ONVIF/ScopeSerializer.h | 58 + .../ONVIF/SearchCapabilitiesDeserializer.h | 67 + .../ONVIF/SearchCapabilitiesSerializer.h | 58 + .../include/ONVIF/SearchScopeDeserializer.h | 77 + .../ONVIF/SearchScopeExtensionDeserializer.h | 59 + .../ONVIF/SearchScopeExtensionSerializer.h | 55 + .../include/ONVIF/SearchScopeSerializer.h | 64 + .../ONVIF/SecurityCapabilitiesDeserializer.h | 90 + ...curityCapabilitiesExtension2Deserializer.h | 70 + ...SecurityCapabilitiesExtension2Serializer.h | 59 + ...ecurityCapabilitiesExtensionDeserializer.h | 69 + .../SecurityCapabilitiesExtensionSerializer.h | 60 + .../ONVIF/SecurityCapabilitiesSerializer.h | 67 + .../ONVIF/SimpleItemDescriptionDeserializer.h | 84 + .../ONVIF/SimpleItemDescriptionSerializer.h | 75 + .../include/ONVIF/SimpleItemDeserializer.h | 84 + .../include/ONVIF/SimpleItemSerializer.h | 75 + .../ONVIF/SourceIdentificationDeserializer.h | 72 + ...ourceIdentificationExtensionDeserializer.h | 59 + .../SourceIdentificationExtensionSerializer.h | 55 + .../ONVIF/SourceIdentificationSerializer.h | 61 + .../ONVIF/SourceReferenceDeserializer.h | 85 + .../include/ONVIF/SourceReferenceSerializer.h | 75 + .../ONVIF/Space1DDescriptionDeserializer.h | 69 + .../ONVIF/Space1DDescriptionSerializer.h | 60 + .../ONVIF/Space2DDescriptionDeserializer.h | 72 + .../ONVIF/Space2DDescriptionSerializer.h | 61 + .../ONVIF/SphericalCoordinateDeserializer.h | 88 + .../ONVIF/SphericalCoordinateSerializer.h | 77 + .../ONVIF/StorageReferencePathDeserializer.h | 72 + ...torageReferencePathExtensionDeserializer.h | 59 + .../StorageReferencePathExtensionSerializer.h | 55 + .../ONVIF/StorageReferencePathSerializer.h | 61 + .../include/ONVIF/StreamSetupDeserializer.h | 69 + .../include/ONVIF/StreamSetupSerializer.h | 60 + .../include/ONVIF/StringItemsDeserializer.h | 64 + .../include/ONVIF/StringItemsSerializer.h | 57 + .../ONVIF/SubscriptionPolicyDeserializer.h | 59 + .../ONVIF/SubscriptionPolicySerializer.h | 55 + .../ONVIF/SupportInformationDeserializer.h | 69 + .../ONVIF/SupportInformationSerializer.h | 60 + .../SupportedAnalyticsModulesDeserializer.h | 95 + ...tedAnalyticsModulesExtensionDeserializer.h | 59 + ...ortedAnalyticsModulesExtensionSerializer.h | 55 + .../SupportedAnalyticsModulesSerializer.h | 81 + .../ONVIF/SupportedRulesDeserializer.h | 95 + .../SupportedRulesExtensionDeserializer.h | 59 + .../ONVIF/SupportedRulesExtensionSerializer.h | 55 + .../include/ONVIF/SupportedRulesSerializer.h | 81 + .../ONVIF/SystemCapabilitiesDeserializer.h | 89 + ...SystemCapabilitiesExtension2Deserializer.h | 59 + .../SystemCapabilitiesExtension2Serializer.h | 55 + .../SystemCapabilitiesExtensionDeserializer.h | 78 + .../SystemCapabilitiesExtensionSerializer.h | 63 + .../ONVIF/SystemCapabilitiesSerializer.h | 68 + .../ONVIF/SystemDateTimeDeserializer.h | 85 + .../SystemDateTimeExtensionDeserializer.h | 59 + .../ONVIF/SystemDateTimeExtensionSerializer.h | 55 + .../include/ONVIF/SystemDateTimeSerializer.h | 68 + .../include/ONVIF/SystemLogDeserializer.h | 69 + .../include/ONVIF/SystemLogSerializer.h | 60 + .../include/ONVIF/SystemLogUriDeserializer.h | 69 + .../ONVIF/SystemLogUriListDeserializer.h | 66 + .../ONVIF/SystemLogUriListSerializer.h | 59 + .../include/ONVIF/SystemLogUriSerializer.h | 60 + .../ONVIF/TLSConfigurationDeserializer.h | 64 + .../ONVIF/TLSConfigurationSerializer.h | 57 + .../include/ONVIF/TimeDeserializer.h | 70 + .../include/ONVIF/TimeSerializer.h | 59 + .../include/ONVIF/TimeZoneDeserializer.h | 64 + .../include/ONVIF/TimeZoneSerializer.h | 57 + .../ONVIF/ToneCompensationDeserializer.h | 72 + .../ToneCompensationExtensionDeserializer.h | 59 + .../ToneCompensationExtensionSerializer.h | 55 + .../ToneCompensationOptionsDeserializer.h | 67 + .../ONVIF/ToneCompensationOptionsSerializer.h | 58 + .../ONVIF/ToneCompensationSerializer.h | 61 + .../ONVIF/TrackAttributesDeserializer.h | 86 + .../TrackAttributesExtensionDeserializer.h | 59 + .../TrackAttributesExtensionSerializer.h | 55 + .../include/ONVIF/TrackAttributesSerializer.h | 71 + .../ONVIF/TrackConfigurationDeserializer.h | 67 + .../ONVIF/TrackConfigurationSerializer.h | 58 + .../ONVIF/TrackInformationDeserializer.h | 80 + .../ONVIF/TrackInformationSerializer.h | 65 + .../ONVIF/TransformationDeserializer.h | 74 + .../TransformationExtensionDeserializer.h | 59 + .../ONVIF/TransformationExtensionSerializer.h | 55 + .../include/ONVIF/TransformationSerializer.h | 63 + .../include/ONVIF/TransportDeserializer.h | 69 + .../include/ONVIF/TransportSerializer.h | 60 + .../include/ONVIF/UserDeserializer.h | 75 + .../include/ONVIF/UserExtensionDeserializer.h | 59 + .../include/ONVIF/UserExtensionSerializer.h | 55 + .../include/ONVIF/UserSerializer.h | 62 + .../include/ONVIF/Vector1DDeserializer.h | 84 + .../include/ONVIF/Vector1DSerializer.h | 75 + .../include/ONVIF/Vector2DDeserializer.h | 88 + .../include/ONVIF/Vector2DSerializer.h | 77 + .../include/ONVIF/VectorDeserializer.h | 84 + .../include/ONVIF/VectorSerializer.h | 75 + .../VideoAnalyticsConfigurationDeserializer.h | 112 + .../VideoAnalyticsConfigurationSerializer.h | 95 + .../ONVIF/VideoAttributesDeserializer.h | 76 + .../include/ONVIF/VideoAttributesSerializer.h | 61 + ...oDecoderConfigurationOptionsDeserializer.h | 81 + ...onfigurationOptionsExtensionDeserializer.h | 59 + ...rConfigurationOptionsExtensionSerializer.h | 55 + ...deoDecoderConfigurationOptionsSerializer.h | 68 + .../VideoEncoder2ConfigurationDeserializer.h | 142 + ...Encoder2ConfigurationOptionsDeserializer.h | 116 + ...eoEncoder2ConfigurationOptionsSerializer.h | 92 + .../VideoEncoder2ConfigurationSerializer.h | 112 + .../VideoEncoderConfigurationDeserializer.h | 147 + ...oEncoderConfigurationOptionsDeserializer.h | 107 + ...deoEncoderConfigurationOptionsSerializer.h | 89 + .../VideoEncoderConfigurationSerializer.h | 115 + ...ideoEncoderOptionsExtension2Deserializer.h | 59 + .../VideoEncoderOptionsExtension2Serializer.h | 55 + ...VideoEncoderOptionsExtensionDeserializer.h | 81 + .../VideoEncoderOptionsExtensionSerializer.h | 68 + .../VideoOutputConfigurationDeserializer.h | 105 + ...eoOutputConfigurationOptionsDeserializer.h | 59 + ...ideoOutputConfigurationOptionsSerializer.h | 55 + .../VideoOutputConfigurationSerializer.h | 90 + .../include/ONVIF/VideoOutputDeserializer.h | 115 + .../ONVIF/VideoOutputExtensionDeserializer.h | 59 + .../ONVIF/VideoOutputExtensionSerializer.h | 55 + .../include/ONVIF/VideoOutputSerializer.h | 97 + .../ONVIF/VideoRateControl2Deserializer.h | 88 + .../ONVIF/VideoRateControl2Serializer.h | 76 + .../ONVIF/VideoRateControlDeserializer.h | 70 + .../ONVIF/VideoRateControlSerializer.h | 59 + .../ONVIF/VideoResolution2Deserializer.h | 67 + .../ONVIF/VideoResolution2Serializer.h | 58 + .../ONVIF/VideoResolutionDeserializer.h | 67 + .../include/ONVIF/VideoResolutionSerializer.h | 58 + .../VideoSourceConfigurationDeserializer.h | 126 + ...ourceConfigurationExtension2Deserializer.h | 71 + ...oSourceConfigurationExtension2Serializer.h | 62 + ...SourceConfigurationExtensionDeserializer.h | 71 + ...eoSourceConfigurationExtensionSerializer.h | 62 + ...eoSourceConfigurationOptionsDeserializer.h | 95 + ...nfigurationOptionsExtension2Deserializer.h | 64 + ...ConfigurationOptionsExtension2Serializer.h | 57 + ...onfigurationOptionsExtensionDeserializer.h | 71 + ...eConfigurationOptionsExtensionSerializer.h | 62 + ...ideoSourceConfigurationOptionsSerializer.h | 81 + .../VideoSourceConfigurationSerializer.h | 104 + .../include/ONVIF/VideoSourceDeserializer.h | 112 + .../ONVIF/VideoSourceExtension2Deserializer.h | 59 + .../ONVIF/VideoSourceExtension2Serializer.h | 55 + .../ONVIF/VideoSourceExtensionDeserializer.h | 71 + .../ONVIF/VideoSourceExtensionSerializer.h | 62 + .../include/ONVIF/VideoSourceSerializer.h | 96 + .../ONVIF/WhiteBalance20Deserializer.h | 75 + .../WhiteBalance20ExtensionDeserializer.h | 59 + .../ONVIF/WhiteBalance20ExtensionSerializer.h | 55 + .../include/ONVIF/WhiteBalance20Serializer.h | 62 + .../include/ONVIF/WhiteBalanceDeserializer.h | 70 + .../ONVIF/WhiteBalanceOptions20Deserializer.h | 77 + ...iteBalanceOptions20ExtensionDeserializer.h | 59 + ...WhiteBalanceOptions20ExtensionSerializer.h | 55 + .../ONVIF/WhiteBalanceOptions20Serializer.h | 64 + .../ONVIF/WhiteBalanceOptionsDeserializer.h | 72 + .../ONVIF/WhiteBalanceOptionsSerializer.h | 61 + .../include/ONVIF/WhiteBalanceSerializer.h | 59 + .../ONVIF/WideDynamicRange20Deserializer.h | 67 + .../ONVIF/WideDynamicRange20Serializer.h | 58 + .../ONVIF/WideDynamicRangeDeserializer.h | 67 + .../WideDynamicRangeOptions20Deserializer.h | 69 + .../WideDynamicRangeOptions20Serializer.h | 60 + .../WideDynamicRangeOptionsDeserializer.h | 69 + .../ONVIF/WideDynamicRangeOptionsSerializer.h | 60 + .../ONVIF/WideDynamicRangeSerializer.h | 58 + .../include/ONVIF/ZoomLimitsDeserializer.h | 66 + .../include/ONVIF/ZoomLimitsSerializer.h | 59 + .../W3/Addressing/AttributedAnyDeserializer.h | 59 + .../W3/Addressing/AttributedAnySerializer.h | 55 + .../Addressing/AttributedQNameDeserializer.h | 64 + .../W3/Addressing/AttributedQNameSerializer.h | 57 + .../W3/Addressing/AttributedURIDeserializer.h | 64 + .../W3/Addressing/AttributedURISerializer.h | 57 + .../AttributedUnsignedLongDeserializer.h | 64 + .../AttributedUnsignedLongSerializer.h | 57 + .../EndpointReferenceDeserializer.h | 76 + .../Addressing/EndpointReferenceSerializer.h | 65 + .../W3/Addressing/MetadataDeserializer.h | 59 + .../W3/Addressing/MetadataSerializer.h | 55 + .../W3/Addressing/ProblemActionDeserializer.h | 69 + .../W3/Addressing/ProblemActionSerializer.h | 60 + .../ReferenceParametersDeserializer.h | 59 + .../ReferenceParametersSerializer.h | 55 + .../W3/Addressing/RelatesToDeserializer.h | 64 + .../W3/Addressing/RelatesToSerializer.h | 57 + .../W3/XMLMIME/Base64BinaryDeserializer.h | 64 + .../W3/XMLMIME/Base64BinarySerializer.h | 57 + .../W3/XMLMIME/HexBinaryDeserializer.h | 64 + .../include/W3/XMLMIME/HexBinarySerializer.h | 57 + .../include/W3/XOP/IncludeDeserializer.h | 80 + .../include/W3/XOP/IncludeSerializer.h | 73 + .../src/DeviceBindingClientHelper.cpp | 62 + .../ONVIFClient/src/DeviceBindingProxy.cpp | 2669 ++ .../src/DeviceBindingProxyFactory.cpp | 39 + .../src/DeviceIOBindingClientHelper.cpp | 62 + .../ONVIFClient/src/DeviceIOBindingProxy.cpp | 824 + .../src/DeviceIOBindingProxyFactory.cpp | 39 + .../ONVIFClient/src/IDeviceBinding.cpp | 40 + .../ONVIFClient/src/IDeviceIOBinding.cpp | 40 + .../samples/ONVIFClient/src/IMediaBinding.cpp | 40 + .../src/MediaBindingClientHelper.cpp | 62 + .../ONVIFClient/src/MediaBindingProxy.cpp | 2129 ++ .../src/MediaBindingProxyFactory.cpp | 39 + .../ONVIFClient/src/ONVIFClientApp.cpp | 549 + RemotingNG/samples/Pizzeria/CMakeLists.txt | 15 + RemotingNG/samples/Pizzeria/Makefile | 20 + RemotingNG/samples/Pizzeria/RemoteGen.xml | 35 + .../include/Pizzeria/DeliveryAddress.h | 187 + .../Pizzeria/DeliveryAddressDeserializer.h | 85 + .../DeliveryAddressDetailsDeserializer.h | 59 + .../DeliveryAddressDetailsSerializer.h | 55 + .../Pizzeria/DeliveryAddressSerializer.h | 64 + .../include/Pizzeria/ExtToppingDeserializer.h | 74 + .../include/Pizzeria/ExtToppingSerializer.h | 62 + .../include/Pizzeria/IPizzaDeliveryService.h | 66 + .../include/Pizzeria/IPizzaPickupService.h | 51 + .../samples/Pizzeria/include/Pizzeria/Pizza.h | 136 + .../include/Pizzeria/PizzaDeliveryService.h | 127 + .../PizzaDeliveryServiceRemoteObject.h | 116 + .../PizzaDeliveryServiceServerHelper.h | 111 + .../Pizzeria/PizzaDeliveryServiceSkeleton.h | 50 + .../include/Pizzeria/PizzaDeserializer.h | 75 + .../Pizzeria/PizzaDetailsDeserializer.h | 61 + .../include/Pizzeria/PizzaDetailsSerializer.h | 57 + .../include/Pizzeria/PizzaPickupService.h | 67 + .../Pizzeria/PizzaPickupServiceRemoteObject.h | 128 + .../Pizzeria/PizzaPickupServiceServerHelper.h | 112 + .../Pizzeria/PizzaPickupServiceSkeleton.h | 51 + .../include/Pizzeria/PizzaSerializer.h | 62 + .../Pizzeria/include/Pizzeria/Topping.h | 121 + .../include/Pizzeria/ToppingDeserializer.h | 65 + .../include/Pizzeria/ToppingSerializer.h | 56 + .../samples/Pizzeria/src/DeliveryAddress.cpp | 72 + .../Pizzeria/src/IPizzaDeliveryService.cpp | 40 + .../Pizzeria/src/IPizzaPickupService.cpp | 40 + RemotingNG/samples/Pizzeria/src/Pizza.cpp | 75 + .../Pizzeria/src/PizzaDeliveryService.cpp | 83 + .../src/PizzaDeliveryServiceRemoteObject.cpp | 41 + .../src/PizzaDeliveryServiceServerHelper.cpp | 86 + .../src/PizzaDeliveryServiceSkeleton.cpp | 481 + .../Pizzeria/src/PizzaPickupService.cpp | 42 + .../src/PizzaPickupServiceRemoteObject.cpp | 41 + .../src/PizzaPickupServiceServerHelper.cpp | 86 + .../src/PizzaPickupServiceSkeleton.cpp | 479 + .../samples/Pizzeria/src/PizzeriaServer.cpp | 117 + RemotingNG/samples/Pizzeria/src/Topping.cpp | 68 + .../Pizzeria/wsdl/PizzaDeliveryService.wsdl | 390 + .../Pizzeria/wsdl/PizzaPickupService.wsdl | 438 + .../samples/PizzeriaClient/CMakeLists.txt | 15 + RemotingNG/samples/PizzeriaClient/Makefile | 29 + .../Pizzeria/DeliveryAddressDeserializer.h | 85 + .../DeliveryAddressDetailsDeserializer.h | 59 + .../DeliveryAddressDetailsSerializer.h | 55 + .../Pizzeria/DeliveryAddressSerializer.h | 64 + .../include/Pizzeria/ExtToppingDeserializer.h | 74 + .../include/Pizzeria/ExtToppingSerializer.h | 62 + .../include/Pizzeria/IPizzaDeliveryService.h | 66 + .../include/Pizzeria/IPizzaPickupService.h | 51 + .../PizzaDeliveryServiceClientHelper.h | 78 + .../Pizzeria/PizzaDeliveryServiceProxy.h | 82 + .../PizzaDeliveryServiceProxyFactory.h | 44 + .../include/Pizzeria/PizzaDeserializer.h | 75 + .../Pizzeria/PizzaDetailsDeserializer.h | 61 + .../include/Pizzeria/PizzaDetailsSerializer.h | 57 + .../Pizzeria/PizzaPickupServiceClientHelper.h | 79 + .../Pizzeria/PizzaPickupServiceProxy.h | 88 + .../Pizzeria/PizzaPickupServiceProxyFactory.h | 45 + .../include/Pizzeria/PizzaSerializer.h | 62 + .../include/Pizzeria/ToppingDeserializer.h | 65 + .../include/Pizzeria/ToppingSerializer.h | 56 + .../PizzeriaClient/src/DeliveryAddress.cpp | 72 + .../src/IPizzaDeliveryService.cpp | 40 + .../src/IPizzaPickupService.cpp | 40 + .../samples/PizzeriaClient/src/Pizza.cpp | 75 + .../src/PizzaDeliveryServiceClientHelper.cpp | 62 + .../src/PizzaDeliveryServiceProxy.cpp | 255 + .../src/PizzaDeliveryServiceProxyFactory.cpp | 39 + .../src/PizzaPickupServiceClientHelper.cpp | 62 + .../src/PizzaPickupServiceProxy.cpp | 284 + .../src/PizzaPickupServiceProxyFactory.cpp | 39 + .../PizzeriaClient/src/PizzeriaClient.cpp | 74 + .../samples/PizzeriaClient/src/Topping.cpp | 68 + .../wsdl/PizzaDeliveryService.wsdl | 390 + .../wsdl/PizzaPickupService.wsdl | 438 + .../samples/PizzeriaClientREST/CMakeLists.txt | 15 + .../samples/PizzeriaClientREST/Makefile | 37 + .../include/Pizzeria/DeliveryAddress.h | 187 + .../Pizzeria/DeliveryAddressDeserializer.h | 85 + .../DeliveryAddressDetailsDeserializer.h | 59 + .../DeliveryAddressDetailsSerializer.h | 55 + .../Pizzeria/DeliveryAddressSerializer.h | 64 + .../include/Pizzeria/ExtToppingDeserializer.h | 74 + .../include/Pizzeria/ExtToppingSerializer.h | 62 + .../Pizzeria/IOrderCollectionEndpoint.h | 55 + .../include/Pizzeria/IOrderEndpoint.h | 57 + .../Pizzeria/IPizzaCollectionEndpoint.h | 51 + .../Pizzeria/IToppingCollectionEndpoint.h | 51 + .../OrderCollectionEndpointClientHelper.h | 78 + .../Pizzeria/OrderCollectionEndpointProxy.h | 62 + .../OrderCollectionEndpointProxyFactory.h | 44 + .../include/Pizzeria/OrderDeserializer.h | 66 + .../Pizzeria/OrderEndpointClientHelper.h | 78 + .../include/Pizzeria/OrderEndpointProxy.h | 64 + .../Pizzeria/OrderEndpointProxyFactory.h | 44 + .../include/Pizzeria/OrderSerializer.h | 62 + .../include/Pizzeria/Pizza.h | 136 + .../PizzaCollectionEndpointClientHelper.h | 78 + .../Pizzeria/PizzaCollectionEndpointProxy.h | 57 + .../PizzaCollectionEndpointProxyFactory.h | 44 + .../include/Pizzeria/PizzaDeserializer.h | 75 + .../Pizzeria/PizzaDetailsDeserializer.h | 61 + .../include/Pizzeria/PizzaDetailsSerializer.h | 57 + .../include/Pizzeria/PizzaSerializer.h | 62 + .../include/Pizzeria/Topping.h | 121 + .../ToppingCollectionEndpointClientHelper.h | 78 + .../Pizzeria/ToppingCollectionEndpointProxy.h | 57 + .../ToppingCollectionEndpointProxyFactory.h | 44 + .../include/Pizzeria/ToppingDeserializer.h | 65 + .../include/Pizzeria/ToppingSerializer.h | 56 + .../src/DeliveryAddress.cpp | 72 + .../src/IOrderCollectionEndpoint.cpp | 40 + .../PizzeriaClientREST/src/IOrderEndpoint.cpp | 40 + .../src/IPizzaCollectionEndpoint.cpp | 40 + .../src/IToppingCollectionEndpoint.cpp | 40 + .../OrderCollectionEndpointClientHelper.cpp | 62 + .../src/OrderCollectionEndpointProxy.cpp | 90 + .../OrderCollectionEndpointProxyFactory.cpp | 39 + .../src/OrderEndpointClientHelper.cpp | 62 + .../src/OrderEndpointProxy.cpp | 114 + .../src/OrderEndpointProxyFactory.cpp | 39 + .../samples/PizzeriaClientREST/src/Pizza.cpp | 75 + .../PizzaCollectionEndpointClientHelper.cpp | 62 + .../src/PizzaCollectionEndpointProxy.cpp | 64 + .../PizzaCollectionEndpointProxyFactory.cpp | 39 + .../PizzeriaClientREST/src/PizzeriaClient.cpp | 81 + .../PizzeriaClientREST/src/Topping.cpp | 68 + .../ToppingCollectionEndpointClientHelper.cpp | 62 + .../src/ToppingCollectionEndpointProxy.cpp | 64 + .../ToppingCollectionEndpointProxyFactory.cpp | 39 + .../samples/PizzeriaClientWS/CMakeLists.txt | 15 + RemotingNG/samples/PizzeriaClientWS/Makefile | 42 + .../samples/PizzeriaClientWS/RemoteGen.xml | 29 + .../samples/PizzeriaClientWS/XSDGen.xml | 16 + .../include/Pizzeria/DeliveryAddress.h | 212 + .../Pizzeria/DeliveryAddressDeserializer.h | 89 + .../include/Pizzeria/DeliveryAddressDetails.h | 61 + .../DeliveryAddressDetailsDeserializer.h | 66 + .../DeliveryAddressDetailsSerializer.h | 59 + .../Pizzeria/DeliveryAddressSerializer.h | 68 + .../include/Pizzeria/Exception.h | 105 + .../include/Pizzeria/ExtTopping.h | 66 + .../include/Pizzeria/ExtToppingDeserializer.h | 78 + .../include/Pizzeria/ExtToppingSerializer.h | 66 + .../include/Pizzeria/GetAnyPizzaReply.h | 62 + .../include/Pizzeria/GetAnyPizzaRequest.h | 38 + .../Pizzeria/GetMostPopularToppingReply.h | 62 + .../Pizzeria/GetMostPopularToppingRequest.h | 38 + .../include/Pizzeria/GetPizzaNamesReply.h | 72 + .../include/Pizzeria/GetPizzaNamesRequest.h | 38 + .../include/Pizzeria/GetPizzasReply.h | 72 + .../include/Pizzeria/GetPizzasRequest.h | 38 + .../include/Pizzeria/GetToppingsReply.h | 72 + .../include/Pizzeria/GetToppingsRequest.h | 38 + .../include/Pizzeria/GetWaitTimeReply.h | 62 + .../include/Pizzeria/GetWaitTimeRequest.h | 38 + .../include/Pizzeria/IPizzaDeliveryService.h | 62 + .../include/Pizzeria/OrderReply.h | 62 + .../include/Pizzeria/OrderRequest.h | 85 + .../PizzeriaClientWS/include/Pizzeria/Pizza.h | 139 + .../include/Pizzeria/PizzaDeliveryService.h | 89 + .../include/Pizzeria/PizzaDeliveryService12.h | 89 + .../PizzaDeliveryServiceClientHelper.h | 78 + .../Pizzeria/PizzaDeliveryServiceProxy.h | 67 + .../PizzaDeliveryServiceProxyFactory.h | 44 + .../include/Pizzeria/PizzaDeserializer.h | 79 + .../include/Pizzeria/PizzaDetails.h | 104 + .../Pizzeria/PizzaDetailsDeserializer.h | 72 + .../include/Pizzeria/PizzaDetailsSerializer.h | 61 + .../include/Pizzeria/PizzaSerializer.h | 66 + .../include/Pizzeria/Topping.h | 85 + .../include/Pizzeria/ToppingDeserializer.h | 69 + .../include/Pizzeria/ToppingSerializer.h | 60 + .../PizzeriaClientWS/src/DeliveryAddress.cpp | 49 + .../src/DeliveryAddressDetails.cpp | 35 + .../PizzeriaClientWS/src/Exception.cpp | 39 + .../PizzeriaClientWS/src/ExtTopping.cpp | 36 + .../PizzeriaClientWS/src/GetAnyPizzaReply.cpp | 35 + .../src/GetAnyPizzaRequest.cpp | 28 + .../src/GetMostPopularToppingReply.cpp | 35 + .../src/GetMostPopularToppingRequest.cpp | 28 + .../src/GetPizzaNamesReply.cpp | 35 + .../src/GetPizzaNamesRequest.cpp | 28 + .../PizzeriaClientWS/src/GetPizzasReply.cpp | 35 + .../PizzeriaClientWS/src/GetPizzasRequest.cpp | 28 + .../PizzeriaClientWS/src/GetToppingsReply.cpp | 35 + .../src/GetToppingsRequest.cpp | 28 + .../PizzeriaClientWS/src/GetWaitTimeReply.cpp | 35 + .../src/GetWaitTimeRequest.cpp | 28 + .../src/IPizzaDeliveryService.cpp | 40 + .../PizzeriaClientWS/src/OrderReply.cpp | 35 + .../PizzeriaClientWS/src/OrderRequest.cpp | 37 + .../samples/PizzeriaClientWS/src/Pizza.cpp | 41 + .../src/PizzaDeliveryService.cpp | 23 + .../src/PizzaDeliveryService12.cpp | 23 + .../src/PizzaDeliveryServiceClientHelper.cpp | 62 + .../src/PizzaDeliveryServiceProxy.cpp | 223 + .../src/PizzaDeliveryServiceProxyFactory.cpp | 39 + .../PizzeriaClientWS/src/PizzaDetails.cpp | 39 + .../PizzeriaClientWS/src/PizzeriaClient.cpp | 78 + .../samples/PizzeriaClientWS/src/Topping.cpp | 37 + .../samples/PizzeriaREST/CMakeLists.txt | 15 + RemotingNG/samples/PizzeriaREST/Makefile | 40 + RemotingNG/samples/PizzeriaREST/RemoteGen.xml | 44 + .../include/Pizzeria/DeliveryAddress.h | 187 + .../Pizzeria/DeliveryAddressDeserializer.h | 85 + .../DeliveryAddressDetailsDeserializer.h | 59 + .../DeliveryAddressDetailsSerializer.h | 55 + .../Pizzeria/DeliveryAddressSerializer.h | 64 + .../include/Pizzeria/ExtToppingDeserializer.h | 74 + .../include/Pizzeria/ExtToppingSerializer.h | 62 + .../Pizzeria/IOrderCollectionEndpoint.h | 55 + .../include/Pizzeria/IOrderEndpoint.h | 57 + .../Pizzeria/IPizzaCollectionEndpoint.h | 51 + .../Pizzeria/IToppingCollectionEndpoint.h | 51 + .../PizzeriaREST/include/Pizzeria/Order.h | 43 + .../include/Pizzeria/OrderCollection.h | 61 + .../Pizzeria/OrderCollectionEndpoint.h | 55 + .../OrderCollectionEndpointRemoteObject.h | 74 + .../OrderCollectionEndpointServerHelper.h | 111 + .../OrderCollectionEndpointSkeleton.h | 50 + .../include/Pizzeria/OrderDeserializer.h | 66 + .../include/Pizzeria/OrderEndpoint.h | 59 + .../Pizzeria/OrderEndpointRemoteObject.h | 82 + .../Pizzeria/OrderEndpointServerHelper.h | 111 + .../include/Pizzeria/OrderEndpointSkeleton.h | 50 + .../include/Pizzeria/OrderSerializer.h | 62 + .../PizzeriaREST/include/Pizzeria/Pizza.h | 136 + .../Pizzeria/PizzaCollectionEndpoint.h | 44 + .../PizzaCollectionEndpointRemoteObject.h | 64 + .../PizzaCollectionEndpointServerHelper.h | 111 + .../PizzaCollectionEndpointSkeleton.h | 50 + .../include/Pizzeria/PizzaDeserializer.h | 75 + .../Pizzeria/PizzaDetailsDeserializer.h | 61 + .../include/Pizzeria/PizzaDetailsSerializer.h | 57 + .../include/Pizzeria/PizzaSerializer.h | 62 + .../PizzeriaREST/include/Pizzeria/Topping.h | 123 + .../Pizzeria/ToppingCollectionEndpoint.h | 44 + .../ToppingCollectionEndpointRemoteObject.h | 64 + .../ToppingCollectionEndpointServerHelper.h | 111 + .../ToppingCollectionEndpointSkeleton.h | 50 + .../include/Pizzeria/ToppingDeserializer.h | 65 + .../include/Pizzeria/ToppingSerializer.h | 56 + .../PizzeriaREST/openapi/Pizzeria.json | 558 + .../PizzeriaREST/src/DeliveryAddress.cpp | 72 + .../src/IOrderCollectionEndpoint.cpp | 40 + .../PizzeriaREST/src/IOrderEndpoint.cpp | 40 + .../src/IPizzaCollectionEndpoint.cpp | 40 + .../src/IToppingCollectionEndpoint.cpp | 40 + .../PizzeriaREST/src/OrderCollection.cpp | 104 + .../src/OrderCollectionEndpoint.cpp | 43 + .../OrderCollectionEndpointRemoteObject.cpp | 41 + .../OrderCollectionEndpointServerHelper.cpp | 88 + .../src/OrderCollectionEndpointSkeleton.cpp | 170 + .../PizzeriaREST/src/OrderEndpoint.cpp | 49 + .../src/OrderEndpointRemoteObject.cpp | 41 + .../src/OrderEndpointServerHelper.cpp | 88 + .../src/OrderEndpointSkeleton.cpp | 236 + RemotingNG/samples/PizzeriaREST/src/Pizza.cpp | 75 + .../src/PizzaCollectionEndpoint.cpp | 31 + .../PizzaCollectionEndpointRemoteObject.cpp | 41 + .../PizzaCollectionEndpointServerHelper.cpp | 88 + .../src/PizzaCollectionEndpointSkeleton.cpp | 105 + .../PizzeriaREST/src/PizzeriaServer.cpp | 177 + .../samples/PizzeriaREST/src/Topping.cpp | 68 + .../src/ToppingCollectionEndpoint.cpp | 31 + .../ToppingCollectionEndpointRemoteObject.cpp | 41 + .../ToppingCollectionEndpointServerHelper.cpp | 88 + .../src/ToppingCollectionEndpointSkeleton.cpp | 105 + RemotingNG/samples/TimeClient/CMakeLists.txt | 15 + RemotingNG/samples/TimeClient/Makefile | 17 + RemotingNG/samples/TimeClient/RemoteGen.xml | 20 + .../samples/TimeClient/include/ITimeService.h | 51 + .../include/TimeServiceClientHelper.h | 78 + .../TimeClient/include/TimeServiceProxy.h | 57 + .../include/TimeServiceProxyFactory.h | 44 + .../samples/TimeClient/src/ITimeService.cpp | 40 + .../samples/TimeClient/src/TimeClient.cpp | 40 + .../src/TimeServiceClientHelper.cpp | 62 + .../TimeClient/src/TimeServiceProxy.cpp | 65 + .../src/TimeServiceProxyFactory.cpp | 39 + .../samples/TimeClientTCP/CMakeLists.txt | 15 + RemotingNG/samples/TimeClientTCP/Makefile | 17 + .../TimeClientTCP/include/ITimeService.h | 68 + .../include/TimeServiceClientHelper.h | 78 + .../include/TimeServiceEventSubscriber.h | 54 + .../TimeClientTCP/include/TimeServiceProxy.h | 69 + .../include/TimeServiceProxyFactory.h | 44 + .../include/WakeUpEventDeserializer.h | 59 + .../include/WakeUpEventSerializer.h | 55 + .../TimeClientTCP/src/ITimeService.cpp | 40 + .../samples/TimeClientTCP/src/TimeClient.cpp | 68 + .../src/TimeServiceClientHelper.cpp | 62 + .../src/TimeServiceEventSubscriber.cpp | 83 + .../TimeClientTCP/src/TimeServiceProxy.cpp | 132 + .../src/TimeServiceProxyFactory.cpp | 39 + .../samples/TimeClientUDS/CMakeLists.txt | 15 + RemotingNG/samples/TimeClientUDS/Makefile | 17 + .../TimeClientUDS/include/ITimeService.h | 68 + .../include/TimeServiceClientHelper.h | 78 + .../include/TimeServiceEventSubscriber.h | 54 + .../TimeClientUDS/include/TimeServiceProxy.h | 69 + .../include/TimeServiceProxyFactory.h | 44 + .../include/WakeUpEventDeserializer.h | 59 + .../include/WakeUpEventSerializer.h | 55 + .../TimeClientUDS/src/ITimeService.cpp | 40 + .../samples/TimeClientUDS/src/TimeClient.cpp | 79 + .../src/TimeServiceClientHelper.cpp | 62 + .../src/TimeServiceEventSubscriber.cpp | 83 + .../TimeClientUDS/src/TimeServiceProxy.cpp | 132 + .../src/TimeServiceProxyFactory.cpp | 39 + RemotingNG/samples/TimeServer/CMakeLists.txt | 15 + RemotingNG/samples/TimeServer/Makefile | 15 + RemotingNG/samples/TimeServer/RemoteGen.xml | 25 + .../samples/TimeServer/include/ITimeService.h | 51 + .../samples/TimeServer/include/TimeService.h | 44 + .../include/TimeServiceRemoteObject.h | 64 + .../include/TimeServiceServerHelper.h | 111 + .../TimeServer/include/TimeServiceSkeleton.h | 50 + .../samples/TimeServer/src/ITimeService.cpp | 40 + .../samples/TimeServer/src/TimeServer.cpp | 112 + .../samples/TimeServer/src/TimeService.cpp | 36 + .../src/TimeServiceRemoteObject.cpp | 41 + .../src/TimeServiceServerHelper.cpp | 86 + .../TimeServer/src/TimeServiceSkeleton.cpp | 105 + .../samples/TimeServer/wsdl/TimeService.wsdl | 150 + .../samples/TimeServerTCP/CMakeLists.txt | 15 + RemotingNG/samples/TimeServerTCP/Makefile | 16 + .../samples/TimeServerTCP/RemoteGen.xml | 20 + .../TimeServerTCP/include/ITimeService.h | 68 + .../TimeServerTCP/include/TimeService.h | 64 + .../include/TimeServiceEventDispatcher.h | 57 + .../include/TimeServiceRemoteObject.h | 85 + .../include/TimeServiceServerHelper.h | 125 + .../include/TimeServiceSkeleton.h | 50 + .../include/WakeUpEventDeserializer.h | 59 + .../include/WakeUpEventSerializer.h | 55 + .../TimeServerTCP/src/ITimeService.cpp | 40 + .../samples/TimeServerTCP/src/TimeServer.cpp | 116 + .../samples/TimeServerTCP/src/TimeService.cpp | 65 + .../src/TimeServiceEventDispatcher.cpp | 102 + .../src/TimeServiceRemoteObject.cpp | 71 + .../src/TimeServiceServerHelper.cpp | 99 + .../TimeServerTCP/src/TimeServiceSkeleton.cpp | 161 + .../samples/TimeServerUDS/CMakeLists.txt | 15 + RemotingNG/samples/TimeServerUDS/Makefile | 16 + .../samples/TimeServerUDS/RemoteGen.xml | 20 + .../TimeServerUDS/TimeServer.properties | 7 + .../TimeServerUDS/include/ITimeService.h | 68 + .../TimeServerUDS/include/TimeService.h | 64 + .../include/TimeServiceEventDispatcher.h | 57 + .../include/TimeServiceRemoteObject.h | 85 + .../include/TimeServiceServerHelper.h | 125 + .../include/TimeServiceSkeleton.h | 50 + .../include/WakeUpEventDeserializer.h | 59 + .../include/WakeUpEventSerializer.h | 55 + .../TimeServerUDS/src/ITimeService.cpp | 40 + .../samples/TimeServerUDS/src/TimeServer.cpp | 120 + .../samples/TimeServerUDS/src/TimeService.cpp | 65 + .../src/TimeServiceEventDispatcher.cpp | 102 + .../src/TimeServiceRemoteObject.cpp | 71 + .../src/TimeServiceServerHelper.cpp | 99 + .../TimeServerUDS/src/TimeServiceSkeleton.cpp | 161 + RemotingNG/samples/TwilioSMS/CMakeLists.txt | 15 + RemotingNG/samples/TwilioSMS/Makefile | 20 + RemotingNG/samples/TwilioSMS/RemoteGen.xml | 21 + .../include/Twilio/ITwilioSMSEndpoint.h | 48 + .../include/Twilio/TwilioSMSEndpoint.h | 82 + .../Twilio/TwilioSMSEndpointClientHelper.h | 76 + .../include/Twilio/TwilioSMSEndpointProxy.h | 54 + .../Twilio/TwilioSMSEndpointProxyFactory.h | 42 + .../Twilio/TwilioSMSResponseDeserializer.h | 71 + .../Twilio/TwilioSMSResponseSerializer.h | 67 + .../TwilioSMS/src/ITwilioSMSEndpoint.cpp | 38 + .../samples/TwilioSMS/src/TwilioSMSClient.cpp | 84 + .../src/TwilioSMSEndpointClientHelper.cpp | 60 + .../TwilioSMS/src/TwilioSMSEndpointProxy.cpp | 73 + .../src/TwilioSMSEndpointProxyFactory.cpp | 37 + RemotingNG/samples/Weather/CMakeLists.txt | 15 + RemotingNG/samples/Weather/Makefile | 35 + RemotingNG/samples/Weather/RemoteGen.xml | 29 + RemotingNG/samples/Weather/XSDGen.xml | 13 + .../include/WeatherWS/ArrayOfForecast.h | 80 + .../WeatherWS/ArrayOfForecastDeserializer.h | 66 + .../WeatherWS/ArrayOfForecastSerializer.h | 59 + .../WeatherWS/ArrayOfWeatherDescription.h | 72 + .../ArrayOfWeatherDescriptionDeserializer.h | 66 + .../ArrayOfWeatherDescriptionSerializer.h | 59 + .../Weather/include/WeatherWS/Forecast.h | 152 + .../include/WeatherWS/ForecastDeserializer.h | 80 + .../include/WeatherWS/ForecastReturn.h | 174 + .../WeatherWS/ForecastReturnDeserializer.h | 81 + .../WeatherWS/ForecastReturnSerializer.h | 64 + .../include/WeatherWS/ForecastSerializer.h | 65 + .../include/WeatherWS/GetCityForecastByZIP.h | 63 + .../WeatherWS/GetCityForecastByZIPResponse.h | 63 + .../include/WeatherWS/GetCityWeatherByZIP.h | 63 + .../WeatherWS/GetCityWeatherByZIPResponse.h | 62 + .../include/WeatherWS/GetWeatherInformation.h | 38 + .../WeatherWS/GetWeatherInformationResponse.h | 63 + .../Weather/include/WeatherWS/IWeather.h | 52 + .../samples/Weather/include/WeatherWS/POP.h | 86 + .../include/WeatherWS/POPDeserializer.h | 67 + .../Weather/include/WeatherWS/POPSerializer.h | 58 + .../samples/Weather/include/WeatherWS/Temp.h | 86 + .../include/WeatherWS/TempDeserializer.h | 67 + .../include/WeatherWS/TempSerializer.h | 58 + .../Weather/include/WeatherWS/Weather.h | 63 + .../include/WeatherWS/WeatherClientHelper.h | 76 + .../include/WeatherWS/WeatherDescription.h | 108 + .../WeatherDescriptionDeserializer.h | 70 + .../WeatherWS/WeatherDescriptionSerializer.h | 59 + .../Weather/include/WeatherWS/WeatherProxy.h | 57 + .../include/WeatherWS/WeatherProxyFactory.h | 42 + .../Weather/include/WeatherWS/WeatherReturn.h | 349 + .../WeatherWS/WeatherReturnDeserializer.h | 103 + .../WeatherWS/WeatherReturnSerializer.h | 70 + .../samples/Weather/src/ArrayOfForecast.cpp | 35 + .../Weather/src/ArrayOfWeatherDescription.cpp | 35 + RemotingNG/samples/Weather/src/Forecast.cpp | 43 + .../samples/Weather/src/ForecastReturn.cpp | 45 + .../Weather/src/GetCityForecastByZIP.cpp | 35 + .../src/GetCityForecastByZIPResponse.cpp | 35 + .../Weather/src/GetCityWeatherByZIP.cpp | 35 + .../src/GetCityWeatherByZIPResponse.cpp | 35 + .../Weather/src/GetWeatherInformation.cpp | 28 + .../src/GetWeatherInformationResponse.cpp | 35 + RemotingNG/samples/Weather/src/IWeather.cpp | 38 + RemotingNG/samples/Weather/src/POP.cpp | 37 + RemotingNG/samples/Weather/src/Temp.cpp | 37 + RemotingNG/samples/Weather/src/Weather.cpp | 23 + .../samples/Weather/src/WeatherClient.cpp | 81 + .../Weather/src/WeatherClientHelper.cpp | 60 + .../Weather/src/WeatherDescription.cpp | 39 + .../samples/Weather/src/WeatherProxy.cpp | 121 + .../Weather/src/WeatherProxyFactory.cpp | 37 + .../samples/Weather/src/WeatherReturn.cpp | 61 + RemotingNG/samples/Weather/wsdl/Weather.wsdl | 349 + RemotingNG/samples/dependencies | 10 + RemotingNG/src/AttributedObject.cpp | 135 + RemotingNG/src/Authenticator.cpp | 89 + RemotingNG/src/Authorizer.cpp | 32 + RemotingNG/src/BinaryDeserializer.cpp | 363 + RemotingNG/src/BinarySerializer.cpp | 234 + RemotingNG/src/Context.cpp | 121 + RemotingNG/src/Credentials.cpp | 69 + RemotingNG/src/Deserializer.cpp | 131 + RemotingNG/src/EventDispatcher.cpp | 111 + RemotingNG/src/EventListener.cpp | 33 + RemotingNG/src/EventSubscriber.cpp | 33 + RemotingNG/src/Identifiable.cpp | 45 + RemotingNG/src/Listener.cpp | 46 + RemotingNG/src/MethodHandler.cpp | 32 + RemotingNG/src/ORB.cpp | 624 + RemotingNG/src/Proxy.cpp | 54 + RemotingNG/src/ProxyFactory.cpp | 32 + RemotingNG/src/ProxyFactoryManager.cpp | 85 + RemotingNG/src/RemoteObject.cpp | 44 + RemotingNG/src/RemotingException.cpp | 44 + RemotingNG/src/Serializer.cpp | 98 + RemotingNG/src/SerializerBase.cpp | 104 + RemotingNG/src/ServerTransport.cpp | 49 + RemotingNG/src/Skeleton.cpp | 71 + RemotingNG/src/Transport.cpp | 32 + RemotingNG/src/TransportFactory.cpp | 32 + RemotingNG/src/TransportFactoryManager.cpp | 99 + RemotingNG/src/URIUtility.cpp | 152 + RemotingNG/testsuite/CMakeLists.txt | 32 + RemotingNG/testsuite/Makefile | 30 + RemotingNG/testsuite/RemoteGen.xml | 18 + RemotingNG/testsuite/src/Class1Deserializer.h | 66 + RemotingNG/testsuite/src/Class1Serializer.h | 55 + RemotingNG/testsuite/src/Driver.cpp | 17 + RemotingNG/testsuite/src/EventFilterTest.cpp | 184 + RemotingNG/testsuite/src/EventFilterTest.h | 46 + RemotingNG/testsuite/src/ITester.cpp | 38 + RemotingNG/testsuite/src/ITester.h | 160 + RemotingNG/testsuite/src/RemotingTest.cpp | 1213 + RemotingNG/testsuite/src/RemotingTest.h | 95 + .../testsuite/src/RemotingTestSuite.cpp | 26 + RemotingNG/testsuite/src/RemotingTestSuite.h | 29 + .../testsuite/src/Struct1Deserializer.h | 66 + RemotingNG/testsuite/src/Struct1Serializer.h | 57 + .../testsuite/src/Struct2Deserializer.h | 65 + RemotingNG/testsuite/src/Struct2Serializer.h | 61 + .../testsuite/src/Struct3Deserializer.h | 69 + RemotingNG/testsuite/src/Struct3Serializer.h | 65 + .../testsuite/src/Struct4Deserializer.h | 61 + RemotingNG/testsuite/src/Struct4Serializer.h | 59 + .../testsuite/src/Struct5Deserializer.h | 57 + RemotingNG/testsuite/src/Struct5Serializer.h | 53 + .../testsuite/src/Struct6Deserializer.h | 57 + RemotingNG/testsuite/src/Struct6Serializer.h | 53 + .../testsuite/src/Struct7Deserializer.h | 57 + RemotingNG/testsuite/src/Struct7Serializer.h | 53 + .../testsuite/src/Struct8Deserializer.h | 57 + RemotingNG/testsuite/src/Struct8Serializer.h | 53 + RemotingNG/testsuite/src/Tester.cpp | 319 + RemotingNG/testsuite/src/Tester.h | 381 + .../testsuite/src/TesterClientHelper.cpp | 55 + RemotingNG/testsuite/src/TesterClientHelper.h | 72 + .../testsuite/src/TesterEventDispatcher.cpp | 378 + .../testsuite/src/TesterEventDispatcher.h | 71 + .../testsuite/src/TesterEventSubscriber.cpp | 372 + .../testsuite/src/TesterEventSubscriber.h | 58 + RemotingNG/testsuite/src/TesterProxy.cpp | 1402 + RemotingNG/testsuite/src/TesterProxy.h | 175 + .../testsuite/src/TesterProxyFactory.cpp | 32 + RemotingNG/testsuite/src/TesterProxyFactory.h | 38 + .../testsuite/src/TesterRemoteObject.cpp | 104 + RemotingNG/testsuite/src/TesterRemoteObject.h | 478 + .../testsuite/src/TesterServerHelper.cpp | 92 + RemotingNG/testsuite/src/TesterServerHelper.h | 119 + RemotingNG/testsuite/src/TesterSkeleton.cpp | 3175 ++ RemotingNG/testsuite/src/TesterSkeleton.h | 44 + RemotingNG/testsuite/src/URIUtilityTest.cpp | 134 + RemotingNG/testsuite/src/URIUtilityTest.h | 42 + RemotingNG/testsuite/src/WinDriver.cpp | 28 + 4102 files changed, 460029 insertions(+) create mode 100644 RemotingNG/CMakeLists.txt create mode 100644 RemotingNG/HTTP/CMakeLists.txt create mode 100644 RemotingNG/HTTP/Makefile create mode 100644 RemotingNG/HTTP/cmake/PocoRemotingNGHTTPConfig.cmake create mode 100644 RemotingNG/HTTP/dependencies create mode 100644 RemotingNG/HTTP/doc/00250-RemotingNGHTTPTransportUserGuide.page create mode 100644 RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTP.h create mode 100644 RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTPRequestHandler.h create mode 100644 RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTPRequestHandlerFactory.h create mode 100644 RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/Listener.h create mode 100644 RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/Transport.h create mode 100644 RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/TransportFactory.h create mode 100644 RemotingNG/HTTP/src/HTTPRequestHandler.cpp create mode 100644 RemotingNG/HTTP/src/HTTPRequestHandlerFactory.cpp create mode 100644 RemotingNG/HTTP/src/Listener.cpp create mode 100644 RemotingNG/HTTP/src/Transport.cpp create mode 100644 RemotingNG/HTTP/src/TransportFactory.cpp create mode 100644 RemotingNG/HTTP/testsuite/CMakeLists.txt create mode 100644 RemotingNG/HTTP/testsuite/Makefile create mode 100644 RemotingNG/HTTP/testsuite/RemoteGen.xml create mode 100644 RemotingNG/HTTP/testsuite/src/Class1Deserializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Class1Serializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Driver.cpp create mode 100644 RemotingNG/HTTP/testsuite/src/HTTPTestSuite.cpp create mode 100644 RemotingNG/HTTP/testsuite/src/HTTPTestSuite.h create mode 100644 RemotingNG/HTTP/testsuite/src/ITester.cpp create mode 100644 RemotingNG/HTTP/testsuite/src/ITester.h create mode 100644 RemotingNG/HTTP/testsuite/src/RemotingTest.cpp create mode 100644 RemotingNG/HTTP/testsuite/src/RemotingTest.h create mode 100644 RemotingNG/HTTP/testsuite/src/Struct1Deserializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Struct1Serializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Struct2Deserializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Struct2Serializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Struct3Deserializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Struct3Serializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Struct4Deserializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Struct4Serializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Struct5Deserializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Struct5Serializer.h create mode 100644 RemotingNG/HTTP/testsuite/src/Tester.cpp create mode 100644 RemotingNG/HTTP/testsuite/src/Tester.h create mode 100644 RemotingNG/HTTP/testsuite/src/TesterClientHelper.cpp create mode 100644 RemotingNG/HTTP/testsuite/src/TesterClientHelper.h create mode 100644 RemotingNG/HTTP/testsuite/src/TesterProxy.cpp create mode 100644 RemotingNG/HTTP/testsuite/src/TesterProxy.h create mode 100644 RemotingNG/HTTP/testsuite/src/TesterProxyFactory.cpp create mode 100644 RemotingNG/HTTP/testsuite/src/TesterProxyFactory.h create mode 100644 RemotingNG/HTTP/testsuite/src/TesterRemoteObject.cpp create mode 100644 RemotingNG/HTTP/testsuite/src/TesterRemoteObject.h create mode 100644 RemotingNG/HTTP/testsuite/src/TesterServerHelper.cpp create mode 100644 RemotingNG/HTTP/testsuite/src/TesterServerHelper.h create mode 100644 RemotingNG/HTTP/testsuite/src/TesterSkeleton.cpp create mode 100644 RemotingNG/HTTP/testsuite/src/TesterSkeleton.h create mode 100644 RemotingNG/HTTP/testsuite/src/WinDriver.cpp create mode 100644 RemotingNG/JSONRPC/CMakeLists.txt create mode 100644 RemotingNG/JSONRPC/Makefile create mode 100644 RemotingNG/JSONRPC/cmake/PocoRemotingNGJSONRPCConfig.cmake create mode 100644 RemotingNG/JSONRPC/dependencies create mode 100644 RemotingNG/JSONRPC/doc/00230-RemotingNGJSONRPCTransportUserGuide.page create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/CookieStore.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Deserializer.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSArray.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONParser.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPC.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPCRequestHandler.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPCRequestHandlerFactory.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSObject.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSScalar.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSValue.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Listener.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Serializer.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Transport.h create mode 100644 RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/TransportFactory.h create mode 100644 RemotingNG/JSONRPC/src/CookieStore.cpp create mode 100644 RemotingNG/JSONRPC/src/Deserializer.cpp create mode 100644 RemotingNG/JSONRPC/src/JSArray.cpp create mode 100644 RemotingNG/JSONRPC/src/JSONParser.cpp create mode 100644 RemotingNG/JSONRPC/src/JSONRPCRequestHandler.cpp create mode 100644 RemotingNG/JSONRPC/src/JSONRPCRequestHandlerFactory.cpp create mode 100644 RemotingNG/JSONRPC/src/JSObject.cpp create mode 100644 RemotingNG/JSONRPC/src/JSScalar.cpp create mode 100644 RemotingNG/JSONRPC/src/JSValue.cpp create mode 100644 RemotingNG/JSONRPC/src/Listener.cpp create mode 100644 RemotingNG/JSONRPC/src/Serializer.cpp create mode 100644 RemotingNG/JSONRPC/src/Transport.cpp create mode 100644 RemotingNG/JSONRPC/src/TransportFactory.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/CMakeLists.txt create mode 100644 RemotingNG/JSONRPC/testsuite/Makefile create mode 100644 RemotingNG/JSONRPC/testsuite/RemoteGen.xml create mode 100644 RemotingNG/JSONRPC/testsuite/src/Class1Deserializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Class1Serializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/DeserializerTest.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/DeserializerTest.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Driver.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/ITester.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/ITester.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/JSONParserTest.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/JSONParserTest.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/JSONRPCTestSuite.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/JSONRPCTestSuite.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/RemotingTest.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/RemotingTest.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/SerializerTest.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/SerializerTest.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Struct1Deserializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Struct1Serializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Struct2Deserializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Struct2Serializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Struct3Deserializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Struct3Serializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Struct4Deserializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Struct4Serializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Struct5Deserializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Struct5Serializer.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/Tester.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/Tester.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterClientHelper.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterClientHelper.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterProxy.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterProxy.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterProxyFactory.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterProxyFactory.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterRemoteObject.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterRemoteObject.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterServerHelper.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterServerHelper.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterSkeleton.cpp create mode 100644 RemotingNG/JSONRPC/testsuite/src/TesterSkeleton.h create mode 100644 RemotingNG/JSONRPC/testsuite/src/WinDriver.cpp create mode 100644 RemotingNG/Makefile create mode 100644 RemotingNG/REST/CMakeLists.txt create mode 100644 RemotingNG/REST/Makefile create mode 100644 RemotingNG/REST/cmake/PocoRemotingNGRESTConfig.cmake create mode 100644 RemotingNG/REST/dependencies create mode 100644 RemotingNG/REST/doc/00240-RemotingNGRESTTransportUserGuide.page create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/CookieStore.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/Deserializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/FormDeserializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/FormSerializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/HeaderDeserializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/HeaderSerializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/JSArray.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/JSONDeserializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/JSONParser.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/JSONSerializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/JSObject.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/JSScalar.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/JSValue.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/Listener.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/PathDeserializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/PathSerializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/REST.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/RESTRequestHandler.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/RESTRequestHandlerFactory.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/RESTServerException.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/RawDeserializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/RawSerializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/ScalarDeserializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/ScalarSerializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/Serializer.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/Transport.h create mode 100644 RemotingNG/REST/include/Poco/RemotingNG/REST/TransportFactory.h create mode 100644 RemotingNG/REST/src/CookieStore.cpp create mode 100644 RemotingNG/REST/src/Deserializer.cpp create mode 100644 RemotingNG/REST/src/FormDeserializer.cpp create mode 100644 RemotingNG/REST/src/FormSerializer.cpp create mode 100644 RemotingNG/REST/src/HeaderDeserializer.cpp create mode 100644 RemotingNG/REST/src/HeaderSerializer.cpp create mode 100644 RemotingNG/REST/src/JSArray.cpp create mode 100644 RemotingNG/REST/src/JSONDeserializer.cpp create mode 100644 RemotingNG/REST/src/JSONParser.cpp create mode 100644 RemotingNG/REST/src/JSONSerializer.cpp create mode 100644 RemotingNG/REST/src/JSObject.cpp create mode 100644 RemotingNG/REST/src/JSScalar.cpp create mode 100644 RemotingNG/REST/src/JSValue.cpp create mode 100644 RemotingNG/REST/src/Listener.cpp create mode 100644 RemotingNG/REST/src/PathDeserializer.cpp create mode 100644 RemotingNG/REST/src/PathSerializer.cpp create mode 100644 RemotingNG/REST/src/RESTRequestHandler.cpp create mode 100644 RemotingNG/REST/src/RESTRequestHandlerFactory.cpp create mode 100644 RemotingNG/REST/src/RESTServerException.cpp create mode 100644 RemotingNG/REST/src/RawDeserializer.cpp create mode 100644 RemotingNG/REST/src/RawSerializer.cpp create mode 100644 RemotingNG/REST/src/ScalarDeserializer.cpp create mode 100644 RemotingNG/REST/src/ScalarSerializer.cpp create mode 100644 RemotingNG/REST/src/Serializer.cpp create mode 100644 RemotingNG/REST/src/Transport.cpp create mode 100644 RemotingNG/REST/src/TransportFactory.cpp create mode 100644 RemotingNG/REST/testsuite/CMakeLists.txt create mode 100644 RemotingNG/REST/testsuite/Makefile create mode 100644 RemotingNG/REST/testsuite/RemoteGen.xml create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterClientHelper.cpp create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterClientHelper.h create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterProxy.cpp create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterProxy.h create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterProxyFactory.cpp create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterProxyFactory.h create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterRemoteObject.cpp create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterRemoteObject.h create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterServerHelper.cpp create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterServerHelper.h create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterSkeleton.cpp create mode 100644 RemotingNG/REST/testsuite/src/AuthTesterSkeleton.h create mode 100644 RemotingNG/REST/testsuite/src/DeserializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/DeserializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/Driver.cpp create mode 100644 RemotingNG/REST/testsuite/src/FormDeserializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/FormDeserializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/FormSerializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/FormSerializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/HeaderDeserializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/HeaderDeserializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/HeaderSerializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/HeaderSerializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/IAuthTester.cpp create mode 100644 RemotingNG/REST/testsuite/src/IAuthTester.h create mode 100644 RemotingNG/REST/testsuite/src/ITester.cpp create mode 100644 RemotingNG/REST/testsuite/src/ITester.h create mode 100644 RemotingNG/REST/testsuite/src/JSONDeserializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/JSONDeserializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/JSONParserTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/JSONParserTest.h create mode 100644 RemotingNG/REST/testsuite/src/JSONSerializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/JSONSerializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/ObjectDeserializer.h create mode 100644 RemotingNG/REST/testsuite/src/ObjectSerializer.h create mode 100644 RemotingNG/REST/testsuite/src/PathDeserializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/PathDeserializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/PathSerializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/PathSerializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/RESTTestSuite.cpp create mode 100644 RemotingNG/REST/testsuite/src/RESTTestSuite.h create mode 100644 RemotingNG/REST/testsuite/src/RawDeserializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/RawDeserializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/RawSerializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/RawSerializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/RemotingTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/RemotingTest.h create mode 100644 RemotingNG/REST/testsuite/src/SerializerTest.cpp create mode 100644 RemotingNG/REST/testsuite/src/SerializerTest.h create mode 100644 RemotingNG/REST/testsuite/src/Tester.cpp create mode 100644 RemotingNG/REST/testsuite/src/Tester.h create mode 100644 RemotingNG/REST/testsuite/src/TesterClientHelper.cpp create mode 100644 RemotingNG/REST/testsuite/src/TesterClientHelper.h create mode 100644 RemotingNG/REST/testsuite/src/TesterProxy.cpp create mode 100644 RemotingNG/REST/testsuite/src/TesterProxy.h create mode 100644 RemotingNG/REST/testsuite/src/TesterProxyFactory.cpp create mode 100644 RemotingNG/REST/testsuite/src/TesterProxyFactory.h create mode 100644 RemotingNG/REST/testsuite/src/TesterRemoteObject.cpp create mode 100644 RemotingNG/REST/testsuite/src/TesterRemoteObject.h create mode 100644 RemotingNG/REST/testsuite/src/TesterServerHelper.cpp create mode 100644 RemotingNG/REST/testsuite/src/TesterServerHelper.h create mode 100644 RemotingNG/REST/testsuite/src/TesterSkeleton.cpp create mode 100644 RemotingNG/REST/testsuite/src/TesterSkeleton.h create mode 100644 RemotingNG/REST/testsuite/src/WinDriver.cpp create mode 100644 RemotingNG/RemoteGen/CMakeLists.txt create mode 100644 RemotingNG/RemoteGen/Makefile create mode 100644 RemotingNG/RemoteGen/RemoteGenNG.xml create mode 100644 RemotingNG/RemoteGen/RemoteGenNG.xml.install create mode 100644 RemotingNG/RemoteGen/dependencies create mode 100644 RemotingNG/RemoteGen/src/AbstractGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/AbstractGenerator.h create mode 100644 RemotingNG/RemoteGen/src/BundleActivatorGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/BundleActivatorGenerator.h create mode 100644 RemotingNG/RemoteGen/src/ClientHelperGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/ClientHelperGenerator.h create mode 100644 RemotingNG/RemoteGen/src/DeserializerGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/DeserializerGenerator.h create mode 100644 RemotingNG/RemoteGen/src/EventDispatcherGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/EventDispatcherGenerator.h create mode 100644 RemotingNG/RemoteGen/src/EventSubscriberGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/EventSubscriberGenerator.h create mode 100644 RemotingNG/RemoteGen/src/ExtensionsGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/ExtensionsGenerator.h create mode 100644 RemotingNG/RemoteGen/src/GenUtility.cpp create mode 100644 RemotingNG/RemoteGen/src/GenUtility.h create mode 100644 RemotingNG/RemoteGen/src/InterfaceGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/InterfaceGenerator.h create mode 100644 RemotingNG/RemoteGen/src/ProxyFactoryGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/ProxyFactoryGenerator.h create mode 100644 RemotingNG/RemoteGen/src/ProxyGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/ProxyGenerator.h create mode 100644 RemotingNG/RemoteGen/src/RemoteBridgeGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/RemoteBridgeGenerator.h create mode 100644 RemotingNG/RemoteGen/src/RemoteGen.cpp create mode 100644 RemotingNG/RemoteGen/src/RemoteObjectGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/RemoteObjectGenerator.h create mode 100644 RemotingNG/RemoteGen/src/SerializerGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/SerializerGenerator.h create mode 100644 RemotingNG/RemoteGen/src/ServerHelperGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/ServerHelperGenerator.h create mode 100644 RemotingNG/RemoteGen/src/SkeletonGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/SkeletonGenerator.h create mode 100644 RemotingNG/RemoteGen/src/SwaggerGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/SwaggerGenerator.h create mode 100644 RemotingNG/RemoteGen/src/WSDLGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/WSDLGenerator.h create mode 100644 RemotingNG/RemoteGen/src/XSDGenerator.cpp create mode 100644 RemotingNG/RemoteGen/src/XSDGenerator.h create mode 100644 RemotingNG/SOAP/CMakeLists.txt create mode 100644 RemotingNG/SOAP/Makefile create mode 100644 RemotingNG/SOAP/cmake/PocoRemotingNGSOAPConfig.cmake create mode 100644 RemotingNG/SOAP/dependencies create mode 100644 RemotingNG/SOAP/doc/00220-RemotingNGSOAPTransportUserGuide.page create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/CookieStore.h create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/Deserializer.h create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/Listener.h create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/SOAP.h create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/SOAPContentHandler.h create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/SOAPFaultException.h create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/SOAPRequestHandler.h create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/Serializer.h create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/Transport.h create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/TransportFactory.h create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/WSDLRequestHandler.h create mode 100644 RemotingNG/SOAP/include/Poco/RemotingNG/SOAP/XMLElement.h create mode 100644 RemotingNG/SOAP/src/CookieStore.cpp create mode 100644 RemotingNG/SOAP/src/Deserializer.cpp create mode 100644 RemotingNG/SOAP/src/Listener.cpp create mode 100644 RemotingNG/SOAP/src/SOAPContentHandler.cpp create mode 100644 RemotingNG/SOAP/src/SOAPFaultException.cpp create mode 100644 RemotingNG/SOAP/src/SOAPRequestHandler.cpp create mode 100644 RemotingNG/SOAP/src/Serializer.cpp create mode 100644 RemotingNG/SOAP/src/Transport.cpp create mode 100644 RemotingNG/SOAP/src/TransportFactory.cpp create mode 100644 RemotingNG/SOAP/src/WSDLRequestHandler.cpp create mode 100644 RemotingNG/SOAP/src/XMLElement.cpp create mode 100644 RemotingNG/SOAP/testsuite/CMakeLists.txt create mode 100644 RemotingNG/SOAP/testsuite/Makefile create mode 100644 RemotingNG/SOAP/testsuite/RemoteGen.xml create mode 100644 RemotingNG/SOAP/testsuite/src/Class1Deserializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/Class1Serializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/DeserializerTest.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/DeserializerTest.h create mode 100644 RemotingNG/SOAP/testsuite/src/Driver.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/ITester.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/ITester.h create mode 100644 RemotingNG/SOAP/testsuite/src/RemotingTest.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/RemotingTest.h create mode 100644 RemotingNG/SOAP/testsuite/src/SOAPTestSuite.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/SOAPTestSuite.h create mode 100644 RemotingNG/SOAP/testsuite/src/SerializerTest.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/SerializerTest.h create mode 100644 RemotingNG/SOAP/testsuite/src/Struct1Deserializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/Struct1Serializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/Struct2Deserializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/Struct2Serializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/Struct3Deserializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/Struct3Serializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/Struct4Deserializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/Struct4Serializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/Struct5Deserializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/Struct5Serializer.h create mode 100644 RemotingNG/SOAP/testsuite/src/Tester.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/Tester.h create mode 100644 RemotingNG/SOAP/testsuite/src/TesterClientHelper.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/TesterClientHelper.h create mode 100644 RemotingNG/SOAP/testsuite/src/TesterProxy.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/TesterProxy.h create mode 100644 RemotingNG/SOAP/testsuite/src/TesterProxyFactory.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/TesterProxyFactory.h create mode 100644 RemotingNG/SOAP/testsuite/src/TesterRemoteObject.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/TesterRemoteObject.h create mode 100644 RemotingNG/SOAP/testsuite/src/TesterServerHelper.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/TesterServerHelper.h create mode 100644 RemotingNG/SOAP/testsuite/src/TesterSkeleton.cpp create mode 100644 RemotingNG/SOAP/testsuite/src/TesterSkeleton.h create mode 100644 RemotingNG/SOAP/testsuite/src/WinDriver.cpp create mode 100644 RemotingNG/TCP/CMakeLists.txt create mode 100644 RemotingNG/TCP/Makefile create mode 100644 RemotingNG/TCP/cmake/PocoRemotingNGTCPConfig.cmake create mode 100644 RemotingNG/TCP/dependencies create mode 100644 RemotingNG/TCP/doc/00210-RemotingNGTCPTransportUserGuide.page create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/ChannelStream.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/ClientAuthenticator.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/Connection.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/ConnectionManager.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/CredentialsStore.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/Frame.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/FrameFactory.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/FrameHandler.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/FrameQueue.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/Listener.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/PlainClientAuthenticator.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/SCRAMAuthenticator.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/SCRAMClientAuthenticator.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/ServerConnection.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/ServerConnectionFactory.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/ServerTransport.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/SocketFactory.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/TCP.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/Timer.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/Transport.h create mode 100644 RemotingNG/TCP/include/Poco/RemotingNG/TCP/TransportFactory.h create mode 100644 RemotingNG/TCP/src/ChannelStream.cpp create mode 100644 RemotingNG/TCP/src/Connection.cpp create mode 100644 RemotingNG/TCP/src/ConnectionManager.cpp create mode 100644 RemotingNG/TCP/src/CredentialsStore.cpp create mode 100644 RemotingNG/TCP/src/Frame.cpp create mode 100644 RemotingNG/TCP/src/FrameQueue.cpp create mode 100644 RemotingNG/TCP/src/Listener.cpp create mode 100644 RemotingNG/TCP/src/PlainClientAuthenticator.cpp create mode 100644 RemotingNG/TCP/src/SCRAMAuthenticator.cpp create mode 100644 RemotingNG/TCP/src/SCRAMClientAuthenticator.cpp create mode 100644 RemotingNG/TCP/src/ServerConnection.cpp create mode 100644 RemotingNG/TCP/src/ServerConnectionFactory.cpp create mode 100644 RemotingNG/TCP/src/ServerTransport.cpp create mode 100644 RemotingNG/TCP/src/SocketFactory.cpp create mode 100644 RemotingNG/TCP/src/Timer.cpp create mode 100644 RemotingNG/TCP/src/Transport.cpp create mode 100644 RemotingNG/TCP/src/TransportFactory.cpp create mode 100644 RemotingNG/TCP/testsuite/CMakeLists.txt create mode 100644 RemotingNG/TCP/testsuite/Makefile create mode 100644 RemotingNG/TCP/testsuite/RemoteGen.xml create mode 100644 RemotingNG/TCP/testsuite/src/Class1Deserializer.h create mode 100644 RemotingNG/TCP/testsuite/src/Class1Serializer.h create mode 100644 RemotingNG/TCP/testsuite/src/Driver.cpp create mode 100644 RemotingNG/TCP/testsuite/src/ITester.cpp create mode 100644 RemotingNG/TCP/testsuite/src/ITester.h create mode 100644 RemotingNG/TCP/testsuite/src/RemotingTest.cpp create mode 100644 RemotingNG/TCP/testsuite/src/RemotingTest.h create mode 100644 RemotingNG/TCP/testsuite/src/Struct1Deserializer.h create mode 100644 RemotingNG/TCP/testsuite/src/Struct1Serializer.h create mode 100644 RemotingNG/TCP/testsuite/src/Struct2Deserializer.h create mode 100644 RemotingNG/TCP/testsuite/src/Struct2Serializer.h create mode 100644 RemotingNG/TCP/testsuite/src/Struct3Deserializer.h create mode 100644 RemotingNG/TCP/testsuite/src/Struct3Serializer.h create mode 100644 RemotingNG/TCP/testsuite/src/Struct4Deserializer.h create mode 100644 RemotingNG/TCP/testsuite/src/Struct4Serializer.h create mode 100644 RemotingNG/TCP/testsuite/src/Struct5Deserializer.h create mode 100644 RemotingNG/TCP/testsuite/src/Struct5Serializer.h create mode 100644 RemotingNG/TCP/testsuite/src/TCPTestSuite.cpp create mode 100644 RemotingNG/TCP/testsuite/src/TCPTestSuite.h create mode 100644 RemotingNG/TCP/testsuite/src/Tester.cpp create mode 100644 RemotingNG/TCP/testsuite/src/Tester.h create mode 100644 RemotingNG/TCP/testsuite/src/TesterClientHelper.cpp create mode 100644 RemotingNG/TCP/testsuite/src/TesterClientHelper.h create mode 100644 RemotingNG/TCP/testsuite/src/TesterEventDispatcher.cpp create mode 100644 RemotingNG/TCP/testsuite/src/TesterEventDispatcher.h create mode 100644 RemotingNG/TCP/testsuite/src/TesterEventSubscriber.cpp create mode 100644 RemotingNG/TCP/testsuite/src/TesterEventSubscriber.h create mode 100644 RemotingNG/TCP/testsuite/src/TesterProxy.cpp create mode 100644 RemotingNG/TCP/testsuite/src/TesterProxy.h create mode 100644 RemotingNG/TCP/testsuite/src/TesterProxyFactory.cpp create mode 100644 RemotingNG/TCP/testsuite/src/TesterProxyFactory.h create mode 100644 RemotingNG/TCP/testsuite/src/TesterRemoteObject.cpp create mode 100644 RemotingNG/TCP/testsuite/src/TesterRemoteObject.h create mode 100644 RemotingNG/TCP/testsuite/src/TesterServerHelper.cpp create mode 100644 RemotingNG/TCP/testsuite/src/TesterServerHelper.h create mode 100644 RemotingNG/TCP/testsuite/src/TesterSkeleton.cpp create mode 100644 RemotingNG/TCP/testsuite/src/TesterSkeleton.h create mode 100644 RemotingNG/TCP/testsuite/src/WinDriver.cpp create mode 100644 RemotingNG/cmake/PocoRemotingNGConfig.cmake create mode 100644 RemotingNG/dependencies create mode 100644 RemotingNG/doc/00100-RemotingNGOverview.page create mode 100644 RemotingNG/doc/00150-RemotingNGTutorialPart1.page create mode 100644 RemotingNG/doc/00151-RemotingNGTutorialPart2.page create mode 100644 RemotingNG/doc/00152-RemotingNGTutorialPart3.page create mode 100644 RemotingNG/doc/00153-RemotingNGTutorialPart4.page create mode 100644 RemotingNG/doc/00200-RemotingNGUserGuide.page create mode 100644 RemotingNG/doc/00300-RemotingNGAttributesReference.page create mode 100644 RemotingNG/doc/00400-RemotingNGLimitations.page create mode 100644 RemotingNG/doc/99100-RemotingNGReleaseNotes.page create mode 100644 RemotingNG/doc/Remoting.graffle create mode 100644 RemotingNG/doc/images/RemoteCall.png create mode 100644 RemotingNG/doc/images/RemotingClasses.png create mode 100644 RemotingNG/doc/images/XSDGen.png create mode 100644 RemotingNG/include/Poco/RemotingNG/AttributedObject.h create mode 100644 RemotingNG/include/Poco/RemotingNG/Authenticator.h create mode 100644 RemotingNG/include/Poco/RemotingNG/Authorizer.h create mode 100644 RemotingNG/include/Poco/RemotingNG/BinaryDeserializer.h create mode 100644 RemotingNG/include/Poco/RemotingNG/BinarySerializer.h create mode 100644 RemotingNG/include/Poco/RemotingNG/ClientHelper.h create mode 100644 RemotingNG/include/Poco/RemotingNG/Context.h create mode 100644 RemotingNG/include/Poco/RemotingNG/Credentials.h create mode 100644 RemotingNG/include/Poco/RemotingNG/Deserializer.h create mode 100644 RemotingNG/include/Poco/RemotingNG/EventDispatcher.h create mode 100644 RemotingNG/include/Poco/RemotingNG/EventFilter.h create mode 100644 RemotingNG/include/Poco/RemotingNG/EventListener.h create mode 100644 RemotingNG/include/Poco/RemotingNG/EventSubscriber.h create mode 100644 RemotingNG/include/Poco/RemotingNG/Identifiable.h create mode 100644 RemotingNG/include/Poco/RemotingNG/Listener.h create mode 100644 RemotingNG/include/Poco/RemotingNG/MethodHandler.h create mode 100644 RemotingNG/include/Poco/RemotingNG/ORB.h create mode 100644 RemotingNG/include/Poco/RemotingNG/Proxy.h create mode 100644 RemotingNG/include/Poco/RemotingNG/ProxyFactory.h create mode 100644 RemotingNG/include/Poco/RemotingNG/ProxyFactoryManager.h create mode 100644 RemotingNG/include/Poco/RemotingNG/RemoteObject.h create mode 100644 RemotingNG/include/Poco/RemotingNG/RemotingException.h create mode 100644 RemotingNG/include/Poco/RemotingNG/RemotingNG.h create mode 100644 RemotingNG/include/Poco/RemotingNG/Serializer.h create mode 100644 RemotingNG/include/Poco/RemotingNG/SerializerBase.h create mode 100644 RemotingNG/include/Poco/RemotingNG/ServerHelper.h create mode 100644 RemotingNG/include/Poco/RemotingNG/ServerTransport.h create mode 100644 RemotingNG/include/Poco/RemotingNG/Skeleton.h create mode 100644 RemotingNG/include/Poco/RemotingNG/Transport.h create mode 100644 RemotingNG/include/Poco/RemotingNG/TransportFactory.h create mode 100644 RemotingNG/include/Poco/RemotingNG/TransportFactoryManager.h create mode 100644 RemotingNG/include/Poco/RemotingNG/TypeDeserializer.h create mode 100644 RemotingNG/include/Poco/RemotingNG/TypeSerializer.h create mode 100644 RemotingNG/include/Poco/RemotingNG/URIUtility.h create mode 100644 RemotingNG/samples/CMakeLists.txt create mode 100644 RemotingNG/samples/CheckVat/CMakeLists.txt create mode 100644 RemotingNG/samples/CheckVat/Makefile create mode 100644 RemotingNG/samples/CheckVat/RemoteGen.xml create mode 100644 RemotingNG/samples/CheckVat/XSDGen.xml create mode 100644 RemotingNG/samples/CheckVat/include/CheckVat/CheckVatService.h create mode 100644 RemotingNG/samples/CheckVat/include/CheckVat/CheckVatServiceClientHelper.h create mode 100644 RemotingNG/samples/CheckVat/include/CheckVat/CheckVatServiceProxy.h create mode 100644 RemotingNG/samples/CheckVat/include/CheckVat/CheckVatServiceProxyFactory.h create mode 100644 RemotingNG/samples/CheckVat/include/CheckVat/ICheckVatService.h create mode 100644 RemotingNG/samples/CheckVat/include/CheckVat/Types/CheckVat.h create mode 100644 RemotingNG/samples/CheckVat/include/CheckVat/Types/CheckVatApprox.h create mode 100644 RemotingNG/samples/CheckVat/include/CheckVat/Types/CheckVatApproxResponse.h create mode 100644 RemotingNG/samples/CheckVat/include/CheckVat/Types/CheckVatResponse.h create mode 100644 RemotingNG/samples/CheckVat/src/CheckVat.cpp create mode 100644 RemotingNG/samples/CheckVat/src/CheckVatApprox.cpp create mode 100644 RemotingNG/samples/CheckVat/src/CheckVatApproxResponse.cpp create mode 100644 RemotingNG/samples/CheckVat/src/CheckVatClient.cpp create mode 100644 RemotingNG/samples/CheckVat/src/CheckVatResponse.cpp create mode 100644 RemotingNG/samples/CheckVat/src/CheckVatService.cpp create mode 100644 RemotingNG/samples/CheckVat/src/CheckVatServiceClientHelper.cpp create mode 100644 RemotingNG/samples/CheckVat/src/CheckVatServiceProxy.cpp create mode 100644 RemotingNG/samples/CheckVat/src/CheckVatServiceProxyFactory.cpp create mode 100644 RemotingNG/samples/CheckVat/src/ICheckVatService.cpp create mode 100755 RemotingNG/samples/CheckVat/wsdl/checkVatService.wsdl create mode 100644 RemotingNG/samples/ConvertTemperature/CMakeLists.txt create mode 100644 RemotingNG/samples/ConvertTemperature/Makefile create mode 100644 RemotingNG/samples/ConvertTemperature/RemoteGen.xml create mode 100644 RemotingNG/samples/ConvertTemperature/XSDGen.xml create mode 100644 RemotingNG/samples/ConvertTemperature/include/WebServiceX/ConvertTemp.h create mode 100644 RemotingNG/samples/ConvertTemperature/include/WebServiceX/ConvertTempResponse.h create mode 100644 RemotingNG/samples/ConvertTemperature/include/WebServiceX/ConvertTemperature.h create mode 100644 RemotingNG/samples/ConvertTemperature/include/WebServiceX/ConvertTemperatureClientHelper.h create mode 100644 RemotingNG/samples/ConvertTemperature/include/WebServiceX/ConvertTemperatureProxy.h create mode 100644 RemotingNG/samples/ConvertTemperature/include/WebServiceX/ConvertTemperatureProxyFactory.h create mode 100644 RemotingNG/samples/ConvertTemperature/include/WebServiceX/IConvertTemperature.h create mode 100644 RemotingNG/samples/ConvertTemperature/src/ConvertTemp.cpp create mode 100644 RemotingNG/samples/ConvertTemperature/src/ConvertTempResponse.cpp create mode 100644 RemotingNG/samples/ConvertTemperature/src/ConvertTemperature.cpp create mode 100644 RemotingNG/samples/ConvertTemperature/src/ConvertTemperatureClient.cpp create mode 100644 RemotingNG/samples/ConvertTemperature/src/ConvertTemperatureClientHelper.cpp create mode 100644 RemotingNG/samples/ConvertTemperature/src/ConvertTemperatureProxy.cpp create mode 100644 RemotingNG/samples/ConvertTemperature/src/ConvertTemperatureProxyFactory.cpp create mode 100644 RemotingNG/samples/ConvertTemperature/src/IConvertTemperature.cpp create mode 100755 RemotingNG/samples/ConvertTemperature/wsdl/ConvertTemperature.wsdl create mode 100644 RemotingNG/samples/Makefile create mode 100644 RemotingNG/samples/ONVIF/CMakeLists.txt create mode 100644 RemotingNG/samples/ONVIF/Makefile create mode 100644 RemotingNG/samples/ONVIF/XSDGen.xml create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/CreatePullPoint.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/CreatePullPointResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/DestroyPullPoint.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/DestroyPullPointResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/Filter.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/GetCurrentMessage.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/GetCurrentMessageResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/GetMessages.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/GetMessagesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/InvalidFilterFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/InvalidMessageContentExpressionFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/InvalidProducerPropertiesExpressionFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/InvalidTopicExpressionFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/Message.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/MultipleTopicsSpecifiedFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/NoCurrentMessageOnTopicFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/NotificationMessageHolder.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/NotificationProducerRP.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/Notify.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/NotifyMessageNotSupportedFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/PauseFailedFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/PauseSubscription.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/PauseSubscriptionResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/QueryExpression.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/Renew.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/RenewResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/ResumeFailedFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/ResumeSubscription.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/ResumeSubscriptionResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/Subscribe.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/SubscribeCreationFailedFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/SubscribeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/SubscriptionManagerRP.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/SubscriptionPolicy.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/TopicExpression.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/TopicExpressionDialectUnknownFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/TopicNotSupportedFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/UnableToCreatePullPointFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/UnableToDestroyPullPointFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/UnableToDestroySubscriptionFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/UnableToGetMessagesFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/UnacceptableInitialTerminationTimeFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/UnacceptableTerminationTimeFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/UnrecognizedPolicyRequestFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/Unsubscribe.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/UnsubscribeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/UnsupportedPolicyRequestFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/B2/UseRaw.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/T1/Documentation.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/T1/ExtensibleDocumented.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/T1/QueryExpression.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/T1/Topic.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/T1/TopicNamespace.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSN/T1/TopicSet.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSRF/BF2/BaseFault.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSRF/BF2/Description.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSRF/BF2/ErrorCode.h create mode 100644 RemotingNG/samples/ONVIF/include/OASIS/WSRF/BF2/FaultCause.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AACDecOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AbsoluteFocus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AbsoluteFocusOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ActionEngineEventPayload.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ActionEngineEventPayloadExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ActiveConnection.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsDeviceCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsDeviceEngineConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsDeviceEngineConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsDeviceExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsEngine.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsEngineConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsEngineConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsEngineControl.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsEngineInput.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsEngineInputInfo.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsEngineInputInfoExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsState.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnalyticsStateInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AnyHolder.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ArrayOfFileProgress.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ArrayOfFileProgressExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AttachmentData.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioAttributes.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioClassCandidate.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioClassDescriptor.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioClassDescriptorExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioDecoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioDecoderConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioDecoderConfigurationOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioEncoder2Configuration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioEncoder2ConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioEncoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioEncoderConfigurationOption.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioEncoderConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioOutput.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioOutputConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioOutputConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioSource.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioSourceConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/AudioSourceOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/BacklightCompensation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/BacklightCompensation20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/BacklightCompensationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/BacklightCompensationOptions20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/BackupFile.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/BinaryData.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Capabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/CapabilitiesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/CapabilitiesExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/CellLayout.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Certificate.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/CertificateGenerationParameters.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/CertificateGenerationParametersExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/CertificateInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/CertificateInformationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/CertificateStatus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/CertificateUsage.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/CertificateWithPrivateKey.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/CodingCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Color.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ColorCluster.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ColorCovariance.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ColorDescriptor.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ColorOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ColorspaceRange.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Config.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ConfigDescription.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ConfigDescriptionExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ConfigurationEntity.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ContinuousFocus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ContinuousFocusOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DNSInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DNSInformationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Date.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DateTime.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DateTimeRange.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Defogging.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DefoggingExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DefoggingOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/AddIPAddressFilter.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/AddIPAddressFilterResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/AddScopes.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/AddScopesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/Capabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/CreateCertificate.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/CreateCertificateResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/CreateDot1XConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/CreateDot1XConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/CreateStorageConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/CreateStorageConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/CreateUsers.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/CreateUsersResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeleteCertificates.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeleteCertificatesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeleteDot1XConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeleteDot1XConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeleteGeoLocation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeleteGeoLocationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeleteStorageConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeleteStorageConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeleteUsers.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeleteUsersResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeviceBinding.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/DeviceServiceCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/Extension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/Extension_1.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/Extension_2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetAccessPolicy.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetAccessPolicyResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetAuthFailureWarningConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetAuthFailureWarningConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetAuthFailureWarningOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetAuthFailureWarningOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetCACertificates.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetCACertificatesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetCapabilitiesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetCertificateInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetCertificateInformationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetCertificates.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetCertificatesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetCertificatesStatus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetCertificatesStatusResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetClientCertificateMode.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetClientCertificateModeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDNS.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDNSResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDPAddresses.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDPAddressesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDeviceInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDeviceInformationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDiscoveryMode.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDiscoveryModeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDot11Capabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDot11CapabilitiesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDot11Status.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDot11StatusResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDot1XConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDot1XConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDot1XConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDot1XConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDynamicDNS.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetDynamicDNSResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetEndpointReference.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetEndpointReferenceResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetGeoLocation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetGeoLocationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetHostname.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetHostnameResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetIPAddressFilter.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetIPAddressFilterResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetNTP.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetNTPResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetNetworkDefaultGateway.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetNetworkDefaultGatewayResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetNetworkInterfaces.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetNetworkInterfacesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetNetworkProtocols.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetNetworkProtocolsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetPasswordComplexityConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetPasswordComplexityConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetPasswordComplexityOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetPasswordComplexityOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetPasswordHistoryConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetPasswordHistoryConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetPkcs10Request.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetPkcs10RequestResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetRelayOutputs.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetRelayOutputsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetRemoteDiscoveryMode.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetRemoteDiscoveryModeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetRemoteUser.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetRemoteUserResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetScopes.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetScopesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetServiceCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetServiceCapabilitiesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetServices.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetServicesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetStorageConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetStorageConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetStorageConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetStorageConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetSystemBackup.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetSystemBackupResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetSystemDateAndTime.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetSystemDateAndTimeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetSystemLog.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetSystemLogResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetSystemSupportInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetSystemSupportInformationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetSystemUris.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetSystemUrisResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetUsers.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetUsersResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetWsdlUrl.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetWsdlUrlResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetZeroConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/GetZeroConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/LoadCACertificates.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/LoadCACertificatesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/LoadCertificateWithPrivateKey.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/LoadCertificateWithPrivateKeyResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/LoadCertificates.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/LoadCertificatesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/MiscCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/NetworkCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/RemoveIPAddressFilter.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/RemoveIPAddressFilterResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/RemoveScopes.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/RemoveScopesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/RestoreSystem.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/RestoreSystemResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/ScanAvailableDot11Networks.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/ScanAvailableDot11NetworksResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SecurityCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SendAuxiliaryCommand.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SendAuxiliaryCommandResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/Service.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetAccessPolicy.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetAccessPolicyResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetAuthFailureWarningConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetAuthFailureWarningConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetCertificatesStatus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetCertificatesStatusResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetClientCertificateMode.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetClientCertificateModeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetDNS.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetDNSResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetDPAddresses.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetDPAddressesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetDiscoveryMode.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetDiscoveryModeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetDot1XConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetDot1XConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetDynamicDNS.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetDynamicDNSResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetGeoLocation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetGeoLocationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetHashingAlgorithm.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetHashingAlgorithmResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetHostname.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetHostnameFromDHCP.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetHostnameFromDHCPResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetHostnameResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetIPAddressFilter.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetIPAddressFilterResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetNTP.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetNTPResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetNetworkDefaultGateway.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetNetworkDefaultGatewayResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetNetworkInterfaces.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetNetworkInterfacesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetNetworkProtocols.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetNetworkProtocolsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetPasswordComplexityConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetPasswordComplexityConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetPasswordHistoryConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetPasswordHistoryConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetRelayOutputSettings.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetRelayOutputSettingsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetRelayOutputState.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetRelayOutputStateResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetRemoteDiscoveryMode.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetRemoteDiscoveryModeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetRemoteUser.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetRemoteUserResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetScopes.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetScopesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetStorageConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetStorageConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetSystemDateAndTime.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetSystemDateAndTimeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetSystemFactoryDefault.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetSystemFactoryDefaultResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetUser.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetUserResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetZeroConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SetZeroConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/StartFirmwareUpgrade.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/StartFirmwareUpgradeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/StartSystemRestore.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/StartSystemRestoreResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/StorageConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/StorageConfigurationData.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SystemCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SystemReboot.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/SystemRebootResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/UpgradeSystemFirmware.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/UpgradeSystemFirmwareResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Device/UserCredential.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceCapabilitiesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceEntity.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/Capabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/DeviceIOBinding.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/DigitalInputConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/Get.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetAudioOutputConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetAudioOutputConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetAudioOutputConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetAudioOutputConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetAudioSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetAudioSourceConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetAudioSourceConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetAudioSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetDigitalInputConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetDigitalInputConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetDigitalInputs.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetDigitalInputsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetRelayOutputOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetRelayOutputOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetSerialPortConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetSerialPortConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetSerialPortConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetSerialPortConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetSerialPorts.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetSerialPortsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetServiceCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetServiceCapabilitiesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetVideoOutputConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetVideoOutputConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetVideoOutputConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetVideoOutputConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetVideoOutputs.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetVideoOutputsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetVideoSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetVideoSourceConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetVideoSourceConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/GetVideoSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/ParityBitList.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/RelayOutputOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/RelayOutputOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SendReceiveSerialCommand.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SendReceiveSerialCommandResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SerialData.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SerialPort.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SerialPortConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SerialPortConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetAudioOutputConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetAudioOutputConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetAudioSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetAudioSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetDigitalInputConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetDigitalInputConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetRelayOutputSettings.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetRelayOutputSettingsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetSerialPortConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetSerialPortConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetVideoOutputConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetVideoOutputConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetVideoSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIO/SetVideoSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DeviceIOCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DigitalInput.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DisplayCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot11AvailableNetworks.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot11AvailableNetworksExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot11Capabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot11Configuration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot11PSKSet.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot11PSKSetExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot11SecurityConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot11SecurityConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot11Status.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot1XConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot1XConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Dot3Configuration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DurationRange.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DynamicDNSInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/DynamicDNSInformationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/EAPMethodConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/EFlip.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/EFlipOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/EFlipOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/EapMethodExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ElementItem.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ElementItemDescription.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/EngineConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/EventCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/EventFilter.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/EventSubscription.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Exposure.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Exposure20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ExposureOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ExposureOptions20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FileProgress.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Filter.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FindEventResult.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FindEventResultList.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FindMetadataResult.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FindMetadataResultList.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FindPTZPositionResult.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FindPTZPositionResultList.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FindRecordingResultList.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FloatItems.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FloatRange.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FocusConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FocusConfiguration20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FocusConfiguration20Extension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FocusMove.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FocusOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FocusOptions20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FocusOptions20Extension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FocusStatus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FocusStatus20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/FocusStatus20Extension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/G711DecOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/G726DecOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/GenericEapPwdConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/GeoLocation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/GeoOrientation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/GetRecordingJobsResponseItem.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/GetRecordingsResponseItem.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/GetTracksResponseItem.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/GetTracksResponseList.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/H264Configuration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/H264DecOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/H264Options.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/H264Options2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/HostnameInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/HostnameInformationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IOCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IOCapabilitiesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IOCapabilitiesExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IPAddress.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IPAddressFilter.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IPAddressFilterExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IPv4Configuration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IPv4NetworkInterface.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IPv4NetworkInterfaceSetConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IPv6Configuration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IPv6ConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IPv6NetworkInterface.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IPv6NetworkInterfaceSetConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImageStabilization.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImageStabilizationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImageStabilizationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImageStabilizationOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingOptions20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingOptions20Extension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingOptions20Extension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingOptions20Extension3.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingOptions20Extension4.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingSettings.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingSettings20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingSettingsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingSettingsExtension20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingSettingsExtension202.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingSettingsExtension203.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingSettingsExtension204.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingStatus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingStatus20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ImagingStatus20Extension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IntItems.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IntRange.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IntRectangle.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IntRectangleRange.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IrCutFilterAutoAdjustment.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IrCutFilterAutoAdjustmentExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IrCutFilterAutoAdjustmentOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/IrCutFilterAutoAdjustmentOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ItemList.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ItemListDescription.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ItemListDescriptionExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ItemListExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/JpegDecOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/JpegOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/JpegOptions2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Layout.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/LayoutExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/LayoutOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/LayoutOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/LensDescription.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/LensOffset.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/LensProjection.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/LocalLocation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/LocalOrientation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/LocationEntity.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MaximumNumberOfOSDs.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddAudioDecoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddAudioDecoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddAudioEncoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddAudioEncoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddAudioOutputConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddAudioOutputConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddAudioSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddAudioSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddMetadataConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddMetadataConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddPTZConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddPTZConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddVideoAnalyticsConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddVideoAnalyticsConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddVideoEncoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddVideoEncoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddVideoSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/AddVideoSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/Capabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/CreateOSD.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/CreateOSDResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/CreateProfile.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/CreateProfileResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/DeleteOSD.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/DeleteOSDResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/DeleteProfile.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/DeleteProfileResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioDecoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioDecoderConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioDecoderConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioDecoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioDecoderConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioDecoderConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioEncoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioEncoderConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioEncoderConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioEncoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioEncoderConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioEncoderConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioOutputConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioOutputConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioOutputConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioOutputConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioOutputConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioOutputConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioOutputs.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioOutputsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioSourceConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioSourceConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioSourceConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioSourceConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioSources.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetAudioSourcesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleAudioDecoderConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleAudioDecoderConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleAudioEncoderConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleAudioEncoderConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleAudioOutputConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleAudioOutputConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleAudioSourceConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleAudioSourceConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleMetadataConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleMetadataConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleVideoAnalyticsConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleVideoAnalyticsConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleVideoEncoderConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleVideoEncoderConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleVideoSourceConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetCompatibleVideoSourceConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetGuaranteedNumberOfVideoEncoderInstances.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetGuaranteedNumberOfVideoEncoderInstancesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetMetadataConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetMetadataConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetMetadataConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetMetadataConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetMetadataConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetMetadataConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetOSD.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetOSDOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetOSDOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetOSDResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetOSDs.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetOSDsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetProfile.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetProfileResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetProfiles.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetProfilesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetServiceCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetServiceCapabilitiesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetSnapshotUri.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetSnapshotUriResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetStreamUri.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetStreamUriResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoAnalyticsConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoAnalyticsConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoAnalyticsConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoAnalyticsConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoEncoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoEncoderConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoEncoderConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoEncoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoEncoderConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoEncoderConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoSourceConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoSourceConfigurationOptionsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoSourceConfigurations.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoSourceConfigurationsResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoSourceModes.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoSourceModesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoSources.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/GetVideoSourcesResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/MediaBinding.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/ProfileCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveAudioDecoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveAudioDecoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveAudioEncoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveAudioEncoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveAudioOutputConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveAudioOutputConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveAudioSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveAudioSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveMetadataConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveMetadataConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemovePTZConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemovePTZConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveVideoAnalyticsConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveVideoAnalyticsConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveVideoEncoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveVideoEncoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveVideoSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/RemoveVideoSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetAudioDecoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetAudioDecoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetAudioEncoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetAudioEncoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetAudioOutputConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetAudioOutputConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetAudioSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetAudioSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetMetadataConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetMetadataConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetOSD.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetOSDResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetSynchronizationPoint.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetSynchronizationPointResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetVideoAnalyticsConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetVideoAnalyticsConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetVideoEncoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetVideoEncoderConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetVideoSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetVideoSourceConfigurationResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetVideoSourceMode.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/SetVideoSourceModeResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/StartMulticastStreaming.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/StartMulticastStreamingResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/StopMulticastStreaming.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/StopMulticastStreamingResponse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/StreamingCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/VideoSourceMode.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Media/VideoSourceModeExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MediaAttributes.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MediaCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MediaCapabilitiesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MediaUri.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Message.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MessageDescription.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MessageDescriptionExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MessageExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Messages.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MetadataAttributes.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MetadataConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MetadataConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MetadataConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MetadataConfigurationOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MetadataConfigurationOptionsExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MetadataFilter.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MetadataInput.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MetadataInputExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MotionExpression.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MotionExpressionConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MoveOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MoveOptions20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Mpeg4Configuration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Mpeg4DecOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Mpeg4Options.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Mpeg4Options2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/MulticastConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NTPInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NTPInformationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkCapabilitiesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkCapabilitiesExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkGateway.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkHost.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkHostExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkInterface.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkInterfaceConnectionSetting.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkInterfaceExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkInterfaceExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkInterfaceInfo.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkInterfaceLink.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkInterfaceSetConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkInterfaceSetConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkInterfaceSetConfigurationExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkProtocol.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkProtocolExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkZeroConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkZeroConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NetworkZeroConfigurationExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NoiseReduction.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/NoiseReductionOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ONVIF.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDColor.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDColorOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDColorOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDConfigurationOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDImgConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDImgConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDImgOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDImgOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDPosConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDPosConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDReference.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDTextConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDTextConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDTextOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OSDTextOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/OnvifVersion.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTControlDirection.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTControlDirectionExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTControlDirectionOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTControlDirectionOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZConfigurationExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZConfigurationOptions2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZFilter.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZMoveStatus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZNode.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZNodeExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZNodeExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPositionFilter.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPreset.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourPresetDetail.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourPresetDetailOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourPresetDetailOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourSpot.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourSpotExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourSpotOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourStartingCondition.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourStartingConditionExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourStartingConditionOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourStartingConditionOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourStatus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourStatusExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourSupported.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourSupportedExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZPresetTourTypeExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZSpaces.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZSpacesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZSpeed.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZStatus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZStatusFilterOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZStatusFilterOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PTZVector.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PanTiltLimits.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PaneConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PaneLayout.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PaneLayoutOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PaneOptionExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Polygon.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PolygonOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Polyline.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PolylineArray.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PolylineArrayConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PolylineArrayExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PrefixedIPv4Address.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PrefixedIPv6Address.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/PresetTour.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Profile.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ProfileCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ProfileExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ProfileExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ProfileStatus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ProfileStatusExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RealTimeStreamingCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RealTimeStreamingCapabilitiesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Receiver.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ReceiverCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ReceiverConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ReceiverStateInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingEncryption.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingEventFilter.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingJobConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingJobConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingJobSource.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingJobSourceExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingJobStateInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingJobStateInformationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingJobStateSource.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingJobStateTrack.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingJobStateTracks.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingJobTrack.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingSourceInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingSummary.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RecordingTargetConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Rectangle.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RelativeFocus.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RelativeFocusOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RelativeFocusOptions20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RelayOutput.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RelayOutputSettings.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RemoteUser.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ReplayCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ReplayConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Reverse.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ReverseOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ReverseOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Rotate.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RotateExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RotateOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RotateOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RuleEngineConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/RuleEngineConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SceneOrientation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Scope.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SearchCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SearchScope.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SearchScopeExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SecurityCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SecurityCapabilitiesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SecurityCapabilitiesExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SimpleItem.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SimpleItemDescription.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SourceIdentification.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SourceIdentificationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SourceReference.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Space1DDescription.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Space2DDescription.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SphericalCoordinate.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/StorageReferencePath.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/StorageReferencePathExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/StreamSetup.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/StringItems.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SubscriptionPolicy.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SupportInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SupportedAnalyticsModules.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SupportedAnalyticsModulesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SupportedRules.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SupportedRulesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SystemCapabilities.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SystemCapabilitiesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SystemCapabilitiesExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SystemDateTime.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SystemDateTimeExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SystemLog.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SystemLogUri.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/SystemLogUriList.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/TLSConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Time.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/TimeZone.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ToneCompensation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ToneCompensationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ToneCompensationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/TrackAttributes.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/TrackAttributesExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/TrackConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/TrackInformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Transformation.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/TransformationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Transport.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/User.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/UserExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Vector.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Vector1D.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/Vector2D.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoAnalyticsConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoAttributes.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoDecoderConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoDecoderConfigurationOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoEncoder2Configuration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoEncoder2ConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoEncoderConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoEncoderConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoEncoderOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoEncoderOptionsExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoOutput.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoOutputConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoOutputConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoOutputExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoRateControl.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoRateControl2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoResolution.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoResolution2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoSource.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoSourceConfiguration.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoSourceConfigurationExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoSourceConfigurationExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoSourceConfigurationOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoSourceConfigurationOptionsExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoSourceConfigurationOptionsExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoSourceExtension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/VideoSourceExtension2.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/WhiteBalance.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/WhiteBalance20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/WhiteBalance20Extension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/WhiteBalanceOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/WhiteBalanceOptions20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/WhiteBalanceOptions20Extension.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/WideDynamicRange.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/WideDynamicRange20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/WideDynamicRangeOptions.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/WideDynamicRangeOptions20.h create mode 100644 RemotingNG/samples/ONVIF/include/ONVIF/ZoomLimits.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/Addressing/AttributedAny.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/Addressing/AttributedQName.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/Addressing/AttributedURI.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/Addressing/AttributedUnsignedLong.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/Addressing/EndpointReference.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/Addressing/Metadata.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/Addressing/ProblemAction.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/Addressing/ReferenceParameters.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/Addressing/RelatesTo.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/Body.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/Detail.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/Envelope.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/Fault.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/Faultcode.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/Faultreason.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/Header.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/NotUnderstood.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/Reasontext.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/Subcode.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/SupportedEnv.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/SOAP/Envelope/Upgrade.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/XMLMIME/Base64Binary.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/XMLMIME/HexBinary.h create mode 100644 RemotingNG/samples/ONVIF/include/W3/XOP/Include.h create mode 100644 RemotingNG/samples/ONVIF/src/Amalgamated.cpp create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/accesscontrol/wsdl/index.html create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/accessrules/wsdl/accessrules.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/accessrules/wsdl/index.html create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/actionengine.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/advancedsecurity/wsdl/index.html create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/advancedsecurity/wsdl/security.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/analyticsdevice.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/appmgmt/wsdl/appmgmt.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/appmgmt/wsdl/index.html create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/authenticationbehavior/wsdl/authenticationbehavior.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/authenticationbehavior/wsdl/index.html create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/credential/wsdl/credential.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/credential/wsdl/index.html create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/device/wsdl/devicemgmt.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/deviceio.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/display.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/display/display.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/display/wsdl/index.htm create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/doorcontrol/wsdl/index.html create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/events/wsdl/bw-2-vs-mod.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/events/wsdl/event-vs.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/events/wsdl/event.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/events/wsdl/index.html create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/federatedsearch.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/media/wsdl/media.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/pacs/accesscontrol.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/pacs/doorcontrol.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/pacs/types.xsd create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/provisioning/wsdl/provisioning.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/receiver.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/recording.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/replay.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/schedule/wsdl/index.html create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/schedule/wsdl/schedule.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/schema/common.xsd create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/schema/metadatastream.xsd create mode 100755 RemotingNG/samples/ONVIF/wsdl/ver10/schema/onvif.xsd create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/search.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/thermal/wsdl/index.html create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/thermal/wsdl/thermal.wsdl create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/topics/topicns.xml create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/uplink/wsdl/index.html create mode 100644 RemotingNG/samples/ONVIF/wsdl/ver10/uplink/wsdl/uplink.wsdl create mode 100644 RemotingNG/samples/ONVIFClient/CMakeLists.txt create mode 100644 RemotingNG/samples/ONVIFClient/Makefile create mode 100644 RemotingNG/samples/ONVIFClient/RemoteGen.xml create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/CreatePullPointDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/CreatePullPointResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/CreatePullPointResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/CreatePullPointSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/DestroyPullPointDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/DestroyPullPointResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/DestroyPullPointResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/DestroyPullPointSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/FilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/FilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/GetCurrentMessageDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/GetCurrentMessageResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/GetCurrentMessageResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/GetCurrentMessageSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/GetMessagesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/GetMessagesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/GetMessagesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/GetMessagesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/InvalidFilterFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/InvalidFilterFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/InvalidMessageContentExpressionFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/InvalidMessageContentExpressionFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/InvalidProducerPropertiesExpressionFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/InvalidProducerPropertiesExpressionFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/InvalidTopicExpressionFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/InvalidTopicExpressionFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/MessageDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/MessageSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/MultipleTopicsSpecifiedFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/MultipleTopicsSpecifiedFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/NoCurrentMessageOnTopicFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/NoCurrentMessageOnTopicFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/NotificationMessageHolderDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/NotificationMessageHolderSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/NotificationProducerRPDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/NotificationProducerRPSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/NotifyDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/NotifyMessageNotSupportedFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/NotifyMessageNotSupportedFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/NotifySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/PauseFailedFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/PauseFailedFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/PauseSubscriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/PauseSubscriptionResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/PauseSubscriptionResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/PauseSubscriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/QueryExpressionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/QueryExpressionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/RenewDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/RenewResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/RenewResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/RenewSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/ResumeFailedFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/ResumeFailedFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/ResumeSubscriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/ResumeSubscriptionResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/ResumeSubscriptionResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/ResumeSubscriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/SubscribeCreationFailedFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/SubscribeCreationFailedFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/SubscribeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/SubscribeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/SubscribeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/SubscribeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/SubscriptionManagerRPDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/SubscriptionManagerRPSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/SubscriptionPolicyDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/SubscriptionPolicySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/TopicExpressionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/TopicExpressionDialectUnknownFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/TopicExpressionDialectUnknownFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/TopicExpressionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/TopicNotSupportedFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/TopicNotSupportedFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnableToCreatePullPointFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnableToCreatePullPointFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnableToDestroyPullPointFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnableToDestroyPullPointFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnableToDestroySubscriptionFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnableToDestroySubscriptionFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnableToGetMessagesFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnableToGetMessagesFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnacceptableInitialTerminationTimeFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnacceptableInitialTerminationTimeFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnacceptableTerminationTimeFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnacceptableTerminationTimeFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnrecognizedPolicyRequestFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnrecognizedPolicyRequestFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnsubscribeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnsubscribeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnsubscribeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnsubscribeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnsupportedPolicyRequestFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UnsupportedPolicyRequestFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UseRawDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/B2/UseRawSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/DocumentationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/DocumentationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/ExtensibleDocumentedDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/ExtensibleDocumentedSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/QueryExpressionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/QueryExpressionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/TopicDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/TopicNamespaceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/TopicNamespaceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/TopicSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/TopicSetDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSN/T1/TopicSetSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSRF/BF2/BaseFaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSRF/BF2/BaseFaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSRF/BF2/DescriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSRF/BF2/DescriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSRF/BF2/ErrorCodeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSRF/BF2/ErrorCodeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSRF/BF2/FaultCauseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/OASIS/WSRF/BF2/FaultCauseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AACDecOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AACDecOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AbsoluteFocusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AbsoluteFocusOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AbsoluteFocusOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AbsoluteFocusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ActionEngineEventPayloadDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ActionEngineEventPayloadExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ActionEngineEventPayloadExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ActionEngineEventPayloadSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ActiveConnectionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ActiveConnectionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsDeviceCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsDeviceCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsDeviceEngineConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsDeviceEngineConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsDeviceEngineConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsDeviceEngineConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsDeviceExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsDeviceExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineControlDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineControlSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineInputDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineInputInfoDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineInputInfoExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineInputInfoExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineInputInfoSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineInputSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsEngineSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsStateDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsStateInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsStateInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnalyticsStateSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnyHolderDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AnyHolderSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ArrayOfFileProgressDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ArrayOfFileProgressExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ArrayOfFileProgressExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ArrayOfFileProgressSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AttachmentDataDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AttachmentDataSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioAttributesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioAttributesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioClassCandidateDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioClassCandidateSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioClassDescriptorDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioClassDescriptorExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioClassDescriptorExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioClassDescriptorSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioDecoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioDecoderConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioDecoderConfigurationOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioDecoderConfigurationOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioDecoderConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioDecoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioEncoder2ConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioEncoder2ConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioEncoder2ConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioEncoder2ConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioEncoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioEncoderConfigurationOptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioEncoderConfigurationOptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioEncoderConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioEncoderConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioEncoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioOutputConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioOutputConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioOutputConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioOutputConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioOutputDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioOutputSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioSourceConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioSourceConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioSourceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioSourceOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioSourceOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/AudioSourceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BacklightCompensation20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BacklightCompensation20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BacklightCompensationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BacklightCompensationOptions20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BacklightCompensationOptions20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BacklightCompensationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BacklightCompensationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BacklightCompensationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BackupFileDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BackupFileSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BinaryDataDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/BinaryDataSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CapabilitiesExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CapabilitiesExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CapabilitiesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CapabilitiesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CellLayoutDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CellLayoutSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateGenerationParametersDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateGenerationParametersExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateGenerationParametersExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateGenerationParametersSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateInformationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateInformationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateStatusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateStatusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateUsageDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateUsageSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateWithPrivateKeyDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CertificateWithPrivateKeySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CodingCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/CodingCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorClusterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorClusterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorCovarianceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorCovarianceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorDescriptorDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorDescriptorSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorspaceRangeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ColorspaceRangeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ConfigDescriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ConfigDescriptionExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ConfigDescriptionExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ConfigDescriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ConfigDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ConfigSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ConfigurationEntityDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ConfigurationEntitySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ContinuousFocusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ContinuousFocusOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ContinuousFocusOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ContinuousFocusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DNSInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DNSInformationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DNSInformationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DNSInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DateDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DateSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DateTimeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DateTimeRangeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DateTimeRangeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DateTimeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DefoggingDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DefoggingExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DefoggingExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DefoggingOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DefoggingOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DefoggingSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/AddIPAddressFilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/AddIPAddressFilterResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/AddIPAddressFilterResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/AddIPAddressFilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/AddScopesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/AddScopesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/AddScopesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/AddScopesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateCertificateDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateCertificateResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateCertificateResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateCertificateSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateDot1XConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateDot1XConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateDot1XConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateDot1XConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateStorageConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateStorageConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateStorageConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateStorageConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateUsersDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateUsersResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateUsersResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/CreateUsersSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteCertificatesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteCertificatesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteCertificatesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteCertificatesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteDot1XConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteDot1XConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteDot1XConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteDot1XConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteGeoLocationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteGeoLocationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteGeoLocationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteGeoLocationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteStorageConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteStorageConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteStorageConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteStorageConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteUsersDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteUsersResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteUsersResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeleteUsersSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeviceBindingClientHelper.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeviceBindingProxy.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeviceBindingProxyFactory.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeviceServiceCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/DeviceServiceCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/ExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/ExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/Extension_1Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/Extension_1Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/Extension_2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/Extension_2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAccessPolicyDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAccessPolicyResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAccessPolicyResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAccessPolicySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAuthFailureWarningConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAuthFailureWarningConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAuthFailureWarningConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAuthFailureWarningConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAuthFailureWarningOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAuthFailureWarningOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAuthFailureWarningOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetAuthFailureWarningOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCACertificatesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCACertificatesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCACertificatesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCACertificatesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCapabilitiesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCapabilitiesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificateInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificateInformationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificateInformationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificateInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificatesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificatesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificatesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificatesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificatesStatusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificatesStatusResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificatesStatusResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetCertificatesStatusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetClientCertificateModeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetClientCertificateModeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetClientCertificateModeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetClientCertificateModeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDNSDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDNSResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDNSResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDNSSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDPAddressesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDPAddressesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDPAddressesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDPAddressesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDeviceInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDeviceInformationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDeviceInformationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDeviceInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDiscoveryModeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDiscoveryModeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDiscoveryModeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDiscoveryModeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot11CapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot11CapabilitiesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot11CapabilitiesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot11CapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot11StatusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot11StatusResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot11StatusResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot11StatusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot1XConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot1XConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot1XConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot1XConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot1XConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot1XConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot1XConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDot1XConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDynamicDNSDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDynamicDNSResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDynamicDNSResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetDynamicDNSSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetEndpointReferenceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetEndpointReferenceResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetEndpointReferenceResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetEndpointReferenceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetGeoLocationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetGeoLocationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetGeoLocationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetGeoLocationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetHostnameDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetHostnameResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetHostnameResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetHostnameSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetIPAddressFilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetIPAddressFilterResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetIPAddressFilterResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetIPAddressFilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNTPDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNTPResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNTPResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNTPSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkDefaultGatewayDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkDefaultGatewayResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkDefaultGatewayResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkDefaultGatewaySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkInterfacesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkInterfacesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkInterfacesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkInterfacesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkProtocolsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkProtocolsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkProtocolsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetNetworkProtocolsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordComplexityConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordComplexityConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordComplexityConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordComplexityConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordComplexityOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordComplexityOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordComplexityOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordComplexityOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordHistoryConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordHistoryConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordHistoryConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPasswordHistoryConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPkcs10RequestDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPkcs10RequestResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPkcs10RequestResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetPkcs10RequestSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRelayOutputsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRelayOutputsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRelayOutputsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRelayOutputsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRemoteDiscoveryModeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRemoteDiscoveryModeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRemoteDiscoveryModeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRemoteDiscoveryModeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRemoteUserDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRemoteUserResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRemoteUserResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetRemoteUserSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetScopesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetScopesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetScopesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetScopesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetServiceCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetServiceCapabilitiesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetServiceCapabilitiesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetServiceCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetServicesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetServicesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetServicesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetServicesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetStorageConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetStorageConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetStorageConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetStorageConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetStorageConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetStorageConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetStorageConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetStorageConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemBackupDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemBackupResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemBackupResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemBackupSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemDateAndTimeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemDateAndTimeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemDateAndTimeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemDateAndTimeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemLogDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemLogResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemLogResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemLogSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemSupportInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemSupportInformationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemSupportInformationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemSupportInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemUrisDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemUrisResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemUrisResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetSystemUrisSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetUsersDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetUsersResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetUsersResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetUsersSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetWsdlUrlDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetWsdlUrlResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetWsdlUrlResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetWsdlUrlSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetZeroConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetZeroConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetZeroConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/GetZeroConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/IDeviceBinding.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCACertificatesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCACertificatesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCACertificatesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCACertificatesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCertificateWithPrivateKeyDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCertificateWithPrivateKeyResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCertificateWithPrivateKeyResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCertificateWithPrivateKeySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCertificatesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCertificatesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCertificatesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/LoadCertificatesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/MiscCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/MiscCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/NetworkCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/NetworkCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RemoveIPAddressFilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RemoveIPAddressFilterResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RemoveIPAddressFilterResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RemoveIPAddressFilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RemoveScopesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RemoveScopesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RemoveScopesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RemoveScopesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RestoreSystemDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RestoreSystemResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RestoreSystemResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/RestoreSystemSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/ScanAvailableDot11NetworksDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/ScanAvailableDot11NetworksResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/ScanAvailableDot11NetworksResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/ScanAvailableDot11NetworksSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SecurityCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SecurityCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SendAuxiliaryCommandDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SendAuxiliaryCommandResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SendAuxiliaryCommandResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SendAuxiliaryCommandSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/ServiceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/ServiceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetAccessPolicyDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetAccessPolicyResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetAccessPolicyResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetAccessPolicySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetAuthFailureWarningConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetAuthFailureWarningConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetAuthFailureWarningConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetAuthFailureWarningConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetCertificatesStatusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetCertificatesStatusResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetCertificatesStatusResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetCertificatesStatusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetClientCertificateModeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetClientCertificateModeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetClientCertificateModeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetClientCertificateModeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDNSDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDNSResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDNSResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDNSSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDPAddressesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDPAddressesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDPAddressesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDPAddressesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDiscoveryModeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDiscoveryModeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDiscoveryModeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDiscoveryModeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDot1XConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDot1XConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDot1XConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDot1XConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDynamicDNSDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDynamicDNSResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDynamicDNSResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetDynamicDNSSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetGeoLocationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetGeoLocationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetGeoLocationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetGeoLocationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHashingAlgorithmDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHashingAlgorithmResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHashingAlgorithmResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHashingAlgorithmSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHostnameDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHostnameFromDHCPDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHostnameFromDHCPResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHostnameFromDHCPResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHostnameFromDHCPSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHostnameResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHostnameResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetHostnameSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetIPAddressFilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetIPAddressFilterResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetIPAddressFilterResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetIPAddressFilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNTPDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNTPResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNTPResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNTPSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkDefaultGatewayDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkDefaultGatewayResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkDefaultGatewayResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkDefaultGatewaySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkInterfacesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkInterfacesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkInterfacesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkInterfacesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkProtocolsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkProtocolsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkProtocolsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetNetworkProtocolsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetPasswordComplexityConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetPasswordComplexityConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetPasswordComplexityConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetPasswordComplexityConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetPasswordHistoryConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetPasswordHistoryConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetPasswordHistoryConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetPasswordHistoryConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRelayOutputSettingsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRelayOutputSettingsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRelayOutputSettingsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRelayOutputSettingsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRelayOutputStateDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRelayOutputStateResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRelayOutputStateResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRelayOutputStateSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRemoteDiscoveryModeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRemoteDiscoveryModeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRemoteDiscoveryModeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRemoteDiscoveryModeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRemoteUserDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRemoteUserResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRemoteUserResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetRemoteUserSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetScopesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetScopesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetScopesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetScopesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetStorageConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetStorageConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetStorageConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetStorageConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetSystemDateAndTimeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetSystemDateAndTimeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetSystemDateAndTimeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetSystemDateAndTimeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetSystemFactoryDefaultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetSystemFactoryDefaultResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetSystemFactoryDefaultResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetSystemFactoryDefaultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetUserDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetUserResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetUserResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetUserSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetZeroConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetZeroConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetZeroConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SetZeroConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StartFirmwareUpgradeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StartFirmwareUpgradeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StartFirmwareUpgradeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StartFirmwareUpgradeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StartSystemRestoreDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StartSystemRestoreResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StartSystemRestoreResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StartSystemRestoreSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StorageConfigurationDataDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StorageConfigurationDataSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StorageConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/StorageConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SystemCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SystemCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SystemRebootDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SystemRebootResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SystemRebootResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/SystemRebootSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/UpgradeSystemFirmwareDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/UpgradeSystemFirmwareResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/UpgradeSystemFirmwareResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/UpgradeSystemFirmwareSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/UserCredentialDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Device/UserCredentialSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceCapabilitiesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceCapabilitiesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceEntityDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceEntitySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/CapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/CapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/DeviceIOBindingClientHelper.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/DeviceIOBindingProxy.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/DeviceIOBindingProxyFactory.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/DigitalInputConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/DigitalInputConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioOutputConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioOutputConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioOutputConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioOutputConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioOutputConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioOutputConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioOutputConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioOutputConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioSourceConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioSourceConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioSourceConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioSourceConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetAudioSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetDigitalInputConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetDigitalInputConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetDigitalInputConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetDigitalInputConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetDigitalInputsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetDigitalInputsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetDigitalInputsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetDigitalInputsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetRelayOutputOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetRelayOutputOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetRelayOutputOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetRelayOutputOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerialPortsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetServiceCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetServiceCapabilitiesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetServiceCapabilitiesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetServiceCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoOutputsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoSourceConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoSourceConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoSourceConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoSourceConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/GetVideoSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/IDeviceIOBinding.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/ParityBitListDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/ParityBitListSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/RelayOutputOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/RelayOutputOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/RelayOutputOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/RelayOutputOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SendReceiveSerialCommandDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SendReceiveSerialCommandResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SendReceiveSerialCommandResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SendReceiveSerialCommandSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SerialDataDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SerialDataSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SerialPortConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SerialPortConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SerialPortConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SerialPortConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SerialPortDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SerialPortSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetAudioOutputConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetAudioOutputConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetAudioOutputConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetAudioOutputConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetAudioSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetAudioSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetAudioSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetAudioSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetDigitalInputConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetDigitalInputConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetDigitalInputConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetDigitalInputConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetRelayOutputSettingsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetRelayOutputSettingsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetRelayOutputSettingsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetRelayOutputSettingsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetSerialPortConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetSerialPortConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetSerialPortConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetSerialPortConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetVideoOutputConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetVideoOutputConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetVideoOutputConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetVideoOutputConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetVideoSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetVideoSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetVideoSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIO/SetVideoSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIOCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DeviceIOCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DigitalInputDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DigitalInputSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DisplayCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DisplayCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11AvailableNetworksDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11AvailableNetworksExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11AvailableNetworksExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11AvailableNetworksSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11CapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11CapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11ConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11ConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11PSKSetDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11PSKSetExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11PSKSetExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11PSKSetSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11SecurityConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11SecurityConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11SecurityConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11SecurityConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11StatusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot11StatusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot1XConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot1XConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot1XConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot1XConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot3ConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Dot3ConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DurationRangeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DurationRangeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DynamicDNSInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DynamicDNSInformationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DynamicDNSInformationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/DynamicDNSInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EAPMethodConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EAPMethodConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EFlipDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EFlipOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EFlipOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EFlipOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EFlipOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EFlipSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EapMethodExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EapMethodExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ElementItemDescriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ElementItemDescriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ElementItemDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ElementItemSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EngineConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EngineConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EventCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EventCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EventFilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EventFilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EventSubscriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/EventSubscriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Exposure20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Exposure20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ExposureDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ExposureOptions20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ExposureOptions20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ExposureOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ExposureOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ExposureSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FileProgressDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FileProgressSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindEventResultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindEventResultListDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindEventResultListSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindEventResultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindMetadataResultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindMetadataResultListDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindMetadataResultListSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindMetadataResultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindPTZPositionResultDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindPTZPositionResultListDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindPTZPositionResultListSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindPTZPositionResultSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindRecordingResultListDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FindRecordingResultListSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FloatItemsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FloatItemsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FloatRangeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FloatRangeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusConfiguration20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusConfiguration20ExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusConfiguration20ExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusConfiguration20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusMoveDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusMoveSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusOptions20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusOptions20ExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusOptions20ExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusOptions20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusStatus20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusStatus20ExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusStatus20ExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusStatus20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusStatusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/FocusStatusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/G711DecOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/G711DecOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/G726DecOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/G726DecOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GenericEapPwdConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GenericEapPwdConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GeoLocationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GeoLocationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GeoOrientationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GeoOrientationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GetRecordingJobsResponseItemDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GetRecordingJobsResponseItemSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GetRecordingsResponseItemDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GetRecordingsResponseItemSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GetTracksResponseItemDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GetTracksResponseItemSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GetTracksResponseListDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/GetTracksResponseListSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/H264ConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/H264ConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/H264DecOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/H264DecOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/H264Options2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/H264Options2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/H264OptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/H264OptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/HostnameInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/HostnameInformationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/HostnameInformationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/HostnameInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IOCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IOCapabilitiesExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IOCapabilitiesExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IOCapabilitiesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IOCapabilitiesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IOCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPAddressDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPAddressFilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPAddressFilterExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPAddressFilterExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPAddressFilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPAddressSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv4ConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv4ConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv4NetworkInterfaceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv4NetworkInterfaceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv4NetworkInterfaceSetConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv4NetworkInterfaceSetConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv6ConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv6ConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv6ConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv6ConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv6NetworkInterfaceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv6NetworkInterfaceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv6NetworkInterfaceSetConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IPv6NetworkInterfaceSetConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImageStabilizationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImageStabilizationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImageStabilizationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImageStabilizationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImageStabilizationOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImageStabilizationOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImageStabilizationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImageStabilizationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptions20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptions20Extension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptions20Extension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptions20Extension3Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptions20Extension3Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptions20Extension4Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptions20Extension4Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptions20ExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptions20ExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptions20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettings20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettings20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsExtension202Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsExtension202Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsExtension203Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsExtension203Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsExtension204Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsExtension204Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsExtension20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsExtension20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingSettingsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingStatus20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingStatus20ExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingStatus20ExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingStatus20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingStatusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ImagingStatusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IntItemsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IntItemsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IntRangeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IntRangeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IntRectangleDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IntRectangleRangeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IntRectangleRangeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IntRectangleSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IrCutFilterAutoAdjustmentDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IrCutFilterAutoAdjustmentExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IrCutFilterAutoAdjustmentExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IrCutFilterAutoAdjustmentOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IrCutFilterAutoAdjustmentOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IrCutFilterAutoAdjustmentOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IrCutFilterAutoAdjustmentOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/IrCutFilterAutoAdjustmentSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ItemListDescriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ItemListDescriptionExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ItemListDescriptionExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ItemListDescriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ItemListDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ItemListExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ItemListExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ItemListSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/JpegDecOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/JpegDecOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/JpegOptions2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/JpegOptions2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/JpegOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/JpegOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LayoutDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LayoutExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LayoutExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LayoutOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LayoutOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LayoutOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LayoutOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LayoutSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LensDescriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LensDescriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LensOffsetDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LensOffsetSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LensProjectionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LensProjectionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LocalLocationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LocalLocationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LocalOrientationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LocalOrientationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LocationEntityDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/LocationEntitySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MaximumNumberOfOSDsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MaximumNumberOfOSDsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioDecoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioDecoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioDecoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioDecoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioEncoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioEncoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioEncoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioEncoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioOutputConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioOutputConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioOutputConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioOutputConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddAudioSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddMetadataConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddMetadataConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddMetadataConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddMetadataConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddPTZConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddPTZConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddPTZConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddPTZConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoAnalyticsConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoAnalyticsConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoAnalyticsConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoAnalyticsConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoEncoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoEncoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoEncoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoEncoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/AddVideoSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/CapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/CapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/CreateOSDDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/CreateOSDResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/CreateOSDResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/CreateOSDSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/CreateProfileDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/CreateProfileResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/CreateProfileResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/CreateProfileSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/DeleteOSDDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/DeleteOSDResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/DeleteOSDResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/DeleteOSDSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/DeleteProfileDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/DeleteProfileResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/DeleteProfileResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/DeleteProfileSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioDecoderConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioEncoderConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioOutputsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourceConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourcesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourcesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourcesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetAudioSourcesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioDecoderConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioDecoderConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioDecoderConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioDecoderConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioEncoderConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioEncoderConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioEncoderConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioEncoderConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioOutputConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioOutputConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioOutputConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioOutputConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioSourceConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioSourceConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioSourceConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleAudioSourceConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleMetadataConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleMetadataConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleMetadataConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleMetadataConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoAnalyticsConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoAnalyticsConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoAnalyticsConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoAnalyticsConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoEncoderConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoEncoderConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoEncoderConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoEncoderConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoSourceConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoSourceConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoSourceConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetCompatibleVideoSourceConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetGuaranteedNumberOfVideoEncoderInstancesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetGuaranteedNumberOfVideoEncoderInstancesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetGuaranteedNumberOfVideoEncoderInstancesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetGuaranteedNumberOfVideoEncoderInstancesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetMetadataConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetOSDsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetProfileDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetProfileResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetProfileResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetProfileSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetProfilesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetProfilesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetProfilesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetProfilesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetServiceCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetServiceCapabilitiesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetServiceCapabilitiesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetServiceCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetSnapshotUriDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetSnapshotUriResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetSnapshotUriResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetSnapshotUriSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetStreamUriDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetStreamUriResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetStreamUriResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetStreamUriSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoAnalyticsConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoAnalyticsConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoAnalyticsConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoAnalyticsConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoAnalyticsConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoAnalyticsConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoAnalyticsConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoAnalyticsConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoEncoderConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationOptionsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationOptionsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationsResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationsResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceConfigurationsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceModesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceModesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceModesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourceModesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourcesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourcesResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourcesResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/GetVideoSourcesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/IMediaBinding.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/MediaBindingClientHelper.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/MediaBindingProxy.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/MediaBindingProxyFactory.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/ProfileCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/ProfileCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioDecoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioDecoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioDecoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioDecoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioEncoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioEncoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioEncoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioEncoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioOutputConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioOutputConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioOutputConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioOutputConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveAudioSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveMetadataConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveMetadataConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveMetadataConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveMetadataConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemovePTZConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemovePTZConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemovePTZConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemovePTZConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoAnalyticsConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoAnalyticsConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoAnalyticsConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoAnalyticsConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoEncoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoEncoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoEncoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoEncoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/RemoveVideoSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioDecoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioDecoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioDecoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioDecoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioEncoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioEncoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioEncoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioEncoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioOutputConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioOutputConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioOutputConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioOutputConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetAudioSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetMetadataConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetMetadataConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetMetadataConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetMetadataConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetOSDDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetOSDResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetOSDResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetOSDSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetSynchronizationPointDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetSynchronizationPointResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetSynchronizationPointResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetSynchronizationPointSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoAnalyticsConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoAnalyticsConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoAnalyticsConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoAnalyticsConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoEncoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoEncoderConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoEncoderConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoEncoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoSourceConfigurationResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoSourceConfigurationResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoSourceModeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoSourceModeResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoSourceModeResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/SetVideoSourceModeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/StartMulticastStreamingDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/StartMulticastStreamingResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/StartMulticastStreamingResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/StartMulticastStreamingSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/StopMulticastStreamingDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/StopMulticastStreamingResponseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/StopMulticastStreamingResponseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/StopMulticastStreamingSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/StreamingCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/StreamingCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/VideoSourceModeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/VideoSourceModeExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/VideoSourceModeExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Media/VideoSourceModeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MediaAttributesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MediaAttributesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MediaCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MediaCapabilitiesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MediaCapabilitiesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MediaCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MediaUriDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MediaUriSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MessageDescriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MessageDescriptionExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MessageDescriptionExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MessageDescriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MessageDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MessageExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MessageExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MessageSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MessagesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MessagesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataAttributesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataAttributesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataConfigurationOptionsExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataConfigurationOptionsExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataConfigurationOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataConfigurationOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataFilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataFilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataInputDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataInputExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataInputExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MetadataInputSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MotionExpressionConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MotionExpressionConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MotionExpressionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MotionExpressionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MoveOptions20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MoveOptions20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MoveOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MoveOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Mpeg4ConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Mpeg4ConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Mpeg4DecOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Mpeg4DecOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Mpeg4Options2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Mpeg4Options2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Mpeg4OptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Mpeg4OptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MulticastConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/MulticastConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NTPInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NTPInformationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NTPInformationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NTPInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkCapabilitiesExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkCapabilitiesExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkCapabilitiesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkCapabilitiesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkGatewayDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkGatewaySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkHostDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkHostExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkHostExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkHostSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceConnectionSettingDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceConnectionSettingSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceInfoDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceInfoSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceLinkDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceLinkSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceSetConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceSetConfigurationExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceSetConfigurationExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceSetConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceSetConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkInterfaceSetConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkProtocolDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkProtocolExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkProtocolExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkProtocolSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkZeroConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkZeroConfigurationExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkZeroConfigurationExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkZeroConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkZeroConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NetworkZeroConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NoiseReductionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NoiseReductionOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NoiseReductionOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/NoiseReductionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDColorDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDColorOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDColorOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDColorOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDColorOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDColorSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDConfigurationOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDConfigurationOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDImgConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDImgConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDImgConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDImgConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDImgOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDImgOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDImgOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDImgOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDPosConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDPosConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDPosConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDPosConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDReferenceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDReferenceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDTextConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDTextConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDTextConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDTextConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDTextOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDTextOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDTextOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OSDTextOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OnvifVersionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/OnvifVersionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTControlDirectionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTControlDirectionExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTControlDirectionExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTControlDirectionOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTControlDirectionOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTControlDirectionOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTControlDirectionOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTControlDirectionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZConfigurationExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZConfigurationExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZConfigurationOptions2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZConfigurationOptions2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZFilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZFilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZMoveStatusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZMoveStatusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZNodeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZNodeExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZNodeExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZNodeExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZNodeExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZNodeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPositionFilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPositionFilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourPresetDetailDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourPresetDetailOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourPresetDetailOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourPresetDetailOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourPresetDetailOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourPresetDetailSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourSpotDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourSpotExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourSpotExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourSpotOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourSpotOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourSpotSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStartingConditionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStartingConditionExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStartingConditionExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStartingConditionOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStartingConditionOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStartingConditionOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStartingConditionOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStartingConditionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStatusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStatusExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStatusExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourStatusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourSupportedDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourSupportedExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourSupportedExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourSupportedSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourTypeExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZPresetTourTypeExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZSpacesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZSpacesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZSpacesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZSpacesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZSpeedDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZSpeedSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZStatusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZStatusFilterOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZStatusFilterOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZStatusFilterOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZStatusFilterOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZStatusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZVectorDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PTZVectorSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PanTiltLimitsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PanTiltLimitsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PaneConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PaneConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PaneLayoutDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PaneLayoutOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PaneLayoutOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PaneLayoutSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PaneOptionExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PaneOptionExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolygonDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolygonOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolygonOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolygonSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolylineArrayConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolylineArrayConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolylineArrayDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolylineArrayExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolylineArrayExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolylineArraySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolylineDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PolylineSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PrefixedIPv4AddressDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PrefixedIPv4AddressSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PrefixedIPv6AddressDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PrefixedIPv6AddressSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PresetTourDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/PresetTourSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileStatusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileStatusExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileStatusExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ProfileStatusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RealTimeStreamingCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RealTimeStreamingCapabilitiesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RealTimeStreamingCapabilitiesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RealTimeStreamingCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReceiverCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReceiverCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReceiverConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReceiverConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReceiverDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReceiverSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReceiverStateInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReceiverStateInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingEncryptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingEncryptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingEventFilterDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingEventFilterSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobSourceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobSourceExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobSourceExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobSourceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobStateInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobStateInformationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobStateInformationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobStateInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobStateSourceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobStateSourceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobStateTrackDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobStateTrackSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobStateTracksDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobStateTracksSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobTrackDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingJobTrackSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingSourceInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingSourceInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingSummaryDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingSummarySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingTargetConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RecordingTargetConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RectangleDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RectangleSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RelativeFocusDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RelativeFocusOptions20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RelativeFocusOptions20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RelativeFocusOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RelativeFocusOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RelativeFocusSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RelayOutputDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RelayOutputSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RelayOutputSettingsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RelayOutputSettingsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RemoteUserDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RemoteUserSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReplayCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReplayCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReplayConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReplayConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReverseDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReverseOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReverseOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReverseOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReverseOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ReverseSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RotateDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RotateExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RotateExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RotateOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RotateOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RotateOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RotateOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RotateSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RuleEngineConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RuleEngineConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RuleEngineConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/RuleEngineConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SceneOrientationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SceneOrientationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ScopeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ScopeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SearchCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SearchCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SearchScopeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SearchScopeExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SearchScopeExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SearchScopeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SecurityCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SecurityCapabilitiesExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SecurityCapabilitiesExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SecurityCapabilitiesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SecurityCapabilitiesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SecurityCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SimpleItemDescriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SimpleItemDescriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SimpleItemDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SimpleItemSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SourceIdentificationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SourceIdentificationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SourceIdentificationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SourceIdentificationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SourceReferenceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SourceReferenceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Space1DDescriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Space1DDescriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Space2DDescriptionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Space2DDescriptionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SphericalCoordinateDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SphericalCoordinateSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/StorageReferencePathDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/StorageReferencePathExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/StorageReferencePathExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/StorageReferencePathSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/StreamSetupDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/StreamSetupSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/StringItemsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/StringItemsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SubscriptionPolicyDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SubscriptionPolicySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SupportInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SupportInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SupportedAnalyticsModulesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SupportedAnalyticsModulesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SupportedAnalyticsModulesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SupportedAnalyticsModulesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SupportedRulesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SupportedRulesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SupportedRulesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SupportedRulesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemCapabilitiesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemCapabilitiesExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemCapabilitiesExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemCapabilitiesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemCapabilitiesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemCapabilitiesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemDateTimeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemDateTimeExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemDateTimeExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemDateTimeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemLogDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemLogSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemLogUriDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemLogUriListDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemLogUriListSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/SystemLogUriSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TLSConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TLSConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TimeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TimeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TimeZoneDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TimeZoneSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ToneCompensationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ToneCompensationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ToneCompensationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ToneCompensationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ToneCompensationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ToneCompensationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TrackAttributesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TrackAttributesExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TrackAttributesExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TrackAttributesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TrackConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TrackConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TrackInformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TrackInformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TransformationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TransformationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TransformationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TransformationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TransportDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/TransportSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/UserDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/UserExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/UserExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/UserSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Vector1DDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Vector1DSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Vector2DDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/Vector2DSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VectorDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VectorSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoAnalyticsConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoAnalyticsConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoAttributesDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoAttributesSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoDecoderConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoDecoderConfigurationOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoDecoderConfigurationOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoDecoderConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoder2ConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoder2ConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoder2ConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoder2ConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoderConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoderConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoderConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoderConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoderOptionsExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoderOptionsExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoderOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoEncoderOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoOutputConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoOutputConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoOutputConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoOutputConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoOutputDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoOutputExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoOutputExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoOutputSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoRateControl2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoRateControl2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoRateControlDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoRateControlSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoResolution2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoResolution2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoResolutionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoResolutionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationOptionsExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationOptionsExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationOptionsExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationOptionsExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceConfigurationSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceExtension2Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceExtension2Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/VideoSourceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalance20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalance20ExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalance20ExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalance20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalanceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalanceOptions20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalanceOptions20ExtensionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalanceOptions20ExtensionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalanceOptions20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalanceOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalanceOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WhiteBalanceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WideDynamicRange20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WideDynamicRange20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WideDynamicRangeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WideDynamicRangeOptions20Deserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WideDynamicRangeOptions20Serializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WideDynamicRangeOptionsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WideDynamicRangeOptionsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/WideDynamicRangeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ZoomLimitsDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/ONVIF/ZoomLimitsSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/AttributedAnyDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/AttributedAnySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/AttributedQNameDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/AttributedQNameSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/AttributedURIDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/AttributedURISerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/AttributedUnsignedLongDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/AttributedUnsignedLongSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/EndpointReferenceDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/EndpointReferenceSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/MetadataDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/MetadataSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/ProblemActionDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/ProblemActionSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/ReferenceParametersDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/ReferenceParametersSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/RelatesToDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/Addressing/RelatesToSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/XMLMIME/Base64BinaryDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/XMLMIME/Base64BinarySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/XMLMIME/HexBinaryDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/XMLMIME/HexBinarySerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/XOP/IncludeDeserializer.h create mode 100644 RemotingNG/samples/ONVIFClient/include/W3/XOP/IncludeSerializer.h create mode 100644 RemotingNG/samples/ONVIFClient/src/DeviceBindingClientHelper.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/DeviceBindingProxy.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/DeviceBindingProxyFactory.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/DeviceIOBindingClientHelper.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/DeviceIOBindingProxy.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/DeviceIOBindingProxyFactory.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/IDeviceBinding.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/IDeviceIOBinding.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/IMediaBinding.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/MediaBindingClientHelper.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/MediaBindingProxy.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/MediaBindingProxyFactory.cpp create mode 100644 RemotingNG/samples/ONVIFClient/src/ONVIFClientApp.cpp create mode 100644 RemotingNG/samples/Pizzeria/CMakeLists.txt create mode 100644 RemotingNG/samples/Pizzeria/Makefile create mode 100644 RemotingNG/samples/Pizzeria/RemoteGen.xml create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/DeliveryAddress.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/DeliveryAddressDeserializer.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/DeliveryAddressDetailsDeserializer.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/DeliveryAddressDetailsSerializer.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/DeliveryAddressSerializer.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/ExtToppingDeserializer.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/ExtToppingSerializer.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/IPizzaDeliveryService.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/IPizzaPickupService.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/Pizza.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaDeliveryService.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaDeliveryServiceRemoteObject.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaDeliveryServiceServerHelper.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaDeliveryServiceSkeleton.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaDeserializer.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaDetailsDeserializer.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaDetailsSerializer.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaPickupService.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaPickupServiceRemoteObject.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaPickupServiceServerHelper.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaPickupServiceSkeleton.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/PizzaSerializer.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/Topping.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/ToppingDeserializer.h create mode 100644 RemotingNG/samples/Pizzeria/include/Pizzeria/ToppingSerializer.h create mode 100644 RemotingNG/samples/Pizzeria/src/DeliveryAddress.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/IPizzaDeliveryService.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/IPizzaPickupService.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/Pizza.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/PizzaDeliveryService.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/PizzaDeliveryServiceRemoteObject.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/PizzaDeliveryServiceServerHelper.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/PizzaDeliveryServiceSkeleton.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/PizzaPickupService.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/PizzaPickupServiceRemoteObject.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/PizzaPickupServiceServerHelper.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/PizzaPickupServiceSkeleton.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/PizzeriaServer.cpp create mode 100644 RemotingNG/samples/Pizzeria/src/Topping.cpp create mode 100644 RemotingNG/samples/Pizzeria/wsdl/PizzaDeliveryService.wsdl create mode 100644 RemotingNG/samples/Pizzeria/wsdl/PizzaPickupService.wsdl create mode 100644 RemotingNG/samples/PizzeriaClient/CMakeLists.txt create mode 100644 RemotingNG/samples/PizzeriaClient/Makefile create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/DeliveryAddressDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/DeliveryAddressDetailsDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/DeliveryAddressDetailsSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/DeliveryAddressSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/ExtToppingDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/ExtToppingSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/IPizzaDeliveryService.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/IPizzaPickupService.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/PizzaDeliveryServiceClientHelper.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/PizzaDeliveryServiceProxy.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/PizzaDeliveryServiceProxyFactory.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/PizzaDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/PizzaDetailsDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/PizzaDetailsSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/PizzaPickupServiceClientHelper.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/PizzaPickupServiceProxy.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/PizzaPickupServiceProxyFactory.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/PizzaSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/ToppingDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/include/Pizzeria/ToppingSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClient/src/DeliveryAddress.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/src/IPizzaDeliveryService.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/src/IPizzaPickupService.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/src/Pizza.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/src/PizzaDeliveryServiceClientHelper.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/src/PizzaDeliveryServiceProxy.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/src/PizzaDeliveryServiceProxyFactory.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/src/PizzaPickupServiceClientHelper.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/src/PizzaPickupServiceProxy.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/src/PizzaPickupServiceProxyFactory.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/src/PizzeriaClient.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/src/Topping.cpp create mode 100644 RemotingNG/samples/PizzeriaClient/wsdl/PizzaDeliveryService.wsdl create mode 100644 RemotingNG/samples/PizzeriaClient/wsdl/PizzaPickupService.wsdl create mode 100644 RemotingNG/samples/PizzeriaClientREST/CMakeLists.txt create mode 100644 RemotingNG/samples/PizzeriaClientREST/Makefile create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/DeliveryAddress.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/DeliveryAddressDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/DeliveryAddressDetailsDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/DeliveryAddressDetailsSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/DeliveryAddressSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/ExtToppingDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/ExtToppingSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/IOrderCollectionEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/IOrderEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/IPizzaCollectionEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/IToppingCollectionEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/OrderCollectionEndpointClientHelper.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/OrderCollectionEndpointProxy.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/OrderCollectionEndpointProxyFactory.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/OrderDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/OrderEndpointClientHelper.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/OrderEndpointProxy.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/OrderEndpointProxyFactory.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/OrderSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/Pizza.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/PizzaCollectionEndpointClientHelper.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/PizzaCollectionEndpointProxy.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/PizzaCollectionEndpointProxyFactory.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/PizzaDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/PizzaDetailsDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/PizzaDetailsSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/PizzaSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/Topping.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/ToppingCollectionEndpointClientHelper.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/ToppingCollectionEndpointProxy.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/ToppingCollectionEndpointProxyFactory.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/ToppingDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/include/Pizzeria/ToppingSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/DeliveryAddress.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/IOrderCollectionEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/IOrderEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/IPizzaCollectionEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/IToppingCollectionEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/OrderCollectionEndpointClientHelper.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/OrderCollectionEndpointProxy.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/OrderCollectionEndpointProxyFactory.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/OrderEndpointClientHelper.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/OrderEndpointProxy.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/OrderEndpointProxyFactory.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/Pizza.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/PizzaCollectionEndpointClientHelper.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/PizzaCollectionEndpointProxy.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/PizzaCollectionEndpointProxyFactory.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/PizzeriaClient.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/Topping.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/ToppingCollectionEndpointClientHelper.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/ToppingCollectionEndpointProxy.cpp create mode 100644 RemotingNG/samples/PizzeriaClientREST/src/ToppingCollectionEndpointProxyFactory.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/CMakeLists.txt create mode 100644 RemotingNG/samples/PizzeriaClientWS/Makefile create mode 100644 RemotingNG/samples/PizzeriaClientWS/RemoteGen.xml create mode 100644 RemotingNG/samples/PizzeriaClientWS/XSDGen.xml create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/DeliveryAddress.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/DeliveryAddressDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/DeliveryAddressDetails.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/DeliveryAddressDetailsDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/DeliveryAddressDetailsSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/DeliveryAddressSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/Exception.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/ExtTopping.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/ExtToppingDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/ExtToppingSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetAnyPizzaReply.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetAnyPizzaRequest.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetMostPopularToppingReply.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetMostPopularToppingRequest.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetPizzaNamesReply.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetPizzaNamesRequest.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetPizzasReply.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetPizzasRequest.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetToppingsReply.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetToppingsRequest.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetWaitTimeReply.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/GetWaitTimeRequest.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/IPizzaDeliveryService.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/OrderReply.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/OrderRequest.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/Pizza.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/PizzaDeliveryService.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/PizzaDeliveryService12.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/PizzaDeliveryServiceClientHelper.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/PizzaDeliveryServiceProxy.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/PizzaDeliveryServiceProxyFactory.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/PizzaDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/PizzaDetails.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/PizzaDetailsDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/PizzaDetailsSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/PizzaSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/Topping.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/ToppingDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/include/Pizzeria/ToppingSerializer.h create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/DeliveryAddress.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/DeliveryAddressDetails.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/Exception.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/ExtTopping.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetAnyPizzaReply.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetAnyPizzaRequest.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetMostPopularToppingReply.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetMostPopularToppingRequest.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetPizzaNamesReply.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetPizzaNamesRequest.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetPizzasReply.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetPizzasRequest.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetToppingsReply.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetToppingsRequest.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetWaitTimeReply.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/GetWaitTimeRequest.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/IPizzaDeliveryService.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/OrderReply.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/OrderRequest.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/Pizza.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/PizzaDeliveryService.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/PizzaDeliveryService12.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/PizzaDeliveryServiceClientHelper.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/PizzaDeliveryServiceProxy.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/PizzaDeliveryServiceProxyFactory.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/PizzaDetails.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/PizzeriaClient.cpp create mode 100644 RemotingNG/samples/PizzeriaClientWS/src/Topping.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/CMakeLists.txt create mode 100644 RemotingNG/samples/PizzeriaREST/Makefile create mode 100644 RemotingNG/samples/PizzeriaREST/RemoteGen.xml create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/DeliveryAddress.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/DeliveryAddressDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/DeliveryAddressDetailsDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/DeliveryAddressDetailsSerializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/DeliveryAddressSerializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/ExtToppingDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/ExtToppingSerializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/IOrderCollectionEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/IOrderEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/IPizzaCollectionEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/IToppingCollectionEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/Order.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/OrderCollection.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/OrderCollectionEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/OrderCollectionEndpointRemoteObject.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/OrderCollectionEndpointServerHelper.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/OrderCollectionEndpointSkeleton.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/OrderDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/OrderEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/OrderEndpointRemoteObject.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/OrderEndpointServerHelper.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/OrderEndpointSkeleton.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/OrderSerializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/Pizza.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/PizzaCollectionEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/PizzaCollectionEndpointRemoteObject.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/PizzaCollectionEndpointServerHelper.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/PizzaCollectionEndpointSkeleton.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/PizzaDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/PizzaDetailsDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/PizzaDetailsSerializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/PizzaSerializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/Topping.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/ToppingCollectionEndpoint.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/ToppingCollectionEndpointRemoteObject.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/ToppingCollectionEndpointServerHelper.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/ToppingCollectionEndpointSkeleton.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/ToppingDeserializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/include/Pizzeria/ToppingSerializer.h create mode 100644 RemotingNG/samples/PizzeriaREST/openapi/Pizzeria.json create mode 100644 RemotingNG/samples/PizzeriaREST/src/DeliveryAddress.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/IOrderCollectionEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/IOrderEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/IPizzaCollectionEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/IToppingCollectionEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/OrderCollection.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/OrderCollectionEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/OrderCollectionEndpointRemoteObject.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/OrderCollectionEndpointServerHelper.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/OrderCollectionEndpointSkeleton.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/OrderEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/OrderEndpointRemoteObject.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/OrderEndpointServerHelper.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/OrderEndpointSkeleton.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/Pizza.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/PizzaCollectionEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/PizzaCollectionEndpointRemoteObject.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/PizzaCollectionEndpointServerHelper.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/PizzaCollectionEndpointSkeleton.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/PizzeriaServer.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/Topping.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/ToppingCollectionEndpoint.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/ToppingCollectionEndpointRemoteObject.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/ToppingCollectionEndpointServerHelper.cpp create mode 100644 RemotingNG/samples/PizzeriaREST/src/ToppingCollectionEndpointSkeleton.cpp create mode 100644 RemotingNG/samples/TimeClient/CMakeLists.txt create mode 100644 RemotingNG/samples/TimeClient/Makefile create mode 100644 RemotingNG/samples/TimeClient/RemoteGen.xml create mode 100644 RemotingNG/samples/TimeClient/include/ITimeService.h create mode 100644 RemotingNG/samples/TimeClient/include/TimeServiceClientHelper.h create mode 100644 RemotingNG/samples/TimeClient/include/TimeServiceProxy.h create mode 100644 RemotingNG/samples/TimeClient/include/TimeServiceProxyFactory.h create mode 100644 RemotingNG/samples/TimeClient/src/ITimeService.cpp create mode 100644 RemotingNG/samples/TimeClient/src/TimeClient.cpp create mode 100644 RemotingNG/samples/TimeClient/src/TimeServiceClientHelper.cpp create mode 100644 RemotingNG/samples/TimeClient/src/TimeServiceProxy.cpp create mode 100644 RemotingNG/samples/TimeClient/src/TimeServiceProxyFactory.cpp create mode 100644 RemotingNG/samples/TimeClientTCP/CMakeLists.txt create mode 100644 RemotingNG/samples/TimeClientTCP/Makefile create mode 100644 RemotingNG/samples/TimeClientTCP/include/ITimeService.h create mode 100644 RemotingNG/samples/TimeClientTCP/include/TimeServiceClientHelper.h create mode 100644 RemotingNG/samples/TimeClientTCP/include/TimeServiceEventSubscriber.h create mode 100644 RemotingNG/samples/TimeClientTCP/include/TimeServiceProxy.h create mode 100644 RemotingNG/samples/TimeClientTCP/include/TimeServiceProxyFactory.h create mode 100644 RemotingNG/samples/TimeClientTCP/include/WakeUpEventDeserializer.h create mode 100644 RemotingNG/samples/TimeClientTCP/include/WakeUpEventSerializer.h create mode 100644 RemotingNG/samples/TimeClientTCP/src/ITimeService.cpp create mode 100644 RemotingNG/samples/TimeClientTCP/src/TimeClient.cpp create mode 100644 RemotingNG/samples/TimeClientTCP/src/TimeServiceClientHelper.cpp create mode 100644 RemotingNG/samples/TimeClientTCP/src/TimeServiceEventSubscriber.cpp create mode 100644 RemotingNG/samples/TimeClientTCP/src/TimeServiceProxy.cpp create mode 100644 RemotingNG/samples/TimeClientTCP/src/TimeServiceProxyFactory.cpp create mode 100644 RemotingNG/samples/TimeClientUDS/CMakeLists.txt create mode 100644 RemotingNG/samples/TimeClientUDS/Makefile create mode 100644 RemotingNG/samples/TimeClientUDS/include/ITimeService.h create mode 100644 RemotingNG/samples/TimeClientUDS/include/TimeServiceClientHelper.h create mode 100644 RemotingNG/samples/TimeClientUDS/include/TimeServiceEventSubscriber.h create mode 100644 RemotingNG/samples/TimeClientUDS/include/TimeServiceProxy.h create mode 100644 RemotingNG/samples/TimeClientUDS/include/TimeServiceProxyFactory.h create mode 100644 RemotingNG/samples/TimeClientUDS/include/WakeUpEventDeserializer.h create mode 100644 RemotingNG/samples/TimeClientUDS/include/WakeUpEventSerializer.h create mode 100644 RemotingNG/samples/TimeClientUDS/src/ITimeService.cpp create mode 100644 RemotingNG/samples/TimeClientUDS/src/TimeClient.cpp create mode 100644 RemotingNG/samples/TimeClientUDS/src/TimeServiceClientHelper.cpp create mode 100644 RemotingNG/samples/TimeClientUDS/src/TimeServiceEventSubscriber.cpp create mode 100644 RemotingNG/samples/TimeClientUDS/src/TimeServiceProxy.cpp create mode 100644 RemotingNG/samples/TimeClientUDS/src/TimeServiceProxyFactory.cpp create mode 100644 RemotingNG/samples/TimeServer/CMakeLists.txt create mode 100644 RemotingNG/samples/TimeServer/Makefile create mode 100644 RemotingNG/samples/TimeServer/RemoteGen.xml create mode 100644 RemotingNG/samples/TimeServer/include/ITimeService.h create mode 100644 RemotingNG/samples/TimeServer/include/TimeService.h create mode 100644 RemotingNG/samples/TimeServer/include/TimeServiceRemoteObject.h create mode 100644 RemotingNG/samples/TimeServer/include/TimeServiceServerHelper.h create mode 100644 RemotingNG/samples/TimeServer/include/TimeServiceSkeleton.h create mode 100644 RemotingNG/samples/TimeServer/src/ITimeService.cpp create mode 100644 RemotingNG/samples/TimeServer/src/TimeServer.cpp create mode 100644 RemotingNG/samples/TimeServer/src/TimeService.cpp create mode 100644 RemotingNG/samples/TimeServer/src/TimeServiceRemoteObject.cpp create mode 100644 RemotingNG/samples/TimeServer/src/TimeServiceServerHelper.cpp create mode 100644 RemotingNG/samples/TimeServer/src/TimeServiceSkeleton.cpp create mode 100644 RemotingNG/samples/TimeServer/wsdl/TimeService.wsdl create mode 100644 RemotingNG/samples/TimeServerTCP/CMakeLists.txt create mode 100644 RemotingNG/samples/TimeServerTCP/Makefile create mode 100644 RemotingNG/samples/TimeServerTCP/RemoteGen.xml create mode 100644 RemotingNG/samples/TimeServerTCP/include/ITimeService.h create mode 100644 RemotingNG/samples/TimeServerTCP/include/TimeService.h create mode 100644 RemotingNG/samples/TimeServerTCP/include/TimeServiceEventDispatcher.h create mode 100644 RemotingNG/samples/TimeServerTCP/include/TimeServiceRemoteObject.h create mode 100644 RemotingNG/samples/TimeServerTCP/include/TimeServiceServerHelper.h create mode 100644 RemotingNG/samples/TimeServerTCP/include/TimeServiceSkeleton.h create mode 100644 RemotingNG/samples/TimeServerTCP/include/WakeUpEventDeserializer.h create mode 100644 RemotingNG/samples/TimeServerTCP/include/WakeUpEventSerializer.h create mode 100644 RemotingNG/samples/TimeServerTCP/src/ITimeService.cpp create mode 100644 RemotingNG/samples/TimeServerTCP/src/TimeServer.cpp create mode 100644 RemotingNG/samples/TimeServerTCP/src/TimeService.cpp create mode 100644 RemotingNG/samples/TimeServerTCP/src/TimeServiceEventDispatcher.cpp create mode 100644 RemotingNG/samples/TimeServerTCP/src/TimeServiceRemoteObject.cpp create mode 100644 RemotingNG/samples/TimeServerTCP/src/TimeServiceServerHelper.cpp create mode 100644 RemotingNG/samples/TimeServerTCP/src/TimeServiceSkeleton.cpp create mode 100644 RemotingNG/samples/TimeServerUDS/CMakeLists.txt create mode 100644 RemotingNG/samples/TimeServerUDS/Makefile create mode 100644 RemotingNG/samples/TimeServerUDS/RemoteGen.xml create mode 100644 RemotingNG/samples/TimeServerUDS/TimeServer.properties create mode 100644 RemotingNG/samples/TimeServerUDS/include/ITimeService.h create mode 100644 RemotingNG/samples/TimeServerUDS/include/TimeService.h create mode 100644 RemotingNG/samples/TimeServerUDS/include/TimeServiceEventDispatcher.h create mode 100644 RemotingNG/samples/TimeServerUDS/include/TimeServiceRemoteObject.h create mode 100644 RemotingNG/samples/TimeServerUDS/include/TimeServiceServerHelper.h create mode 100644 RemotingNG/samples/TimeServerUDS/include/TimeServiceSkeleton.h create mode 100644 RemotingNG/samples/TimeServerUDS/include/WakeUpEventDeserializer.h create mode 100644 RemotingNG/samples/TimeServerUDS/include/WakeUpEventSerializer.h create mode 100644 RemotingNG/samples/TimeServerUDS/src/ITimeService.cpp create mode 100644 RemotingNG/samples/TimeServerUDS/src/TimeServer.cpp create mode 100644 RemotingNG/samples/TimeServerUDS/src/TimeService.cpp create mode 100644 RemotingNG/samples/TimeServerUDS/src/TimeServiceEventDispatcher.cpp create mode 100644 RemotingNG/samples/TimeServerUDS/src/TimeServiceRemoteObject.cpp create mode 100644 RemotingNG/samples/TimeServerUDS/src/TimeServiceServerHelper.cpp create mode 100644 RemotingNG/samples/TimeServerUDS/src/TimeServiceSkeleton.cpp create mode 100644 RemotingNG/samples/TwilioSMS/CMakeLists.txt create mode 100644 RemotingNG/samples/TwilioSMS/Makefile create mode 100644 RemotingNG/samples/TwilioSMS/RemoteGen.xml create mode 100644 RemotingNG/samples/TwilioSMS/include/Twilio/ITwilioSMSEndpoint.h create mode 100644 RemotingNG/samples/TwilioSMS/include/Twilio/TwilioSMSEndpoint.h create mode 100644 RemotingNG/samples/TwilioSMS/include/Twilio/TwilioSMSEndpointClientHelper.h create mode 100644 RemotingNG/samples/TwilioSMS/include/Twilio/TwilioSMSEndpointProxy.h create mode 100644 RemotingNG/samples/TwilioSMS/include/Twilio/TwilioSMSEndpointProxyFactory.h create mode 100644 RemotingNG/samples/TwilioSMS/include/Twilio/TwilioSMSResponseDeserializer.h create mode 100644 RemotingNG/samples/TwilioSMS/include/Twilio/TwilioSMSResponseSerializer.h create mode 100644 RemotingNG/samples/TwilioSMS/src/ITwilioSMSEndpoint.cpp create mode 100644 RemotingNG/samples/TwilioSMS/src/TwilioSMSClient.cpp create mode 100644 RemotingNG/samples/TwilioSMS/src/TwilioSMSEndpointClientHelper.cpp create mode 100644 RemotingNG/samples/TwilioSMS/src/TwilioSMSEndpointProxy.cpp create mode 100644 RemotingNG/samples/TwilioSMS/src/TwilioSMSEndpointProxyFactory.cpp create mode 100644 RemotingNG/samples/Weather/CMakeLists.txt create mode 100644 RemotingNG/samples/Weather/Makefile create mode 100644 RemotingNG/samples/Weather/RemoteGen.xml create mode 100644 RemotingNG/samples/Weather/XSDGen.xml create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/ArrayOfForecast.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/ArrayOfForecastDeserializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/ArrayOfForecastSerializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/ArrayOfWeatherDescription.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/ArrayOfWeatherDescriptionDeserializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/ArrayOfWeatherDescriptionSerializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/Forecast.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/ForecastDeserializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/ForecastReturn.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/ForecastReturnDeserializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/ForecastReturnSerializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/ForecastSerializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/GetCityForecastByZIP.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/GetCityForecastByZIPResponse.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/GetCityWeatherByZIP.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/GetCityWeatherByZIPResponse.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/GetWeatherInformation.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/GetWeatherInformationResponse.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/IWeather.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/POP.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/POPDeserializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/POPSerializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/Temp.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/TempDeserializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/TempSerializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/Weather.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/WeatherClientHelper.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/WeatherDescription.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/WeatherDescriptionDeserializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/WeatherDescriptionSerializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/WeatherProxy.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/WeatherProxyFactory.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/WeatherReturn.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/WeatherReturnDeserializer.h create mode 100644 RemotingNG/samples/Weather/include/WeatherWS/WeatherReturnSerializer.h create mode 100644 RemotingNG/samples/Weather/src/ArrayOfForecast.cpp create mode 100644 RemotingNG/samples/Weather/src/ArrayOfWeatherDescription.cpp create mode 100644 RemotingNG/samples/Weather/src/Forecast.cpp create mode 100644 RemotingNG/samples/Weather/src/ForecastReturn.cpp create mode 100644 RemotingNG/samples/Weather/src/GetCityForecastByZIP.cpp create mode 100644 RemotingNG/samples/Weather/src/GetCityForecastByZIPResponse.cpp create mode 100644 RemotingNG/samples/Weather/src/GetCityWeatherByZIP.cpp create mode 100644 RemotingNG/samples/Weather/src/GetCityWeatherByZIPResponse.cpp create mode 100644 RemotingNG/samples/Weather/src/GetWeatherInformation.cpp create mode 100644 RemotingNG/samples/Weather/src/GetWeatherInformationResponse.cpp create mode 100644 RemotingNG/samples/Weather/src/IWeather.cpp create mode 100644 RemotingNG/samples/Weather/src/POP.cpp create mode 100644 RemotingNG/samples/Weather/src/Temp.cpp create mode 100644 RemotingNG/samples/Weather/src/Weather.cpp create mode 100644 RemotingNG/samples/Weather/src/WeatherClient.cpp create mode 100644 RemotingNG/samples/Weather/src/WeatherClientHelper.cpp create mode 100644 RemotingNG/samples/Weather/src/WeatherDescription.cpp create mode 100644 RemotingNG/samples/Weather/src/WeatherProxy.cpp create mode 100644 RemotingNG/samples/Weather/src/WeatherProxyFactory.cpp create mode 100644 RemotingNG/samples/Weather/src/WeatherReturn.cpp create mode 100644 RemotingNG/samples/Weather/wsdl/Weather.wsdl create mode 100644 RemotingNG/samples/dependencies create mode 100644 RemotingNG/src/AttributedObject.cpp create mode 100644 RemotingNG/src/Authenticator.cpp create mode 100644 RemotingNG/src/Authorizer.cpp create mode 100644 RemotingNG/src/BinaryDeserializer.cpp create mode 100644 RemotingNG/src/BinarySerializer.cpp create mode 100644 RemotingNG/src/Context.cpp create mode 100644 RemotingNG/src/Credentials.cpp create mode 100644 RemotingNG/src/Deserializer.cpp create mode 100644 RemotingNG/src/EventDispatcher.cpp create mode 100644 RemotingNG/src/EventListener.cpp create mode 100644 RemotingNG/src/EventSubscriber.cpp create mode 100644 RemotingNG/src/Identifiable.cpp create mode 100644 RemotingNG/src/Listener.cpp create mode 100644 RemotingNG/src/MethodHandler.cpp create mode 100644 RemotingNG/src/ORB.cpp create mode 100644 RemotingNG/src/Proxy.cpp create mode 100644 RemotingNG/src/ProxyFactory.cpp create mode 100644 RemotingNG/src/ProxyFactoryManager.cpp create mode 100644 RemotingNG/src/RemoteObject.cpp create mode 100644 RemotingNG/src/RemotingException.cpp create mode 100644 RemotingNG/src/Serializer.cpp create mode 100644 RemotingNG/src/SerializerBase.cpp create mode 100644 RemotingNG/src/ServerTransport.cpp create mode 100644 RemotingNG/src/Skeleton.cpp create mode 100644 RemotingNG/src/Transport.cpp create mode 100644 RemotingNG/src/TransportFactory.cpp create mode 100644 RemotingNG/src/TransportFactoryManager.cpp create mode 100644 RemotingNG/src/URIUtility.cpp create mode 100644 RemotingNG/testsuite/CMakeLists.txt create mode 100644 RemotingNG/testsuite/Makefile create mode 100644 RemotingNG/testsuite/RemoteGen.xml create mode 100644 RemotingNG/testsuite/src/Class1Deserializer.h create mode 100644 RemotingNG/testsuite/src/Class1Serializer.h create mode 100644 RemotingNG/testsuite/src/Driver.cpp create mode 100644 RemotingNG/testsuite/src/EventFilterTest.cpp create mode 100644 RemotingNG/testsuite/src/EventFilterTest.h create mode 100644 RemotingNG/testsuite/src/ITester.cpp create mode 100644 RemotingNG/testsuite/src/ITester.h create mode 100644 RemotingNG/testsuite/src/RemotingTest.cpp create mode 100644 RemotingNG/testsuite/src/RemotingTest.h create mode 100644 RemotingNG/testsuite/src/RemotingTestSuite.cpp create mode 100644 RemotingNG/testsuite/src/RemotingTestSuite.h create mode 100644 RemotingNG/testsuite/src/Struct1Deserializer.h create mode 100644 RemotingNG/testsuite/src/Struct1Serializer.h create mode 100644 RemotingNG/testsuite/src/Struct2Deserializer.h create mode 100644 RemotingNG/testsuite/src/Struct2Serializer.h create mode 100644 RemotingNG/testsuite/src/Struct3Deserializer.h create mode 100644 RemotingNG/testsuite/src/Struct3Serializer.h create mode 100644 RemotingNG/testsuite/src/Struct4Deserializer.h create mode 100644 RemotingNG/testsuite/src/Struct4Serializer.h create mode 100644 RemotingNG/testsuite/src/Struct5Deserializer.h create mode 100644 RemotingNG/testsuite/src/Struct5Serializer.h create mode 100644 RemotingNG/testsuite/src/Struct6Deserializer.h create mode 100644 RemotingNG/testsuite/src/Struct6Serializer.h create mode 100644 RemotingNG/testsuite/src/Struct7Deserializer.h create mode 100644 RemotingNG/testsuite/src/Struct7Serializer.h create mode 100644 RemotingNG/testsuite/src/Struct8Deserializer.h create mode 100644 RemotingNG/testsuite/src/Struct8Serializer.h create mode 100644 RemotingNG/testsuite/src/Tester.cpp create mode 100644 RemotingNG/testsuite/src/Tester.h create mode 100644 RemotingNG/testsuite/src/TesterClientHelper.cpp create mode 100644 RemotingNG/testsuite/src/TesterClientHelper.h create mode 100644 RemotingNG/testsuite/src/TesterEventDispatcher.cpp create mode 100644 RemotingNG/testsuite/src/TesterEventDispatcher.h create mode 100644 RemotingNG/testsuite/src/TesterEventSubscriber.cpp create mode 100644 RemotingNG/testsuite/src/TesterEventSubscriber.h create mode 100644 RemotingNG/testsuite/src/TesterProxy.cpp create mode 100644 RemotingNG/testsuite/src/TesterProxy.h create mode 100644 RemotingNG/testsuite/src/TesterProxyFactory.cpp create mode 100644 RemotingNG/testsuite/src/TesterProxyFactory.h create mode 100644 RemotingNG/testsuite/src/TesterRemoteObject.cpp create mode 100644 RemotingNG/testsuite/src/TesterRemoteObject.h create mode 100644 RemotingNG/testsuite/src/TesterServerHelper.cpp create mode 100644 RemotingNG/testsuite/src/TesterServerHelper.h create mode 100644 RemotingNG/testsuite/src/TesterSkeleton.cpp create mode 100644 RemotingNG/testsuite/src/TesterSkeleton.h create mode 100644 RemotingNG/testsuite/src/URIUtilityTest.cpp create mode 100644 RemotingNG/testsuite/src/URIUtilityTest.h create mode 100644 RemotingNG/testsuite/src/WinDriver.cpp diff --git a/RemotingNG/CMakeLists.txt b/RemotingNG/CMakeLists.txt new file mode 100644 index 0000000000..97e319fbe9 --- /dev/null +++ b/RemotingNG/CMakeLists.txt @@ -0,0 +1,43 @@ +# Sources +file(GLOB SRCS_G "src/*.cpp") +POCO_SOURCES_AUTO(SRCS ${SRCS_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "include/*.h") +POCO_HEADERS_AUTO(SRCS ${HDRS_G}) + +# Version Resource +if(MSVC AND BUILD_SHARED_LIBS) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) +endif() + +add_library(RemotingNG ${SRCS}) +add_library(Poco::RemotingNG ALIAS RemotingNG) +set_target_properties(RemotingNG + PROPERTIES + VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} + OUTPUT_NAME PocoRemotingNG + DEFINE_SYMBOL RemotingNG_EXPORTS +) + +target_link_libraries(RemotingNG PUBLIC Poco::Foundation) +target_include_directories(RemotingNG + PUBLIC + $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src +) + +POCO_INSTALL(RemotingNG) +POCO_GENERATE_PACKAGE(RemotingNG) + +add_subdirectory(RemoteGen) + +if(ENABLE_TESTS) + add_subdirectory(testsuite) +endif() + +if (ENABLE_SAMPLES) + add_subdirectory(samples) +endif() diff --git a/RemotingNG/HTTP/CMakeLists.txt b/RemotingNG/HTTP/CMakeLists.txt new file mode 100644 index 0000000000..03f3a2a27c --- /dev/null +++ b/RemotingNG/HTTP/CMakeLists.txt @@ -0,0 +1,37 @@ +# Sources +file(GLOB SRCS_HTTP_G "src/*.cpp") +POCO_SOURCES_AUTO(SRCS_HTTP ${SRCS_HTTP_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "include/*.h") +POCO_HEADERS_AUTO(SRCS_HTTP ${HDRS_G}) + +# Version Resource +if(MSVC AND BUILD_SHARED_LIBS) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) + list(APPEND SRCS_HTTP ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) +endif() + +add_library(RemotingNGHTTP ${SRCS_HTTP}) +add_library(Poco::RemotingNGHTTP ALIAS RemotingNGHTTP) +set_target_properties(RemotingNGHTTP + PROPERTIES + VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} + OUTPUT_NAME PocoRemotingNGHTTP + DEFINE_SYMBOL RemotingNGHTTP_EXPORTS +) + +target_link_libraries(RemotingNGHTTP PUBLIC Poco::Foundation Poco::Net Poco::RemotingNG) +target_include_directories(RemotingNGHTTP + PUBLIC + $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src +) + +POCO_INSTALL(RemotingNGHTTP) +POCO_GENERATE_PACKAGE(RemotingNGHTTP) + +if(ENABLE_TESTS) + add_subdirectory(testsuite) +endif() diff --git a/RemotingNG/HTTP/Makefile b/RemotingNG/HTTP/Makefile new file mode 100644 index 0000000000..b8609403e0 --- /dev/null +++ b/RemotingNG/HTTP/Makefile @@ -0,0 +1,16 @@ +# +# Makefile +# +# Makefile for Poco RemotingNG HTTP Transport +# + +include $(POCO_BASE)/build/rules/global + +objects = Listener Transport TransportFactory \ + HTTPRequestHandler HTTPRequestHandlerFactory + +target = PocoRemotingNGHTTP +target_version = $(LIBVERSION) +target_libs = PocoRemotingNG PocoNet PocoFoundation $(POCO_LICENSING) + +include $(POCO_BASE)/build/rules/lib diff --git a/RemotingNG/HTTP/cmake/PocoRemotingNGHTTPConfig.cmake b/RemotingNG/HTTP/cmake/PocoRemotingNGHTTPConfig.cmake new file mode 100644 index 0000000000..113a4f1580 --- /dev/null +++ b/RemotingNG/HTTP/cmake/PocoRemotingNGHTTPConfig.cmake @@ -0,0 +1,5 @@ +include(CMakeFindDependencyMacro) +find_dependency(PocoFoundation) +find_dependency(PocoNet) +find_dependency(PocoRemotingNG) +include("${CMAKE_CURRENT_LIST_DIR}/PocoRemotingNGHTTPTargets.cmake") diff --git a/RemotingNG/HTTP/dependencies b/RemotingNG/HTTP/dependencies new file mode 100644 index 0000000000..1a0d5344ca --- /dev/null +++ b/RemotingNG/HTTP/dependencies @@ -0,0 +1,3 @@ +RemotingNG +Net +Foundation diff --git a/RemotingNG/HTTP/doc/00250-RemotingNGHTTPTransportUserGuide.page b/RemotingNG/HTTP/doc/00250-RemotingNGHTTPTransportUserGuide.page new file mode 100644 index 0000000000..22eb2a0b5d --- /dev/null +++ b/RemotingNG/HTTP/doc/00250-RemotingNGHTTPTransportUserGuide.page @@ -0,0 +1,195 @@ +Remoting NG HTTP Transport User Guide +Remoting NG + +!!!Introduction + +The HTTP Transport is a very lightweight HTTP-based Transport implementation, +using the Remoting NG binary serialization format with a HTTP connection. + +This transport is a good choice if a Remoting NG based C++ application needs +to communicate with another one if only a HTTP connection is possible between +them (e.g., due to a proxy server or firewall). + +The HTTP transport supports the following features: + + - HTTP compression (GZIP content transfer encoding) for requests and responses. + - HTTP authentication (basic or digest, client only) + - HTTPS + + +!!!Basic HTTP Transport Usage + +!!Server Usage + +To use the HTTP Transport in a server, the following three steps must +be performed: + + 1. Register the Poco::RemotingNG::HTTP::TransportFactory with the ORB, + 2. Optionally configure the listener, + 3. Register the Listener with the ORB, and finally, + 4. Register the individual objects with the ORB. + +Following is an example code fragment for setting up a HTTP Listener +and registering a service object for use with the listener. + + Poco::RemotingNG::HTTP::Listener::Ptr pListener = new Poco::RemotingNG::HTTP::Listener("localhost:8080"); + std::string listener = Poco::RemotingNG::ORB::instance().registerListener(pListener); + + st::string uri = Sample::TimeServiceServerHelper::registerObject( + new Sample::TimeService, + "TheTimeService", + listener + ); +---- + +Please see the Poco::RemotingNG::HTTP::Listener class documentation for detailed information +about how to setup and configure the listener. + + +!!Client Usage + +To use the HTTP Transport in a client, the following two steps +must be performed: + + 1. Register the Poco::RemotingNG::HTTP::TransportFactory with the ORB, and + 2. Retrieve the interface (proxy) object using the helper class. + +Following is an example code fragment for setting up a HTTP Transport, +and obtaining a Proxy object for invoking methods on the service object. + + Poco::RemotingNG::HTTP::TransportFactory::registerFactory(); + Sample::ITimeService::Ptr pTimeService = MyProject::MyClassHelper::find( + "http://localhost:8080/http/TimeService/TheTimeService"); + ); +---- + + +!Configuring The Client Transport + +To configure the client transport (e.g., to , +enable HTTP compression, or HTTP authentication), the Transport object must +be obtained from the proxy. This is done in two steps. First, the interface +pointer obtained from the client helper must be casted to a proxy: + + Poco::RemotingNG::Proxy::Ptr pProxy = pTimeService.cast(); +---- + +Second, the Transport object can be obtained from the proxy: + + Poco::RemotingNG::HTTP::Transport& trans = static_cast(pProxy->remoting__transport()); +---- + +These two casts can also be put into a utility function <[transportFromInterface()]>: + + template + Poco::RemotingNG::HTTP::Transport& transportFromInterface(Poco::AutoPtr pInterface) + { + Poco::RemotingNG::Proxy::Ptr pProxy = pInterface.template cast(); + if (pProxy) + { + return static_cast(pProxy->remoting__transport()); + } + else throw Poco::BadCastException(); + } +---- + +Using the <[transportFromInterface()]> function, we can write: + + Poco::RemotingNG::HTTP::Transport& trans = transportFromInterface(pTimeService); +---- + + +Now that we have access to the Transport object, we can configure it: + + trans.enableCompression(true); +---- + +Configuration should be done before the first method is invoked over the proxy. + +Please see the Poco::RemotingNG::HTTP::Transport class documentation for other +configuration options, including timeouts and user-agent string. + + +!Enabling HTTP Authentication + +The HTTP Transport supports HTTP Basic and Digest authentication. To enable authentication +for a proxy object, first obtain the Transport object as shown in the previous section. +HTTP Basic Authentication can then be enabled with: + + trans.setAuthentication(Poco::RemotingNG::HTTP::Transport::AUTH_BASIC); + Poco::RemotingNG::Credentials creds; + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, "user"); + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, "s3cr3t"); + trans.setCredentials(creds); +---- + +To enable HTTP Digest Authentication: + + trans.setAuthentication(Poco::RemotingNG::HTTP::Transport::AUTH_DIGEST); + Poco::RemotingNG::Credentials creds; + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, "user"); + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, "s3cr3t"); + trans.setCredentials(creds); +---- + +Please note that chunked transfer encoding must be disabled in order to use HTTP Digest +Authentication. + +It is also possible to enable both Basic and Digest authentication and use whatever +the server requests: + + trans.setAuthentication(Poco::RemotingNG::HTTP::Transport::AUTH_ANY); + Poco::RemotingNG::Credentials creds; + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, "user"); + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, "s3cr3t"); + trans.setCredentials(creds); + trans.enableChunkedTransferEncoding(false); +---- + + +!!!Using HTTPS + +The HTTP transport normally uses a plain, unencrypted HTTP +connection between the client and the server. To make the HTTP Transport use a secure +HTTP socket connection, the following steps must be performed. + + +!!HTTPS On The Server Side + +On the server side, the listener must be created using a +Poco::Net::SecureServerSocket. + + Poco::Net::SecureServerSocket serverSocket(8443); + std::string listener = Poco::RemotingNG::ORB::instance().registerListener( + new Poco::RemotingNG::HTTP::Listener("localhost:8443", serverSocket) + ); + std::string uri = MyProject::MyClassHelper::registerObject( + new MyProject::MyClass, + "MyObject", + listener + ); +---- + + +!!HTTPS On The Client Side + +On the client side, the HTTP transport uses a private +Poco::Net::HTTPSessionFactory object to create +the Poco::Net::HTTPClientSession for talking to the server. +So, all that needs to be done to enable HTTPS on the +client is to register the Poco::Net::HTTPSSessionInstantiator +with the session factory. Then, a https URI can be used to +access the web service. + + Poco::RemotingNG::HTTP::Transport::httpSessionFactory().registerProtocol( + "https", + new Poco::Net::HTTPSSessionInstantiator + ); + + Poco::RemotingNG::HTTP::TransportFactory::registerFactory(); + + MyProject::IMyClass::Ptr pObj = MyProject::MyClassHelper::find( + "https://localhost:8443/http/MyClass/TheObject" + ); +---- + diff --git a/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTP.h b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTP.h new file mode 100644 index 0000000000..181f75a9fb --- /dev/null +++ b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTP.h @@ -0,0 +1,62 @@ +// +// HTTP.h +// +// Library: RemotingNG/HTTP +// Package: HTTP +// Module: HTTP +// +// Basic definitions for the Poco RemotingNG HTTP library. +// This file must be the first file included by every other HTTP +// header file. +// +// Copyright (c) 2010-2017, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_HTTP_HTTP_INCLUDED +#define RemotingNG_HTTP_HTTP_INCLUDED + + +#ifndef Foundation_Foundation_INCLUDED +#include "Poco/Foundation.h" +#endif + + +// +// The following block is the standard way of creating macros which make exporting +// from a DLL simpler. All files within this DLL are compiled with the RemotingNGHTTP_EXPORTS +// symbol defined on the command line. This symbol should not be defined on any project +// that uses this DLL. This way any other project whose source files include this file sees +// RemotingNGHTTP_API functions as being imported from a DLL, whereas this DLL sees symbols +// defined with this macro as being exported. +// +#if defined(_WIN32) && defined(POCO_DLL) + #if defined(RemotingNGHTTP_EXPORTS) + #define RemotingNGHTTP_API __declspec(dllexport) + #else + #define RemotingNGHTTP_API __declspec(dllimport) + #endif +#endif + + +#if !defined(RemotingNGHTTP_API) + #define RemotingNGHTTP_API +#endif + + +// +// Automatically link JSON library. +// +#if defined(_MSC_VER) + #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(RemotingNGHTTP_EXPORTS) + #pragma comment(lib, "PocoRemotingNGHTTP" POCO_LIB_SUFFIX) + #endif +#endif + + +#endif // RemotingNG_HTTP_HTTP_INCLUDED diff --git a/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTPRequestHandler.h b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTPRequestHandler.h new file mode 100644 index 0000000000..ddb1c97579 --- /dev/null +++ b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTPRequestHandler.h @@ -0,0 +1,58 @@ +// +// HTTPRequestHandler.h +// +// Library: RemotingNG/HTTP +// Package: HTTP +// Module: HTTPRequestHandler +// +// Definition of the HTTPRequestHandler class. +// +// Copyright (c) 2006-2017, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_HTTP_HTTPRequestHandler_INCLUDED +#define RemotingNG_HTTP_HTTPRequestHandler_INCLUDED + + +#include "Poco/RemotingNG/HTTP/HTTP.h" +#include "Poco/RemotingNG/HTTP/Listener.h" +#include "Poco/Net/HTTPRequestHandler.h" +#include "Poco/Logger.h" + + +namespace Poco { +namespace RemotingNG { +namespace HTTP { + + +class RemotingNGHTTP_API HTTPRequestHandler: public Poco::Net::HTTPRequestHandler + /// The HTTPRequestHandler implementation for RemotingNG HTTP. +{ +public: + HTTPRequestHandler(Listener& listener); + /// Creates a HTTPRequestHandler, using the given Listener. + + ~HTTPRequestHandler(); + /// Destroys the HTTPRequestHandler. + + // Poco::Net::HTTPRequestHandler + void handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response); + +private: + HTTPRequestHandler(); + + Listener& _listener; + Poco::Logger& _logger; +}; + + +} } } // namespace Poco::RemotingNG::HTTP + + +#endif // RemotingNG_HTTP_HTTPRequestHandler_INCLUDED diff --git a/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTPRequestHandlerFactory.h b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTPRequestHandlerFactory.h new file mode 100644 index 0000000000..1854ea64bc --- /dev/null +++ b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/HTTPRequestHandlerFactory.h @@ -0,0 +1,57 @@ +// +// HTTPRequestHandlerFactory.h +// +// Library: RemotingNG/HTTP +// Package: HTTP +// Module: HTTPRequestHandlerFactory +// +// Definition of the HTTPRequestHandlerFactory class. +// +// Copyright (c) 2010-2017, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_HTTP_HTTPRequestHandlerFactory_INCLUDED +#define RemotingNG_HTTP_HTTPRequestHandlerFactory_INCLUDED + + +#include "Poco/RemotingNG/HTTP/HTTP.h" +#include "Poco/Net/HTTPRequestHandlerFactory.h" +#include "Poco/Net/HTTPRequestHandler.h" + + +namespace Poco { +namespace RemotingNG { +namespace HTTP { + + +class Listener; + + +class RemotingNGHTTP_API HTTPRequestHandlerFactory: public Poco::Net::HTTPRequestHandlerFactory + /// A factory for HTTPRequestHandler objects. +{ +public: + HTTPRequestHandlerFactory(Listener& listener); + /// Creates the HTTPRequestHandlerFactory. + + ~HTTPRequestHandlerFactory(); + /// Destroys the HTTPRequestHandlerFactory. + + // Poco::Net::HTTPRequestHandlerFactory + Poco::Net::HTTPRequestHandler* createRequestHandler(const Poco::Net::HTTPServerRequest& request); + +private: + Listener& _listener; +}; + + +} } } // namespace Poco::RemotingNG::HTTP + + +#endif // RemotingNG_HTTP_HTTPRequestHandlerFactory_INCLUDED diff --git a/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/Listener.h b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/Listener.h new file mode 100644 index 0000000000..168761183b --- /dev/null +++ b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/Listener.h @@ -0,0 +1,137 @@ +// +// Listener.h +// +// Library: RemotingNG/HTTP +// Package: HTTP +// Module: Listener +// +// Definition of the Listener class. +// +// Copyright (c) 2006-2017, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_HTTP_Listener_INCLUDED +#define RemotingNG_HTTP_Listener_INCLUDED + + +#include "Poco/RemotingNG/HTTP/HTTP.h" +#include "Poco/RemotingNG/Listener.h" +#include "Poco/Net/HTTPServerParams.h" +#include "Poco/Net/HTTPServer.h" +#include "Poco/Net/ServerSocket.h" +#include "Poco/SharedPtr.h" + + +namespace Poco { +namespace RemotingNG { +namespace HTTP { + + +class RemotingNGHTTP_API Listener: public Poco::RemotingNG::Listener + /// The RemotingNG Listener implementation for the RemotingNG HTTP transport. + /// + /// For more information, please see the Transport class. +{ +public: + using Ptr = Poco::AutoPtr; + + enum Protocol + { + PROTO_HTTP, + PROTO_HTTPS + }; + + Listener(const std::string& endPoint, Protocol proto); + /// Creates a Listener for the given endpoint, + /// which must be in : format. + /// + /// The value specified for proto determines the URI + /// scheme used by createURI(). + /// + /// Note that the Listener instance created by this constructor + /// does not actually accept requests itself. It merely registers an + /// endpoint in the ORB. A Poco::Net::HTTPServer must be created + /// for accepting RemotingNG HTTP requests using a HTTPRequestHandler. + + Listener(const std::string& endPoint, Poco::Net::HTTPServerParams::Ptr pParams = new Poco::Net::HTTPServerParams); + /// Creates a Listener for the given endpoint, + /// which must be in : format. + /// + /// This constructor will create a Poco::Net::HTTPServer + /// instance for handling incoming HTTP requests, using + /// a Poco::Net::ServerSocket bound to endPoint. + + Listener(const std::string& endPoint, const Poco::Net::ServerSocket& socket, Poco::Net::HTTPServerParams::Ptr pParams = new Poco::Net::HTTPServerParams); + /// Creates a Listener for the given endpoint, + /// which must be in : format. + /// + /// This constructor will create a Poco::Net::HTTPServer + /// instance using the given server socket for handling + /// incoming HTTP requests. The given server socket can + /// be a Poco::Net::ServerSocket or a Poco::Net::SecureServerSocket + /// which must be bound to a socket address corresponding to + /// the given endPoint. + + ~Listener(); + /// Destroys the Listener. + + void enableChunkedTransferEncoding(bool enable = true); + /// Enables or disables chunked transfer encoding for responses. + /// Default is enabled. + + bool isChunkedTransferEncodingEnabled() const; + /// Returns true iff chunked transfer encoding is enabled for responses. + + void enableCompression(bool enable = true); + /// Enables or disables GZIP compression for responses. + /// Default is enabled. + /// + /// Note that chunked transfer encoding must also be enabled + /// in order to allow compression. + + bool isCompressionEnabled() const; + /// Returns true iff GZIP compression is enabled for responses. + + // Poco::RemotingNG::Listener + void start(); + void stop(); + const std::string& protocol() const; + std::string createURI(const Poco::RemotingNG::Identifiable::TypeId& typeId, const Poco::RemotingNG::Identifiable::ObjectId& objectId); + bool handlesURI(const std::string& uri); + void registerObject(Poco::RemotingNG::RemoteObject::Ptr pRemoteObject, Poco::RemotingNG::Skeleton::Ptr pSkeleton); + void unregisterObject(Poco::RemotingNG::RemoteObject::Ptr pRemoteObject); + +private: + bool _secure; + Poco::SharedPtr _pHTTPServer; + bool _enableChunkedTransferEncoding; + bool _enableCompression; + std::string _corsAllowedOrigin; +}; + + +// +// inlines +// +inline bool Listener::isChunkedTransferEncodingEnabled() const +{ + return _enableChunkedTransferEncoding; +} + + +inline bool Listener::isCompressionEnabled() const +{ + return _enableCompression; +} + + +} } } // namespace Poco::RemotingNG::HTTP + + +#endif // RemotingNG_HTTP_Listener_INCLUDED diff --git a/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/Transport.h b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/Transport.h new file mode 100644 index 0000000000..6c702eb296 --- /dev/null +++ b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/Transport.h @@ -0,0 +1,252 @@ +// +// Transport.h +// +// Library: RemotingNG/HTTP +// Package: HTTP +// Module: Transport +// +// Definition of the Transport class. +// +// Copyright (c) 2006-2017, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_HTTP_Transport_INCLUDED +#define RemotingNG_HTTP_Transport_INCLUDED + + +#include "Poco/RemotingNG/HTTP/HTTP.h" +#include "Poco/RemotingNG/BinarySerializer.h" +#include "Poco/RemotingNG/BinaryDeserializer.h" +#include "Poco/RemotingNG/Transport.h" +#include "Poco/RemotingNG/Credentials.h" +#include "Poco/Net/HTTPClientSession.h" +#include "Poco/Net/HTTPSessionFactory.h" +#include "Poco/Net/HTTPCredentials.h" +#include "Poco/SharedPtr.h" +#include "Poco/URI.h" +#include +#include + + +namespace Poco +{ + class DeflatingOutputStream; + class InflatingInputStream; +} + + +namespace Poco { +namespace RemotingNG { +namespace HTTP { + + +class RemotingNGHTTP_API Transport: public Poco::RemotingNG::Transport + /// The Transport implementation for RemotingNG HTTP. + /// + /// This transport implements the RemotingNG binary serialization + /// protocol on top of HTTP. + /// + /// The transport supports HTTP Basic and HTTP Digest authentication. + /// Please note that for HTTP Digest authentication to work, chunked transfer + /// encoding must be disabled. Also, HTTP Digest authentication is not supported + /// for one-way requests. +{ +public: + static const std::string PROTOCOL; + static const std::string CONTENT_TYPE; + + enum AuthMode + /// Authentication mode. + { + AUTH_NONE = 0, /// No authentication. + AUTH_BASIC = 1, /// HTTP Basic Authentication only (credentials are always sent). + AUTH_DIGEST = 2, /// HTTP Digest Authentication only. + AUTH_ANY = 3 /// HTTP Basic or Digest authentication (whichever the server requests). + }; + + Transport(); + /// Creates a Transport for RemotingNG HTTP. + + ~Transport(); + /// Destroys the Transport. + + Poco::Timespan getTimeout() const; + /// Returns the HTTP timeout. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + void setTimeout(const Poco::Timespan& timeout); + /// Sets the HTTP timeout. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + bool isKeepAliveEnabled() const; + /// Returns true iff HTTP/1.1 persistent connections are enabled. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + void enableKeepAlive(bool enable); + /// Enables or disables HTTP/1.1 persistent connections. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + Poco::Timespan getKeepAliveTimeout() const; + /// Returns the timeout for HTTP/1.1 persistent connections. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + void setKeepAliveTimeout(const Poco::Timespan& timeout); + /// Sets the timeout for HTTP/1.1 persistent connections. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + bool isChunkedTransferEncodingEnabled() const; + /// Returns true iff chunked transfer encoding is enabled, + /// which is the default unless enableChunkedTransferEncoding(false) has + /// been called. + + void enableChunkedTransferEncoding(bool enable = true); + /// Enables or disables chunked transfer encoding for HTTP requests. + /// This is normally enabled. However, some poorly implemented HTTP stacks cannot + /// handle chunked HTTP messages. Also, chunked transfer encoding must be + /// disabled if AUTH_DIGEST or AUTH_ANY authentication is used. + /// + /// Regardless of this setting, chunked transfer encoding is always supported + /// for responses sent by the server. + + bool isCompressionEnabled() const; + /// Returns true iff HTTP compression (GZIP) is enabled for requests. + /// Default is disabled. + + void enableCompression(bool enable); + /// Enables or disables HTTP compression via GZIP Content-Encoding for + /// requests. + /// This is normally disabled, due to a lack of support by most servers. + /// + /// Note that chunked transfer encoding must also be enabled in + /// order to allow compression. + /// + /// Regardless of this setting, server responses can always be compressed + /// using GZIP Content-Encoding. + + void setAuthentication(AuthMode authMode); + /// Sets the authentication mode. + /// + /// Please note that for AUTH_DIGEST or AUTH_ANY, chunked + /// transfer encoding must be disabled. + + AuthMode getAuthentication() const; + /// Returns the authentication mode. + + void setCredentials(const Credentials& creds); + /// Sets the credentials for client authentication. + /// + /// The Credentials object should contain a username + /// (Credentials::ATTR_USERNAME, "n") and a password + /// (Credentials::ATTR_PASSWORD, "p") attribute. + + Credentials getCredentials() const; + /// Returns the credentials, containing username and password + /// attributes. + + const std::string& getUserAgent() const; + /// Returns the value of the User-Agent header sent with HTTP + /// requests, or an empty string if no User-Agent value has been set. + + void setUserAgent(const std::string& userAgent); + /// Sets the value of the User-Agent header sent with HTTP + /// requests. If an empty string is given (default), no User-Agent + /// header is included in the request. + + void setCustomHeader(const std::string& name, const std::string& value); + /// Adds a custom HTTP header to the HTTP request. + + void removeCustomHeader(const std::string& name); + /// Removes a custom HTTP header previously added with setCustomHeader(). + + bool hasCustomHeader(const std::string& name) const; + /// Returns true if a custom HTTP header with the given name has been set. + + const std::string& getCustomHeader(const std::string& name) const; + /// Returns the value of the custom HTTP header with the given name. + /// + /// Throws a Poco::NotFoundException if the custom header with the + /// given name does not exist. + + void setProxyConfig(const Poco::Net::ProxyConfig& proxyConfig); + /// Sets the proxy configuration. + + const Poco::Net::ProxyConfig& getProxyConfig() const; + /// Returns the proxy configuration. + + static Poco::Net::HTTPSessionFactory& httpSessionFactory(); + /// Returns the Poco::Net::HTTPSessionFactory instance used by + /// the transport. + + // Poco::RemotingNG::Transport + const std::string& endPoint() const; + void connect(const std::string& endPoint); + void disconnect(); + bool connected() const; + Poco::RemotingNG::Serializer& beginMessage(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + void sendMessage(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + Poco::RemotingNG::Serializer& beginRequest(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + Poco::RemotingNG::Deserializer& sendRequest(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + void endRequest(); + +protected: + const Poco::Net::HTTPClientSession& requireSession() const; + Poco::Net::HTTPClientSession& requireSession(); + void prepareRequest(Poco::Net::HTTPRequest& request); + + static const std::string USER_AGENT; + +private: + Poco::Net::HTTPCredentials _creds; + Poco::Net::ProxyConfig _proxyConfig; + Poco::SharedPtr _pSession; + BinarySerializer _serializer; + BinaryDeserializer _deserializer; + std::string _endPoint; + Poco::URI _endPointURI; + bool _keepAlive; + bool _chunkedTransferEncoding; + bool _compression; + AuthMode _authMode; + std::string _userAgent; + std::map _customHeaders; + Poco::SharedPtr _pStream; + Poco::SharedPtr _pDeflater; + Poco::SharedPtr _pInflater; + + static Poco::Net::HTTPSessionFactory _httpSessionFactory; + + friend class HTTPRequestHandler; +}; + + +// +// inlines +// +inline Poco::Net::HTTPSessionFactory& Transport::httpSessionFactory() +{ + return _httpSessionFactory; +} + + +} } } // namespace Poco::RemotingNG::HTTP + + +#endif // RemotingNG_HTTP_Transport_INCLUDED diff --git a/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/TransportFactory.h b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/TransportFactory.h new file mode 100644 index 0000000000..36c985ffb1 --- /dev/null +++ b/RemotingNG/HTTP/include/Poco/RemotingNG/HTTP/TransportFactory.h @@ -0,0 +1,55 @@ +// +// TransportFactory.h +// +// Library: RemotingNG/HTTP +// Package: HTTP +// Module: TransportFactory +// +// Definition of the TransportFactory class. +// +// Copyright (c) 2006-2017, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_HTTP_TransportFactory_INCLUDED +#define RemotingNG_HTTP_TransportFactory_INCLUDED + + +#include "Poco/RemotingNG/HTTP/HTTP.h" +#include "Poco/RemotingNG/TransportFactory.h" + + +namespace Poco { +namespace RemotingNG { +namespace HTTP { + + +class RemotingNGHTTP_API TransportFactory: public Poco::RemotingNG::TransportFactory + /// The TransportFactory for RemotingNG HTTP Transport objects. +{ +public: + TransportFactory(); + /// Creates a TransportFactory. + + ~TransportFactory(); + /// Destroys the TransportFactory. + + Poco::RemotingNG::Transport* createTransport(); + + static void registerFactory(); + /// Helper function to register the factory with the manager. + + static void unregisterFactory(); + /// Helper function to unregister the factory with the manager. +}; + + +} } } // namespace Poco::RemotingNG::HTTP + + +#endif // RemotingNG_HTTP_TransportFactory_INCLUDED diff --git a/RemotingNG/HTTP/src/HTTPRequestHandler.cpp b/RemotingNG/HTTP/src/HTTPRequestHandler.cpp new file mode 100644 index 0000000000..5b21ad45ad --- /dev/null +++ b/RemotingNG/HTTP/src/HTTPRequestHandler.cpp @@ -0,0 +1,317 @@ +// +// HTTPRequestHandler.cpp +// +// Library: RemotingNG/HTTP +// Package: HTTP +// Module: HTTPRequestHandler +// +// Copyright (c) 2006-2017, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/HTTP/HTTPRequestHandler.h" +#include "Poco/RemotingNG/HTTP/Transport.h" +#include "Poco/RemotingNG/BinarySerializer.h" +#include "Poco/RemotingNG/BinaryDeserializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Net/HTTPServerResponse.h" +#include "Poco/Net/HTTPBasicCredentials.h" +#include "Poco/RemotingNG/ORB.h" +#include "Poco/RemotingNG/ServerTransport.h" +#include "Poco/RemotingNG/Context.h" +#include "Poco/StringTokenizer.h" +#include "Poco/StreamCopier.h" +#include "Poco/InflatingStream.h" +#include "Poco/DeflatingStream.h" +#include + + +using namespace std::string_literals; + + +namespace Poco { +namespace RemotingNG { +namespace HTTP { + + +class HTTPServerTransport: public Poco::RemotingNG::ServerTransport +{ +public: + HTTPServerTransport(Listener& listener, const Credentials& credentials): + _listener(listener), + _credentials(credentials) + { + } + + bool authenticate(const std::string& /*method*/) + { + Authenticator::Ptr pAuth = _listener.getAuthenticator(); + if (pAuth) + { + return pAuth->authenticate(_credentials).done(); + } + return false; + } + + bool authorize(const std::string& method, const std::string& permission) + { + Authorizer::Ptr pAuth = _listener.getAuthorizer(); + if (pAuth) + { + return pAuth->authorize(method, permission); + } + return false; + } + +private: + const Listener& _listener; + const Credentials& _credentials; +}; + + +class ChunkedServerTransport: public HTTPServerTransport +{ +public: + ChunkedServerTransport(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response, Listener& listener, const Poco::RemotingNG::Credentials& credentials): + HTTPServerTransport(listener, credentials), + _request(request), + _response(response), + _enableCompression(listener.isCompressionEnabled()), + _pInflater(0), + _pDeflater(0), + _replySent(false) + { + } + + ~ChunkedServerTransport() + { + delete _pInflater; + delete _pDeflater; + } + + Poco::RemotingNG::Deserializer& beginRequest() + { + if (_request.get("Content-Encoding"s, ""s) == "gzip") + { + _pInflater = new Poco::InflatingInputStream(_request.stream(), Poco::InflatingStreamBuf::STREAM_GZIP); + _deserializer.setup(*_pInflater); + } + else + { + _deserializer.setup(_request.stream()); + } + return _deserializer; + } + + Poco::RemotingNG::Serializer& sendReply(Poco::RemotingNG::SerializerBase::MessageType messageType) + { + // consume extra request content + std::istream& istr = _request.stream(); + int ch = istr.get(); + while (ch != -1) ch = istr.get(); + + _response.setChunkedTransferEncoding(true); + _response.setContentType(Transport::CONTENT_TYPE); + bool compressResponse(_enableCompression && _request.hasToken("Accept-Encoding"s, "gzip"s)); + if (compressResponse) + { + _response.set("Content-Encoding"s, "gzip"s); + _pDeflater = new Poco::DeflatingOutputStream(_response.send(), Poco::DeflatingStreamBuf::STREAM_GZIP, 1); + _serializer.setup(*_pDeflater); + } + else + { + _serializer.setup(_response.send()); + } + _replySent = true; + return _serializer; + } + + void endRequest() + { + if (!_replySent) // one-way message + { + _replySent = true; + _response.send(); + } + } + +private: + Poco::Net::HTTPServerRequest& _request; + Poco::Net::HTTPServerResponse& _response; + Poco::RemotingNG::BinarySerializer _serializer; + Poco::RemotingNG::BinaryDeserializer _deserializer; + bool _enableCompression; + Poco::InflatingInputStream* _pInflater; + Poco::DeflatingOutputStream* _pDeflater; + bool _replySent; +}; + + +class NonChunkedServerTransport: public HTTPServerTransport +{ +public: + NonChunkedServerTransport(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response, Listener& listener, const Poco::RemotingNG::Credentials& credentials): + HTTPServerTransport(listener, credentials), + _request(request), + _response(response), + _pInflater(0) + { + } + + ~NonChunkedServerTransport() + { + delete _pInflater; + } + + Poco::RemotingNG::Deserializer& beginRequest() + { + if (_request.get("Content-Encoding"s, ""s) == "gzip") + { + _pInflater = new Poco::InflatingInputStream(_request.stream(), Poco::InflatingStreamBuf::STREAM_GZIP); + _deserializer.setup(*_pInflater); + } + else + { + _deserializer.setup(_request.stream()); + } + return _deserializer; + } + + Poco::RemotingNG::Serializer& sendReply(Poco::RemotingNG::SerializerBase::MessageType messageType) + { + // consume extra request content + std::istream& istr = _request.stream(); + int ch = istr.get(); + while (ch != -1) ch = istr.get(); + + _response.setContentType(Transport::CONTENT_TYPE); + _serializer.setup(_bufferStream); + return _serializer; + } + + void endRequest() + { + _response.setContentLength(static_cast(_bufferStream.tellp())); + std::ostream& ostr = _response.send(); + Poco::StreamCopier::copyStream(_bufferStream, ostr); + } + +private: + Poco::Net::HTTPServerRequest& _request; + Poco::Net::HTTPServerResponse& _response; + Poco::RemotingNG::BinarySerializer _serializer; + Poco::RemotingNG::BinaryDeserializer _deserializer; + Poco::InflatingInputStream* _pInflater; + std::stringstream _bufferStream; +}; + + +HTTPRequestHandler::HTTPRequestHandler(Listener& listener): + _listener(listener), + _logger(Poco::Logger::get("RemotingNG.HTTP.HTTPRequestHandler"s)) +{ +} + + +HTTPRequestHandler::~HTTPRequestHandler() +{ +} + + +void HTTPRequestHandler::handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) +{ + if (_logger.debug()) + { + std::string message(request.getMethod()); + message += " "; + message += request.getURI(); + message += " "; + message += request.getVersion(); + message += " from "; + message += request.clientAddress().toString(); + _logger.debug(message); + } + + const std::string& method = request.getMethod(); + if (method == Poco::Net::HTTPRequest::HTTP_HEAD) + { + response.send(); + return; + } + else if (method != Poco::Net::HTTPRequest::HTTP_POST) + { + response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_METHOD_NOT_ALLOWED); + response.setContentLength(0); + response.send(); + return; + } + std::string ce = request.get("Content-Encoding"s, ""s); + if (!ce.empty() && ce != "gzip") + { + response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_UNSUPPORTEDMEDIATYPE); + response.setContentLength(0); + response.send(); + return; + } + + Poco::RemotingNG::Credentials credentials; + Poco::RemotingNG::ScopedContext scopedContext; + scopedContext.context()->setValue("transport"s, Transport::PROTOCOL); + scopedContext.context()->setValue("remoteAddress"s, request.clientAddress()); + scopedContext.context()->setValue("localAddress"s, request.serverAddress()); + scopedContext.context()->setValue("uri"s, request.getURI()); + scopedContext.context()->clearCredentials(); + if (request.hasCredentials()) + { + std::string scheme; + std::string authInfo; + request.getCredentials(scheme, authInfo); + if (scheme == Poco::Net::HTTPBasicCredentials::SCHEME) + { + Poco::Net::HTTPBasicCredentials creds(authInfo); + scopedContext.context()->setValue("username"s, creds.getUsername()); + scopedContext.context()->setValue("password"s, creds.getPassword()); + credentials.setAttribute(Credentials::ATTR_USERNAME, creds.getUsername()); + credentials.setAttribute(Credentials::ATTR_PASSWORD, creds.getPassword()); + scopedContext.context()->setCredentials(credentials); + } + } + scopedContext.context()->setValue("httpRequest"s, &request); + scopedContext.context()->setValue("httpResponse"s, &response); + + const std::string& uri = request.getURI(); + Poco::RemotingNG::ORB& orb = Poco::RemotingNG::ORB::instance(); + bool supportsChunked = (_listener.isChunkedTransferEncodingEnabled() && request.getVersion() != Poco::Net::HTTPServerRequest::HTTP_1_0); + if (supportsChunked) + { + ChunkedServerTransport transport(request, response, _listener, credentials); + bool serviceFound = orb.invoke(_listener, uri, transport); + if (!serviceFound) + { + RemotingException exc("Unknown service"); + transport.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT).serializeFaultMessage("", exc); + transport.endRequest(); + } + } + else + { + NonChunkedServerTransport transport(request, response, _listener, credentials); + bool serviceFound = orb.invoke(_listener, uri, transport); + if (!serviceFound) + { + RemotingException exc("Unknown service"); + transport.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT).serializeFaultMessage("", exc); + transport.endRequest(); + } + } +} + + +} } } // namespace Poco::RemotingNG::HTTP diff --git a/RemotingNG/HTTP/src/HTTPRequestHandlerFactory.cpp b/RemotingNG/HTTP/src/HTTPRequestHandlerFactory.cpp new file mode 100644 index 0000000000..288b84ec36 --- /dev/null +++ b/RemotingNG/HTTP/src/HTTPRequestHandlerFactory.cpp @@ -0,0 +1,44 @@ +// +// HTTPRequestHandlerFactory.cpp +// +// Library: RemotingNG/HTTP +// Package: HTTP +// Module: HTTPRequestHandlerFactory +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/HTTP/HTTPRequestHandlerFactory.h" +#include "Poco/RemotingNG/HTTP/HTTPRequestHandler.h" +#include "Poco/Net/HTTPServerRequest.h" + + +namespace Poco { +namespace RemotingNG { +namespace HTTP { + + +HTTPRequestHandlerFactory::HTTPRequestHandlerFactory(Listener& listener): + _listener(listener) +{ +} + + +HTTPRequestHandlerFactory::~HTTPRequestHandlerFactory() +{ +} + + +Poco::Net::HTTPRequestHandler* HTTPRequestHandlerFactory::createRequestHandler(const Poco::Net::HTTPServerRequest& request) +{ + return new HTTPRequestHandler(_listener); +} + + +} } } // namespace Poco::RemotingNG::HTTP diff --git a/RemotingNG/HTTP/src/Listener.cpp b/RemotingNG/HTTP/src/Listener.cpp new file mode 100644 index 0000000000..00a20504f4 --- /dev/null +++ b/RemotingNG/HTTP/src/Listener.cpp @@ -0,0 +1,125 @@ +// +// Listener.cpp +// +// Library: RemotingNG/HTTP +// Package: HTTP +// Module: Listener +// +// Copyright (c) 2006-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/HTTP/Listener.h" +#include "Poco/RemotingNG/HTTP/Transport.h" +#include "Poco/RemotingNG/HTTP/HTTPRequestHandlerFactory.h" +#include "Poco/Net/HTTPRequestHandlerFactory.h" +#include "Poco/Net/HTTPServerRequest.h" + + +namespace Poco { +namespace RemotingNG { +namespace HTTP { + + +Listener::Listener(const std::string& endPoint, Protocol proto): + Poco::RemotingNG::Listener(endPoint), + _secure(proto == PROTO_HTTPS), + _enableChunkedTransferEncoding(true), + _enableCompression(true) +{ +} + + +Listener::Listener(const std::string& endPoint, Poco::Net::HTTPServerParams::Ptr pParams): + Poco::RemotingNG::Listener(endPoint), + _secure(false), + _enableChunkedTransferEncoding(true), + _enableCompression(true) +{ + Poco::Net::SocketAddress addr(endPoint); + Poco::Net::ServerSocket socket(addr); + _pHTTPServer = new Poco::Net::HTTPServer(new HTTPRequestHandlerFactory(*this), socket, pParams); +} + + +Listener::Listener(const std::string& endPoint, const Poco::Net::ServerSocket& socket, Poco::Net::HTTPServerParams::Ptr pParams): + Poco::RemotingNG::Listener(endPoint), + _secure(socket.secure()), + _enableChunkedTransferEncoding(true), + _enableCompression(true) +{ + _pHTTPServer = new Poco::Net::HTTPServer(new HTTPRequestHandlerFactory(*this), socket, pParams); +} + + +Listener::~Listener() +{ +} + + +void Listener::enableChunkedTransferEncoding(bool enable) +{ + _enableChunkedTransferEncoding = enable; +} + + +void Listener::enableCompression(bool enable) +{ + _enableCompression = enable; +} + + +void Listener::start() +{ + if (_pHTTPServer) _pHTTPServer->start(); +} + + +void Listener::stop() +{ + if (_pHTTPServer) _pHTTPServer->stop(); +} + + +const std::string& Listener::protocol() const +{ + return Transport::PROTOCOL; +} + + +std::string Listener::createURI(const Poco::RemotingNG::Identifiable::TypeId& typeId, const Poco::RemotingNG::Identifiable::ObjectId& objectId) +{ + std::string uri(_secure ? "https://" : "http://"); + uri += endPoint(); + uri += '/'; + uri += protocol(); + uri += '/'; + uri += typeId; + uri += '/'; + uri += objectId; + return uri; +} + + +bool Listener::handlesURI(const std::string& /*uri*/) +{ + return false; +} + + +void Listener::registerObject(Poco::RemotingNG::RemoteObject::Ptr /*pRemoteObject*/, Poco::RemotingNG::Skeleton::Ptr /*pSkeleton*/) +{ +} + + +void Listener::unregisterObject(Poco::RemotingNG::RemoteObject::Ptr /*pRemoteObject*/) +{ +} + + +} } } // namespace Poco::RemotingNG::HTTP diff --git a/RemotingNG/HTTP/src/Transport.cpp b/RemotingNG/HTTP/src/Transport.cpp new file mode 100644 index 0000000000..d9b408f75a --- /dev/null +++ b/RemotingNG/HTTP/src/Transport.cpp @@ -0,0 +1,410 @@ +// +// Transport.cpp +// +// Library: RemotingNG/HTTP +// Package: HTTP +// Module: Transport +// +// Copyright (c) 2006-2017, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/HTTP/Transport.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/Net/HTTPRequest.h" +#include "Poco/Net/HTTPResponse.h" +#include "Poco/Net/HTTPSessionFactory.h" +#include "Poco/Net/HTTPBasicCredentials.h" +#include "Poco/NullStream.h" +#include "Poco/InflatingStream.h" +#include "Poco/DeflatingStream.h" +#include "Poco/StreamCopier.h" +#include "Poco/NumberFormatter.h" + + +using namespace std::string_literals; + + +namespace Poco { +namespace RemotingNG { +namespace HTTP { + + +const std::string Transport::PROTOCOL("http"); +const std::string Transport::USER_AGENT("User-Agent"); +const std::string Transport::CONTENT_TYPE("application/octet-stream"); + + +Poco::Net::HTTPSessionFactory Transport::_httpSessionFactory; + + +Transport::Transport(): + _keepAlive(false), + _chunkedTransferEncoding(true), + _compression(false), + _authMode(AUTH_NONE) +{ +} + + +Transport::~Transport() +{ +} + + +Poco::Timespan Transport::getTimeout() const +{ + return requireSession().getTimeout(); +} + + +void Transport::setTimeout(const Poco::Timespan& timeout) +{ + requireSession().setTimeout(timeout); +} + + +bool Transport::isKeepAliveEnabled() const +{ + return _keepAlive; +} + + +void Transport::enableKeepAlive(bool enable) +{ + requireSession().setKeepAlive(enable); + _keepAlive = enable; +} + + +Poco::Timespan Transport::getKeepAliveTimeout() const +{ + return requireSession().getKeepAliveTimeout(); +} + + +void Transport::setKeepAliveTimeout(const Poco::Timespan& timeout) +{ + requireSession().setKeepAliveTimeout(timeout); +} + + +bool Transport::isChunkedTransferEncodingEnabled() const +{ + return _chunkedTransferEncoding; +} + + +void Transport::enableChunkedTransferEncoding(bool enable) +{ + _chunkedTransferEncoding = enable; +} + + +bool Transport::isCompressionEnabled() const +{ + return _compression; +} + + +void Transport::enableCompression(bool enable) +{ + _compression = enable; +} + + +void Transport::setAuthentication(AuthMode mode) +{ + _authMode = mode; +} + + +Transport::AuthMode Transport::getAuthentication() const +{ + return _authMode; +} + + +void Transport::setCredentials(const Credentials& creds) +{ + _creds.setUsername(creds.getAttribute(Credentials::ATTR_USERNAME)); + _creds.setPassword(creds.getAttribute(Credentials::ATTR_PASSWORD)); +} + + +Credentials Transport::getCredentials() const +{ + Credentials creds; + creds.setAttribute(Credentials::ATTR_USERNAME, _creds.getUsername()); + creds.setAttribute(Credentials::ATTR_PASSWORD, _creds.getPassword()); + return creds; +} + + +const std::string& Transport::getUserAgent() const +{ + return _userAgent; +} + + +void Transport::setUserAgent(const std::string& userAgent) +{ + _userAgent = userAgent; +} + + +void Transport::setCustomHeader(const std::string& name, const std::string& value) +{ + _customHeaders[name] = value; +} + + +void Transport::removeCustomHeader(const std::string& name) +{ + _customHeaders.erase(name); +} + + +bool Transport::hasCustomHeader(const std::string& name) const +{ + return _customHeaders.find(name) != _customHeaders.end(); +} + + +const std::string& Transport::getCustomHeader(const std::string& name) const +{ + const auto it = _customHeaders.find(name); + if (it != _customHeaders.end()) + return it->second; + else + throw Poco::NotFoundException(name); +} + + +void Transport::setProxyConfig(const Poco::Net::ProxyConfig& proxyConfig) +{ + _proxyConfig = proxyConfig; +} + + +const Poco::Net::ProxyConfig& Transport::getProxyConfig() const +{ + return _proxyConfig; +} + + +const std::string& Transport::endPoint() const +{ + return _endPoint; +} + + +void Transport::connect(const std::string& endPoint) +{ + _endPoint = endPoint; + _endPointURI = endPoint; + _pSession = _httpSessionFactory.createClientSession(_endPointURI); + _pSession->setKeepAlive(_keepAlive); + if (!_proxyConfig.host.empty()) + { + _pSession->setProxyConfig(_proxyConfig); + } +} + + +void Transport::disconnect() +{ + _pSession = 0; + _endPoint.clear(); + _endPointURI.clear(); +} + + +bool Transport::connected() const +{ + return !_pSession.isNull(); +} + + +Poco::RemotingNG::Serializer& Transport::beginMessage(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType) +{ + return beginRequest(oid, tid, messageName, messageType); +} + + +void Transport::sendMessage(const Poco::RemotingNG::Identifiable::ObjectId& /*oid*/, const Poco::RemotingNG::Identifiable::TypeId& /*tid*/, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType /*messageType*/) +{ + if (_pDeflater) + { + _pDeflater->close(); + _pDeflater = 0; + } + if (!_chunkedTransferEncoding) + { + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, _endPointURI.getPathEtc(), Poco::Net::HTTPMessage::HTTP_1_1); + prepareRequest(request); + request.setContentLength(static_cast(_pStream->tellp())); + std::ostream& ostr = _pSession->sendRequest(request); + Poco::StreamCopier::copyStream(*_pStream, ostr); + } + + Poco::Net::HTTPResponse response; + std::istream& istr = _pSession->receiveResponse(response); + Poco::NullOutputStream ostr; + Poco::StreamCopier::copyStream(istr, ostr); +} + + +Poco::RemotingNG::Serializer& Transport::beginRequest(const Poco::RemotingNG::Identifiable::ObjectId& /*oid*/, const Poco::RemotingNG::Identifiable::TypeId& /*tid*/, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType) +{ + if (messageType == Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST) + { + if (_chunkedTransferEncoding) + { + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, _endPointURI.getPathEtc(), Poco::Net::HTTPMessage::HTTP_1_1); + prepareRequest(request); + std::ostream& ostr = _pSession->sendRequest(request); + if (_compression) + { + _pDeflater = new Poco::DeflatingOutputStream(ostr, Poco::DeflatingStreamBuf::STREAM_GZIP, 1); + _serializer.setup(*_pDeflater); + } + else + { + _serializer.setup(ostr); + } + } + else + { + _pStream = new std::stringstream; + _serializer.setup(*_pStream); + } + return _serializer; + } + else + { + poco_bugcheck(); + throw Poco::BugcheckException(); + } +} + + +Poco::RemotingNG::Deserializer& Transport::sendRequest(const Poco::RemotingNG::Identifiable::ObjectId& /*oid*/, const Poco::RemotingNG::Identifiable::TypeId& /*tid*/, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType /*messageType*/) +{ + if (_pDeflater) + { + _pDeflater->close(); + _pDeflater = 0; + } + Poco::Net::HTTPResponse response; + std::istream* pResponseStream; + + if (!_chunkedTransferEncoding) + { + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, _endPointURI.getPathEtc(), Poco::Net::HTTPMessage::HTTP_1_1); + prepareRequest(request); + request.setContentLength(static_cast(_pStream->tellp())); + std::ostream& requestStream = _pSession->sendRequest(request); + Poco::StreamCopier::copyStream(*_pStream, requestStream); + pResponseStream = &_pSession->receiveResponse(response); + + if (response.getStatus() == Poco::Net::HTTPResponse::HTTP_UNAUTHORIZED && (_authMode == AUTH_DIGEST || _authMode == AUTH_ANY)) + { + Poco::NullOutputStream nullStream; + Poco::StreamCopier::copyStream(*pResponseStream, nullStream); + + _creds.authenticate(request, response); + std::ostream& requestStream = _pSession->sendRequest(request); + _pStream->clear(); + _pStream->seekg(0); + Poco::StreamCopier::copyStream(*_pStream, requestStream); + pResponseStream = &_pSession->receiveResponse(response); + } + } + else + { + pResponseStream = &_pSession->receiveResponse(response); + } + + if (response.getStatus() == Poco::Net::HTTPResponse::HTTP_OK) + { + if (response.get("Content-Encoding"s, ""s) == "gzip") + { + _pInflater = new Poco::InflatingInputStream(*pResponseStream, Poco::InflatingStreamBuf::STREAM_GZIP); + _deserializer.setup(*_pInflater); + } + else + { + _deserializer.setup(*pResponseStream); + } + + return _deserializer; + } + else + { + Poco::NullOutputStream nullStream; + Poco::StreamCopier::copyStream(*pResponseStream, nullStream); + throw Poco::RemotingNG::TransportException("HTTP Error", response.getReason()); + } +} + + +void Transport::endRequest() +{ + _serializer.reset(); + _deserializer.reset(); + _pStream = 0; + _pDeflater = 0; + _pInflater = 0; +} + + +const Poco::Net::HTTPClientSession& Transport::requireSession() const +{ + if (_pSession) + return *_pSession; + else + throw Poco::IllegalStateException("Transport not connected"); +} + + +Poco::Net::HTTPClientSession& Transport::requireSession() +{ + if (_pSession) + return *_pSession; + else + throw Poco::IllegalStateException("Transport not connected"); +} + + +void Transport::prepareRequest(Poco::Net::HTTPRequest& request) +{ + request.setContentType(CONTENT_TYPE); + request.setChunkedTransferEncoding(_chunkedTransferEncoding); + request.set("Accept-Encoding"s, "gzip"s); + if (_compression && _chunkedTransferEncoding) + { + request.set("Content-Encoding"s, "gzip"s); + } + if (_authMode == AUTH_BASIC) + { + Poco::Net::HTTPBasicCredentials creds(_creds.getUsername(), _creds.getPassword()); + creds.authenticate(request); + } + if (!_userAgent.empty()) + { + request.set(USER_AGENT, _userAgent); + } + for (const auto& p: _customHeaders) + { + request.set(p.first, p.second); + } +} + + +} } } // namespace Poco::RemotingNG::HTTP diff --git a/RemotingNG/HTTP/src/TransportFactory.cpp b/RemotingNG/HTTP/src/TransportFactory.cpp new file mode 100644 index 0000000000..88fb098f4f --- /dev/null +++ b/RemotingNG/HTTP/src/TransportFactory.cpp @@ -0,0 +1,58 @@ +// +// TransportFactory.cpp +// +// Library: RemotingNG/HTTP +// Package: HTTP +// Module: TransportFactory +// +// Copyright (c) 2006-2017, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/HTTP/TransportFactory.h" +#include "Poco/RemotingNG/HTTP/Transport.h" +#include "Poco/RemotingNG/TransportFactoryManager.h" +#include "Poco/Net/HTTPSessionInstantiator.h" + + +namespace Poco { +namespace RemotingNG { +namespace HTTP { + + +TransportFactory::TransportFactory() +{ +} + + +TransportFactory::~TransportFactory() +{ +} + + +Poco::RemotingNG::Transport* TransportFactory::createTransport() +{ + return new Transport; +} + + +void TransportFactory::registerFactory() +{ + Transport::httpSessionFactory().registerProtocol("http", new Poco::Net::HTTPSessionInstantiator); + Poco::RemotingNG::TransportFactoryManager::instance().registerFactory(Transport::PROTOCOL, new TransportFactory); +} + + +void TransportFactory::unregisterFactory() +{ + Poco::RemotingNG::TransportFactoryManager::instance().unregisterFactory(Transport::PROTOCOL); + Transport::httpSessionFactory().unregisterProtocol("http"); +} + + +} } } // namespace Poco::RemotingNG::HTTP diff --git a/RemotingNG/HTTP/testsuite/CMakeLists.txt b/RemotingNG/HTTP/testsuite/CMakeLists.txt new file mode 100644 index 0000000000..a606cc3f26 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/CMakeLists.txt @@ -0,0 +1,32 @@ +# Sources +file(GLOB SRCS_G "src/*.cpp") +POCO_SOURCES_AUTO(TEST_SRCS ${SRCS_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "src/*.h") +POCO_HEADERS_AUTO(TEST_SRCS ${HDRS_G}) + +POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF + src/WinDriver.cpp +) + +add_executable(RemotingNGHTTP-testrunner ${TEST_SRCS}) +if(ANDROID) + add_test( + NAME RemotingNGHTTP + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/RemotingNGHTTP-testrunner -DTEST_PARAMETER=-all -P ${PROJECT_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake + ) +else() + add_test( + NAME RemotingNGHTTP + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND RemotingNGHTTP-testrunner -ignore ${PROJECT_SOURCE_DIR}/cppignore.lnx -all + ) + set_tests_properties(RemotingNGHTTP PROPERTIES ENVIRONMENT POCO_BASE=${PROJECT_SOURCE_DIR}) +endif() + +target_link_libraries(RemotingNGHTTP-testrunner PUBLIC Poco::RemotingNGHTTP Poco::RemotingNG Poco::Net CppUnit) +target_include_directories(RemotingNGHTTP-testrunner + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include +) diff --git a/RemotingNG/HTTP/testsuite/Makefile b/RemotingNG/HTTP/testsuite/Makefile new file mode 100644 index 0000000000..d15944287b --- /dev/null +++ b/RemotingNG/HTTP/testsuite/Makefile @@ -0,0 +1,26 @@ +# +# Makefile +# +# Makefile for Poco RemotingNG HTTP Transport testsuite +# + +include $(POCO_BASE)/build/rules/global + +objects = \ + Driver \ + RemotingTest \ + HTTPTestSuite \ + Tester \ + ITester \ + TesterClientHelper \ + TesterProxy \ + TesterProxyFactory \ + TesterRemoteObject \ + TesterServerHelper \ + TesterSkeleton + +target = testrunner +target_version = 1 +target_libs = PocoRemotingNGHTTP PocoRemotingNG PocoNet PocoFoundation CppUnit + +include $(POCO_BASE)/build/rules/exec diff --git a/RemotingNG/HTTP/testsuite/RemoteGen.xml b/RemotingNG/HTTP/testsuite/RemoteGen.xml new file mode 100644 index 0000000000..d72796584e --- /dev/null +++ b/RemotingNG/HTTP/testsuite/RemoteGen.xml @@ -0,0 +1,18 @@ + + + + + ../../../Foundation/include/Poco/Timestamp.h + src/Tester.h + + + + src + src + src + false + both + false + + + diff --git a/RemotingNG/HTTP/testsuite/src/Class1Deserializer.h b/RemotingNG/HTTP/testsuite/src/Class1Deserializer.h new file mode 100644 index 0000000000..1fa34f1dbd --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Class1Deserializer.h @@ -0,0 +1,66 @@ +// +// Class1Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Class1_INCLUDED +#define TypeDeserializer_Class1_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Class1& value) + { + using namespace std::string_literals; + + bool ret = deser.deserializeStructBegin(name, isMandatory); + if (ret) + { + deserializeImpl(deser, value); + deser.deserializeStructEnd(name); + } + return ret; + } + + static void deserializeImpl(Deserializer& deser, Class1& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"anEnum"s,"anInt"s,"aString"s}; + bool ret = false; + int gen_anEnum; + ret = TypeDeserializer::deserialize(REMOTING__NAMES[0], true, deser, gen_anEnum); + if (ret) value.setAnEnum(static_cast(gen_anEnum)); + int gen_anInt; + ret = TypeDeserializer::deserialize(REMOTING__NAMES[1], true, deser, gen_anInt); + if (ret) value.setAnInt(gen_anInt); + std::string gen_aString; + ret = TypeDeserializer::deserialize(REMOTING__NAMES[2], true, deser, gen_aString); + if (ret) value.setAString(gen_aString); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Class1_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Class1Serializer.h b/RemotingNG/HTTP/testsuite/src/Class1Serializer.h new file mode 100644 index 0000000000..31094a9e94 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Class1Serializer.h @@ -0,0 +1,55 @@ +// +// Class1Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Class1_INCLUDED +#define TypeSerializer_Class1_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Class1& value, Serializer& ser) + { + using namespace std::string_literals; + + ser.serializeStructBegin(name); + serializeImpl(value, ser); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Class1& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"anEnum"s,"anInt"s,"aString"s,""s}; + TypeSerializer::serialize(REMOTING__NAMES[0], static_cast(value.getAnEnum()), ser); + TypeSerializer::serialize(REMOTING__NAMES[1], value.getAnInt(), ser); + TypeSerializer::serialize(REMOTING__NAMES[2], value.getAString(), ser); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Class1_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Driver.cpp b/RemotingNG/HTTP/testsuite/src/Driver.cpp new file mode 100644 index 0000000000..ba17eb0d62 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Driver.cpp @@ -0,0 +1,19 @@ +// +// Driver.cpp +// +// Console-based test driver for Poco RemotingNG HTTP. +// +// Copyright (c) 2006-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "CppUnit/TestRunner.h" +#include "HTTPTestSuite.h" + + +CppUnitMain(HTTPTestSuite) diff --git a/RemotingNG/HTTP/testsuite/src/HTTPTestSuite.cpp b/RemotingNG/HTTP/testsuite/src/HTTPTestSuite.cpp new file mode 100644 index 0000000000..1ef088dbf7 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/HTTPTestSuite.cpp @@ -0,0 +1,28 @@ +// +// HTTPTestSuite.cpp +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "HTTPTestSuite.h" +#include "RemotingTest.h" + + +CppUnit::Test* HTTPTestSuite::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HTTPTestSuite"); + + pSuite->addTest(RemotingTestHTTP::suite()); + pSuite->addTest(RemotingTestHTTPCompressed::suite()); + pSuite->addTest(RemotingTestHTTPNonChunked::suite()); + pSuite->addTest(RemotingTestHTTPAuth::suite()); + pSuite->addTest(RemotingTestHTTPAuthChunked::suite()); + + return pSuite; +} diff --git a/RemotingNG/HTTP/testsuite/src/HTTPTestSuite.h b/RemotingNG/HTTP/testsuite/src/HTTPTestSuite.h new file mode 100644 index 0000000000..777688547e --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/HTTPTestSuite.h @@ -0,0 +1,29 @@ +// +// HTTPTestSuite.h +// +// Definition of the HTTPTestSuite class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef HTTPTestSuite_INCLUDED +#define HTTPTestSuite_INCLUDED + + +#include "CppUnit/TestSuite.h" + + +class HTTPTestSuite +{ +public: + static CppUnit::Test* suite(); +}; + + +#endif // HTTPTestSuite_INCLUDED diff --git a/RemotingNG/HTTP/testsuite/src/ITester.cpp b/RemotingNG/HTTP/testsuite/src/ITester.cpp new file mode 100644 index 0000000000..6588bc9828 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/ITester.cpp @@ -0,0 +1,33 @@ +// +// ITester.cpp +// +// Package: Generated +// Module: ITester +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "ITester.h" + + +ITester::ITester(): + Poco::RefCountedObject() + +{ +} + + +ITester::~ITester() +{ +} + + +const Poco::RemotingNG::Identifiable::TypeId& ITester::remoting__typeId() +{ + static const std::string REMOTING__TYPE_ID("Tester"); + return REMOTING__TYPE_ID; +} + + diff --git a/RemotingNG/HTTP/testsuite/src/ITester.h b/RemotingNG/HTTP/testsuite/src/ITester.h new file mode 100644 index 0000000000..5c2c26d307 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/ITester.h @@ -0,0 +1,126 @@ +// +// ITester.h +// +// Package: Generated +// Module: ITester +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef ITester_INCLUDED +#define ITester_INCLUDED + + +#include "Poco/AutoPtr.h" +#include "Poco/RefCountedObject.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Tester.h" + + +class ITester: public virtual Poco::RefCountedObject +{ +public: + using Ptr = Poco::AutoPtr; + + ITester(); + /// Creates a ITester. + + virtual ~ITester(); + /// Destroys the ITester. + + static const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId(); + /// Returns the TypeId of the class. + + virtual void setCookie() = 0; + + virtual void testAuthenticated() = 0; + + virtual Class1 testClass11(const Class1& c1) = 0; + + virtual void testClass12(Class1& c1) = 0; + + virtual void testClass13(const Class1& c1, Class1& c2) = 0; + + virtual Enum1 testEnum11(Enum1 e1) = 0; + + virtual void testEnum12(Enum1& e1) = 0; + + virtual void testEnum13(Enum1 e1, Enum1& e2) = 0; + + virtual Struct1::Enum2 testEnum21(Struct1::Enum2 e1) = 0; + + virtual void testEnum22(Struct1::Enum2& e1) = 0; + + virtual void testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2) = 0; + + virtual void testFault() = 0; + + virtual int testInt1(int i) = 0; + + virtual void testInt2(int& i) = 0; + + virtual void testInt3(int i1, int& i2) = 0; + + virtual Poco::Int64 testNestedType(Poco::Int64 arg) = 0; + + virtual void testOneWay(const std::string& arg) = 0; + + virtual std::string testOneWayResult() = 0; + + virtual void testPermission() = 0; + + virtual Poco::SharedPtr testPtr(Poco::SharedPtr p1) = 0; + + virtual Struct1 testStruct11(const Struct1& s1) = 0; + + virtual void testStruct12(Struct1& s1) = 0; + + virtual void testStruct13(const Struct1& s1, Struct1& s2) = 0; + + virtual std::vector testStruct1Vec1(const std::vector& vec) = 0; + + virtual void testStruct1Vec2(std::vector& vec) = 0; + + virtual void testStruct1Vec3(const std::vector& vec1, std::vector& vec2) = 0; + + virtual Struct2 testStruct21(const Struct2& s1) = 0; + + virtual void testStruct22(Struct2& s1) = 0; + + virtual void testStruct23(const Struct2& s1, Struct2& s2) = 0; + + virtual Struct3 testStruct31(const Struct3& s1) = 0; + + virtual void testStruct32(Struct3& s1) = 0; + + virtual void testStruct33(const Struct3& s1, Struct3& s2) = 0; + + virtual Struct4 testStruct41(const Struct4& s1) = 0; + + virtual void testStruct42(Struct4& s1) = 0; + + virtual void testStruct43(const Struct4& s1, Struct4& s2) = 0; + + virtual Struct5 testStruct51(const Struct5& s1) = 0; + + virtual void testStruct52(Struct5& s1) = 0; + + virtual void testStruct53(const Struct5& s1, Struct5& s2) = 0; + + virtual void testSynchronized() = 0; + + virtual void testSynchronizedProxy() = 0; + + virtual void testSynchronizedRemote() = 0; + + virtual bool verifyCookie() = 0; + +}; + + + + +#endif // ITester_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/RemotingTest.cpp b/RemotingNG/HTTP/testsuite/src/RemotingTest.cpp new file mode 100644 index 0000000000..247b400c3e --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/RemotingTest.cpp @@ -0,0 +1,1068 @@ +// +// RemotingTest.cpp +// +// Copyright (c) 2006-2012, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "RemotingTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/Transport.h" +#include "Poco/RemotingNG/TransportFactory.h" +#include "Poco/RemotingNG/TransportFactoryManager.h" +#include "Poco/RemotingNG/Skeleton.h" +#include "Poco/RemotingNG/ORB.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/RemotingNG/Credentials.h" +#include "Poco/RemotingNG/Context.h" +#include "Poco/RemotingNG/HTTP/Transport.h" +#include "Poco/RemotingNG/HTTP/TransportFactory.h" +#include "Poco/RemotingNG/HTTP/Listener.h" +#include "Poco/RemotingNG/HTTP/HTTPRequestHandler.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Net/HTTPServerResponse.h" +#include "Poco/Net/HTTPRequestHandlerFactory.h" +#include "Poco/Net/HTTPBasicCredentials.h" +#include "Poco/NumberFormatter.h" +#include "Poco/DateTimeFormatter.h" +#include "Poco/NullStream.h" +#include "Poco/StreamCopier.h" +#include "Tester.h" +#include "TesterServerHelper.h" +#include "TesterClientHelper.h" +#include "TesterRemoteObject.h" +#include "TesterProxy.h" +#include + + +namespace +{ + class NoAuthRequestHandler: public Poco::Net::HTTPRequestHandler + { + public: + void handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) + { + Poco::NullOutputStream nullStream; + Poco::StreamCopier::copyStream(request.stream(), nullStream); + response.requireAuthentication("RemotingNG"); + response.setContentLength(0); + response.send(); + } + }; + + + class HTTPAuthRequestHandlerFactory: public Poco::Net::HTTPRequestHandlerFactory + { + public: + HTTPAuthRequestHandlerFactory(Poco::RemotingNG::HTTP::Listener& listener): + _listener(listener) + { + } + + Poco::Net::HTTPRequestHandler* createRequestHandler(const Poco::Net::HTTPServerRequest& request) + { + if (request.hasCredentials()) + { + Poco::Net::HTTPBasicCredentials creds(request); + if (creds.getUsername() == "user" && creds.getPassword() == "s3cr3t") + { + return new Poco::RemotingNG::HTTP::HTTPRequestHandler(_listener); + } + } + return new NoAuthRequestHandler; + } + + private: + Poco::RemotingNG::HTTP::Listener& _listener; + }; + + + class MockAuthenticator: public Poco::RemotingNG::Authenticator + { + public: + typedef Poco::AutoPtr Ptr; + + Poco::RemotingNG::AuthenticateResult authenticate(const Poco::RemotingNG::Credentials& creds, Poco::UInt32) + { + std::string username = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, ""); + std::string password = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, ""); + + _lastUsername = username; + + if ((username == "user" && password == "pass") || (username == "admin" && password == "s3cr3t")) + return Poco::RemotingNG::AuthenticateResult(Poco::RemotingNG::AuthenticateResult::AUTH_DONE, creds); + else + return Poco::RemotingNG::AuthenticateResult(Poco::RemotingNG::AuthenticateResult::AUTH_FAILED); + } + + const std::string& lastUsername() const + { + return _lastUsername; + } + + private: + std::string _lastUsername; + }; + + + class MockAuthorizer: public Poco::RemotingNG::Authorizer + { + public: + bool authorize(const std::string& method, const std::string& permission) + { + Poco::RemotingNG::Context::Ptr pContext = Poco::RemotingNG::Context::get(); + + const Poco::RemotingNG::Credentials& creds = pContext->getCredentials(); + + std::string username = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, ""); + std::string password = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, ""); + + return username == "admin"; + } + }; +} + + +bool operator == (const Struct1& s1, const Struct1& s2) +{ + return s1.aString == s2.aString + && s1.anInt == s2.anInt + && s1.aDouble == s2.aDouble + && s1.anEnum == s2.anEnum + && s1.anEnum2 == s2.anEnum2; +} + + +bool operator == (const Struct1::Ptr s1, const Struct1::Ptr s2) +{ + return *s1 == *s2; +} + + +bool operator == (const Struct2& s1, const Struct2& s2) +{ + bool equal = s1.anURI == s2.anURI + && s1.aDateTime == s2.aDateTime + && s1.aLocalDateTime == s2.aLocalDateTime + && s1.aTimestamp == s2.aTimestamp + && s1.anUUID == s2.anUUID; + + if (!equal) return false; + if (s1.aVector.size() != s2.aVector.size()) return false; + for (int i = 0; i < s1.aVector.size(); i++) + { + if (!(s1.aVector[i] == s2.aVector[i])) return false; + } + if (s1.anotherVector.size() != s2.anotherVector.size()) return false; + for (int i = 0; i < s1.anotherVector.size(); i++) + { + if (!s1.anotherVector[i].isNull() && !s2.anotherVector[i].isNull()) + { + if (!(*s1.anotherVector[i] == *s2.anotherVector[i])) return false; + } + } + return true; +} + + +bool operator == (const Struct3& s1, const Struct3& s2) +{ + bool equal = s1.aCharVector == s2.aCharVector + && s1.aSet == s2.aSet + && s1.aMultiSet == s2.aMultiSet; + if (!equal) return false; + if (s1.aComplexVector.size() != s2.aComplexVector.size()) return false; + for (int i = 0; i < s1.aComplexVector.size(); i++) + { + if (!(s1.aComplexVector[i] == s2.aComplexVector[i])) return false; + } + return true; +} + + +bool operator == (const Struct4& s1, const Struct4& s2) +{ + bool equal = s1.value == s2.value; + if (!equal) return false; + if (s1.vec.size() != s2.vec.size()) return false; + for (int i = 0; i < s1.vec.size(); i++) + { + if (!(s1.vec[i] == s2.vec[i])) return false; + } + if (s1.ptr.isNull() != s2.ptr.isNull()) return false; + if (s1.ptr && s2.ptr && !(*s1.ptr == *s2.ptr)) return false; + return true; +} + + +RemotingTest::RemotingTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +RemotingTest::~RemotingTest() +{ +} + + +void RemotingTest::setUp() +{ + _pListener = new Poco::RemotingNG::HTTP::Listener("127.0.0.1:2280"); + _listener = Poco::RemotingNG::ORB::instance().registerListener(_pListener); + Poco::RemotingNG::HTTP::TransportFactory::registerFactory(); + _objectURI = TesterServerHelper::registerObject(new Tester, "TheTester", _listener); +} + + +void RemotingTest::tearDown() +{ + TesterServerHelper::unregisterObject(_objectURI); + Poco::RemotingNG::HTTP::TransportFactory::unregisterFactory(); + Poco::RemotingNG::ORB::instance().unregisterListener(_listener); + _pListener = 0; +} + + +void RemotingTest::testRegistration() +{ + assert (_objectURI == "http://127.0.0.1:2280/http/Tester/TheTester"); +} + + +void RemotingTest::testInt() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testInt(pTester); +} + + +void RemotingTest::testEnum1() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testEnum1(pTester); +} + + +void RemotingTest::testEnum2() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testEnum2(pTester); +} + + +void RemotingTest::testNested() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testNested(pTester); +} + + +void RemotingTest::testStruct1() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct1(pTester); +} + + +void RemotingTest::testStruct2() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct2(pTester); +} + + +void RemotingTest::testStruct3() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct3(pTester); +} + + +void RemotingTest::testStruct4() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct4(pTester); +} + + +void RemotingTest::testStruct5() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct4(pTester); +} + + +void RemotingTest::testClass1() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testClass1(pTester); +} + + +void RemotingTest::testPtr() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testPtr(pTester); +} + + +void RemotingTest::testStruct1Vec() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct1Vec(pTester); +} + + +void RemotingTest::testOneWay() +{ + ITester::Ptr pTester = createProxy(_objectURI); + pTester->testOneWay("s3cr3t"); + + std::string result = pTester->testOneWayResult(); + assert (result == "s3cr3t"); +} + + +void RemotingTest::testFault() +{ + ITester::Ptr pTester = createProxy(_objectURI); + try + { + pTester->testFault(); + fail("must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "Application exception: Something went wrong"); + } +} + + +void RemotingTest::testAuthenticatedGoodCredentials() +{ + ITester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::HTTP::Transport& trans = static_cast(pProxy->remoting__transport()); + + Poco::RemotingNG::Credentials creds; + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, "user"); + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, "pass"); + trans.setCredentials(creds); + trans.setAuthentication(Poco::RemotingNG::HTTP::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + + pTester->testAuthenticated(); +} + + +void RemotingTest::testAuthenticatedBadCredentials() +{ + ITester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::HTTP::Transport& trans = static_cast(pProxy->remoting__transport()); + + Poco::RemotingNG::Credentials creds; + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, "user"); + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, "bad!"); + trans.setCredentials(creds); + trans.setAuthentication(Poco::RemotingNG::HTTP::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + + try + { + pTester->testAuthenticated(); + fail("bad credentials - must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "Authentication failed"); + } +} + + +void RemotingTest::testAuthenticatedNoCredentials() +{ + ITester::Ptr pTester = createProxy(_objectURI); + + _pListener->setAuthenticator(new MockAuthenticator); + + try + { + pTester->testAuthenticated(); + fail("no credentials - must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "Authentication failed"); + } +} + + +void RemotingTest::testPermission() +{ + ITester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::HTTP::Transport& trans = static_cast(pProxy->remoting__transport()); + + Poco::RemotingNG::Credentials creds; + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, "admin"); + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, "s3cr3t"); + trans.setCredentials(creds); + trans.setAuthentication(Poco::RemotingNG::HTTP::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + _pListener->setAuthorizer(new MockAuthorizer); + + pTester->testPermission(); +} + + +void RemotingTest::testNoPermission() +{ + ITester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::HTTP::Transport& trans = static_cast(pProxy->remoting__transport()); + + Poco::RemotingNG::Credentials creds; + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, "user"); + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, "pass"); + trans.setCredentials(creds); + trans.setAuthentication(Poco::RemotingNG::HTTP::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + _pListener->setAuthorizer(new MockAuthorizer); + + try + { + pTester->testPermission(); + fail("no permission - must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "No permission: perm1"); + } +} + + +void RemotingTest::testInt(ITester::Ptr pTester) +{ + int i = pTester->testInt1(42); + assert (i == 42); + + pTester->testInt2(i); + assert (i == 2112); + + int i2(0); + pTester->testInt3(55, i2); + assert (i2 == 55); +} + + +void RemotingTest::testEnum1(ITester::Ptr pTester) +{ + Enum1 e = pTester->testEnum11(VALUE_1); + assert (e == VALUE_1); + + pTester->testEnum12(e); + assert (e == VALUE_2); + + pTester->testEnum13(VALUE_3, e); + assert (e == VALUE_3); +} + + +void RemotingTest::testEnum2(ITester::Ptr pTester) +{ + Struct1::Enum2 e = pTester->testEnum21(Struct1::VALUE_1); + assert (e == Struct1::VALUE_1); + + pTester->testEnum22(e); + assert (e == Struct1::VALUE_2); + + pTester->testEnum23(Struct1::VALUE_3, e); + assert (e == Struct1::VALUE_3); +} + + +void RemotingTest::testNested(ITester::Ptr pTester) +{ + Poco::Timestamp::TimeVal tv1 = 12345678; + Poco::Timestamp::TimeVal tv2 = pTester->testNestedType(tv1); + assert (tv1 == tv2); +} + + +void RemotingTest::testStruct1(ITester::Ptr pTester) +{ + Struct1 s1; + s1.aString = "foobar"; + s1.anInt = 2112; + s1.aDouble = 0.5; + s1.anEnum = VALUE_1; + s1.anEnum2 = Struct1::VALUE_2; + + Struct1 s2 = pTester->testStruct11(s1); + assert (s2 == s1); + + pTester->testStruct12(s2); + assert (s2 == s1); + + Struct1 s3; + pTester->testStruct13(s1, s3); + assert (s3 == s1); +} + + +void RemotingTest::testStruct2(ITester::Ptr pTester) +{ + Struct2 s21; + for (int i = 0; i < 10; i++) + { + Struct1 s1; + s1.aString = "foobar" + Poco::NumberFormatter::format(i); + s1.anInt = i; + s1.aDouble = i + 0.5; + s1.anEnum = VALUE_1; + s1.anEnum2 = Struct1::VALUE_2; + s21.aVector.push_back(s1); + } + + for (int i = 0; i < 9; i++) + { + Struct1::Ptr p1 = new Struct1; + p1->aString = "foobar" + Poco::NumberFormatter::format(i); + p1->anInt = i; + p1->aDouble = i + 0.5; + p1->anEnum = VALUE_1; + p1->anEnum2 = Struct1::VALUE_2; + s21.anotherVector.push_back(p1); + } + + s21.anotherVector.push_back(Struct1::Ptr()); + s21.anURI = "http://www.appinf.com"; + s21.anUUID.parse("01234567-ABCD-EF00-1234-0123456789AB"); + s21.aDateTime.assign(2009, 11, 9, 13, 23, 23, 200); + s21.aLocalDateTime.assign(7200, 2009, 11, 9, 13, 23, 23, 200, 0); + s21.aTimestamp = s21.aDateTime.timestamp(); + + Struct2 s22 = pTester->testStruct21(s21); + assert (s22 == s21); + + pTester->testStruct22(s22); + assert (s22 == s21); + + Struct2 s23; + assert (!(s23 == s21)); + pTester->testStruct23(s21, s23); + assert (s23 == s21); +} + + +void RemotingTest::testStruct3(ITester::Ptr pTester) +{ + Struct3 s31; + Struct2 s21; + for (int i = 0; i < 10; i++) + { + Struct1 s1; + s1.aString = "foobar" + Poco::NumberFormatter::format(i); + s1.anInt = i; + s1.aDouble = i + 0.5; + s1.anEnum = VALUE_1; + s1.anEnum2 = Struct1::VALUE_2; + s21.aVector.push_back(s1); + } + + for (int i = 0; i < 9; i++) + { + Struct1::Ptr p1 = new Struct1; + p1->aString = "foobar" + Poco::NumberFormatter::format(i); + p1->anInt = i; + p1->aDouble = i + 0.5; + p1->anEnum = VALUE_1; + p1->anEnum2 = Struct1::VALUE_2; + s21.anotherVector.push_back(p1); + } + + s21.anotherVector.push_back(Struct1::Ptr()); + s21.anURI = "http://www.appinf.com"; + s21.anUUID.parse("01234567-ABCD-EF00-1234-0123456789AB"); + s21.aDateTime.assign(2009, 11, 9, 13, 23, 23, 200); + s21.aLocalDateTime.assign(7200, 2009, 11, 9, 13, 23, 23, 200, 0); + s21.aTimestamp = s21.aDateTime.timestamp(); + + for (int i = 0; i < 10; i++) + { + for (char c = 'A'; c <= 'Z'; c++) + s31.aCharVector.push_back(c); + } + s31.aComplexVector.push_back(s21); + s31.aComplexVector.push_back(s21); + s31.aSet.insert(1); + s31.aSet.insert(2); + s31.aSet.insert(3); + s31.aMultiSet.insert(1); + s31.aMultiSet.insert(2); + s31.aMultiSet.insert(3); + + Struct3 s32 = pTester->testStruct31(s31); + assert (s32 == s31); + + pTester->testStruct32(s32); + assert (s32 == s31); + + Struct3 s33; + assert (!(s33 == s31)); + pTester->testStruct33(s31, s33); + assert (s33 == s31); +} + + +void RemotingTest::testStruct4(ITester::Ptr pTester) +{ + Struct4 s41; + s41.value = "baz"; + Struct4 s42; + s42.value = "foo"; + Struct4 s43; + s43.value = "bar"; + s41.vec.push_back(s42); + s41.vec.push_back(s43); + + Struct4 s44 = pTester->testStruct41(s41); + assert (s44 == s41); + + pTester->testStruct42(s44); + assert (s44 == s41); + + Struct4 s45; + assert (!(s45 == s41)); + pTester->testStruct43(s41, s45); + assert (s41 == s45); + + s41.ptr = new Struct4; + + s44 = pTester->testStruct41(s41); + assert (s44 == s41); + + pTester->testStruct42(s44); + assert (s44 == s41); + + Struct4 s46; + assert (!(s46 == s41)); + pTester->testStruct43(s41, s46); + assert (s41 == s46); +} + + +void RemotingTest::testStruct5(ITester::Ptr pTester) +{ + Struct5 s51; + s51.tv = 12345678; + + Struct5 s52 = pTester->testStruct51(s51); + assert (s52.tv == s51.tv); + + pTester->testStruct52(s52); + assert (s52.tv == s51.tv); + + Struct5 s53; + pTester->testStruct53(s51, s53); + assert (s51.tv == s53.tv); +} + + +void RemotingTest::testClass1(ITester::Ptr pTester) +{ + Class1 c1; + c1.setAString("foobar"); + c1.setAnInt(42); + c1.setAnEnum(VALUE_2); + + Class1 c2 = pTester->testClass11(c1); + assert (c2 == c1); + + pTester->testClass12(c2); + assert (c2 == c1); + + Class1 c3; + pTester->testClass13(c1, c3); + assert (c3 == c1); +} + + +void RemotingTest::testPtr(ITester::Ptr pTester) +{ + Struct1::Ptr p1 = new Struct1; + p1->aString = "foobar"; + p1->anInt = 2112; + p1->aDouble = 0.5; + p1->anEnum = VALUE_1; + p1->anEnum2 = Struct1::VALUE_2; + + Struct1::Ptr p2 = pTester->testPtr(p1); + assert (*p2 == *p1); +} + + +void RemotingTest::testStruct1Vec(ITester::Ptr pTester) +{ + Struct1Vec vec1; + for (int i = 0; i < 10; i++) + { + Struct1 s1; + s1.aString = "foobar" + Poco::NumberFormatter::format(i); + s1.anInt = i; + s1.aDouble = i + 0.5; + s1.anEnum = VALUE_1; + s1.anEnum2 = Struct1::VALUE_2; + vec1.push_back(s1); + } + + Struct1Vec vec2 = pTester->testStruct1Vec1(vec1); + assert (vec2.size() == vec1.size()); + for (int i = 0; i < vec1.size(); i++) + { + assert (vec2[i] == vec1[i]); + } + + pTester->testStruct1Vec2(vec2); + assert (vec2.size() == vec1.size()); + for (int i = 0; i < vec1.size(); i++) + { + assert (vec2[i] == vec1[i]); + } + + Struct1Vec vec3; + pTester->testStruct1Vec3(vec1, vec3); + assert (vec2.size() == vec1.size()); + for (int i = 0; i < vec1.size(); i++) + { + assert (vec2[i] == vec1[i]); + } +} + + +ITester::Ptr RemotingTest::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("http", uri); + static_cast(pProxy->remoting__transport()).enableCompression(false); + return pProxy; +} + + +RemotingTestHTTP::RemotingTestHTTP(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestHTTP::~RemotingTestHTTP() +{ +} + + +void RemotingTestHTTP::setUp() +{ + RemotingTest::setUp(); + _pListener->enableCompression(false); +} + + +CppUnit::Test* RemotingTestHTTP::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestHTTP"); + + CppUnit_addTest(pSuite, RemotingTestHTTP, testRegistration); + CppUnit_addTest(pSuite, RemotingTestHTTP, testInt); + CppUnit_addTest(pSuite, RemotingTestHTTP, testEnum1); + CppUnit_addTest(pSuite, RemotingTestHTTP, testEnum2); + CppUnit_addTest(pSuite, RemotingTestHTTP, testNested); + CppUnit_addTest(pSuite, RemotingTestHTTP, testStruct1); + CppUnit_addTest(pSuite, RemotingTestHTTP, testStruct2); + CppUnit_addTest(pSuite, RemotingTestHTTP, testStruct3); + CppUnit_addTest(pSuite, RemotingTestHTTP, testStruct4); + CppUnit_addTest(pSuite, RemotingTestHTTP, testStruct5); + CppUnit_addTest(pSuite, RemotingTestHTTP, testClass1); + CppUnit_addTest(pSuite, RemotingTestHTTP, testPtr); + CppUnit_addTest(pSuite, RemotingTestHTTP, testStruct1Vec); + CppUnit_addTest(pSuite, RemotingTestHTTP, testOneWay); + CppUnit_addTest(pSuite, RemotingTestHTTP, testFault); + CppUnit_addTest(pSuite, RemotingTestHTTP, testAuthenticatedGoodCredentials); + CppUnit_addTest(pSuite, RemotingTestHTTP, testAuthenticatedBadCredentials); + CppUnit_addTest(pSuite, RemotingTestHTTP, testAuthenticatedNoCredentials); + CppUnit_addTest(pSuite, RemotingTestHTTP, testPermission); + CppUnit_addTest(pSuite, RemotingTestHTTP, testNoPermission); + + return pSuite; +} + + +RemotingTestHTTPCompressed::RemotingTestHTTPCompressed(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestHTTPCompressed::~RemotingTestHTTPCompressed() +{ +} + + +void RemotingTestHTTPCompressed::setUp() +{ + RemotingTest::setUp(); + _pListener->enableCompression(true); +} + + +ITester::Ptr RemotingTestHTTPCompressed::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("http", uri); + static_cast(pProxy->remoting__transport()).enableCompression(true); + return pProxy; +} + + +CppUnit::Test* RemotingTestHTTPCompressed::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestHTTPCompressed"); + + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testRegistration); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testInt); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testEnum1); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testEnum2); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testNested); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testStruct1); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testStruct2); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testStruct3); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testStruct4); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testStruct5); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testClass1); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testPtr); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testStruct1Vec); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testOneWay); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testFault); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testAuthenticatedGoodCredentials); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testAuthenticatedBadCredentials); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testAuthenticatedNoCredentials); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testPermission); + CppUnit_addTest(pSuite, RemotingTestHTTPCompressed, testNoPermission); + + return pSuite; +} + + +RemotingTestHTTPNonChunked::RemotingTestHTTPNonChunked(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestHTTPNonChunked::~RemotingTestHTTPNonChunked() +{ +} + + +ITester::Ptr RemotingTestHTTPNonChunked::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("http", uri); + static_cast(pProxy->remoting__transport()).enableChunkedTransferEncoding(false); + return pProxy; +} + + +void RemotingTestHTTPNonChunked::setUp() +{ + RemotingTest::setUp(); + _pListener->enableCompression(false); + _pListener->enableChunkedTransferEncoding(false); +} + + +CppUnit::Test* RemotingTestHTTPNonChunked::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestHTTPNonChunked"); + + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testRegistration); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testInt); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testEnum1); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testEnum2); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testNested); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testStruct1); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testStruct2); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testStruct3); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testStruct4); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testStruct5); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testClass1); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testPtr); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testStruct1Vec); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testOneWay); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testFault); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testAuthenticatedGoodCredentials); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testAuthenticatedBadCredentials); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testAuthenticatedNoCredentials); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testPermission); + CppUnit_addTest(pSuite, RemotingTestHTTPNonChunked, testNoPermission); + + return pSuite; +} + + +RemotingTestHTTPAuth::RemotingTestHTTPAuth(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestHTTPAuth::~RemotingTestHTTPAuth() +{ +} + + +void RemotingTestHTTPAuth::setUp() +{ + _pListener = new Poco::RemotingNG::HTTP::Listener("127.0.0.1:2280", Poco::RemotingNG::HTTP::Listener::PROTO_HTTP); + _listener = Poco::RemotingNG::ORB::instance().registerListener(_pListener); + Poco::RemotingNG::HTTP::TransportFactory::registerFactory(); + _objectURI = TesterServerHelper::registerObject(new Tester, "TheTester", _listener); + + Poco::Net::ServerSocket ss(2280); + _pHTTPServer = new Poco::Net::HTTPServer(new HTTPAuthRequestHandlerFactory(*_pListener), ss, new Poco::Net::HTTPServerParams); + _pHTTPServer->start(); +} + + +void RemotingTestHTTPAuth::tearDown() +{ + RemotingTest::tearDown(); + _pHTTPServer->stop(); + _pHTTPServer = 0; +} + + +void RemotingTestHTTPAuth::testUnauthorized() +{ + ITester::Ptr pTester = createUnauthorizedProxy(_objectURI); + + try + { + testInt(pTester); + fail("Unauthorized - must throw"); + } + catch (Poco::Exception& exc) + { + assert (exc.message() == "HTTP Error: Unauthorized"); + } +} + + +ITester::Ptr RemotingTestHTTPAuth::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("http", uri); + static_cast(pProxy->remoting__transport()).enableChunkedTransferEncoding(false); + static_cast(pProxy->remoting__transport()).setAuthentication(Poco::RemotingNG::HTTP::Transport::AUTH_ANY); + + Poco::RemotingNG::Credentials creds; + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, "user"); + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, "s3cr3t"); + static_cast(pProxy->remoting__transport()).setCredentials(creds); + + return pProxy; +} + + +ITester::Ptr RemotingTestHTTPAuth::createUnauthorizedProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("http", uri); + static_cast(pProxy->remoting__transport()).enableChunkedTransferEncoding(false); + + return pProxy; +} + + +CppUnit::Test* RemotingTestHTTPAuth::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestHTTPAuth"); + + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testRegistration); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testInt); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testEnum1); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testEnum2); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testNested); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testStruct1); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testStruct2); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testStruct3); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testStruct4); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testStruct5); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testClass1); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testPtr); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testStruct1Vec); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testFault); + CppUnit_addTest(pSuite, RemotingTestHTTPAuth, testUnauthorized); + + return pSuite; +} + + +RemotingTestHTTPAuthChunked::RemotingTestHTTPAuthChunked(const std::string& name): RemotingTestHTTPAuth(name) +{ +} + + +RemotingTestHTTPAuthChunked::~RemotingTestHTTPAuthChunked() +{ +} + + +ITester::Ptr RemotingTestHTTPAuthChunked::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("http", uri); + static_cast(pProxy->remoting__transport()).enableChunkedTransferEncoding(true); + static_cast(pProxy->remoting__transport()).setAuthentication(Poco::RemotingNG::HTTP::Transport::AUTH_BASIC); + + Poco::RemotingNG::Credentials creds; + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, "user"); + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, "s3cr3t"); + static_cast(pProxy->remoting__transport()).setCredentials(creds); + + return pProxy; +} + + +CppUnit::Test* RemotingTestHTTPAuthChunked::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestHTTPAuthChunked"); + + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testRegistration); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testInt); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testEnum1); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testEnum2); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testNested); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testStruct1); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testStruct2); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testStruct3); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testStruct4); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testStruct5); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testClass1); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testPtr); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testStruct1Vec); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testFault); + CppUnit_addTest(pSuite, RemotingTestHTTPAuthChunked, testUnauthorized); + + return pSuite; +} diff --git a/RemotingNG/HTTP/testsuite/src/RemotingTest.h b/RemotingNG/HTTP/testsuite/src/RemotingTest.h new file mode 100644 index 0000000000..1657ccb4ad --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/RemotingTest.h @@ -0,0 +1,156 @@ +// +// RemotingTest.h +// +// Definition of the RemotingTest class. +// +// Copyright (c) 2006-2012, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingTest_INCLUDED +#define RemotingTest_INCLUDED + + +#include "Poco/RemotingNG/RemotingNG.h" +#include "CppUnit/TestCase.h" +#include "ITester.h" +#include "Poco/RemotingNG/HTTP/Listener.h" +#include "Poco/Net/HTTPServer.h" +#include "Poco/SharedPtr.h" + + +class RemotingTest: public CppUnit::TestCase +{ +public: + RemotingTest(const std::string& name); + ~RemotingTest(); + + void testRegistration(); + void testInt(); + void testEnum1(); + void testEnum2(); + void testNested(); + void testStruct1(); + void testStruct2(); + void testStruct3(); + void testStruct4(); + void testStruct5(); + void testClass1(); + void testPtr(); + void testStruct1Vec(); + void testOneWay(); + void testFault(); + void testAuthenticatedGoodCredentials(); + void testAuthenticatedNoCredentials(); + void testAuthenticatedBadCredentials(); + void testPermission(); + void testNoPermission(); + + void setUp(); + void tearDown(); + +protected: + void testInt(ITester::Ptr pTester); + void testEnum1(ITester::Ptr pTester); + void testEnum2(ITester::Ptr pTester); + void testNested(ITester::Ptr pTester); + void testStruct1(ITester::Ptr pTester); + void testStruct2(ITester::Ptr pTester); + void testStruct3(ITester::Ptr pTester); + void testStruct4(ITester::Ptr pTester); + void testStruct5(ITester::Ptr pTester); + void testClass1(ITester::Ptr pTester); + void testPtr(ITester::Ptr pTester); + void testStruct1Vec(ITester::Ptr pTester); + virtual ITester::Ptr createProxy(const std::string& uri); + +protected: + std::string _listener; + std::string _objectURI; + Poco::RemotingNG::HTTP::Listener::Ptr _pListener; +}; + + +class RemotingTestHTTP: public RemotingTest +{ +public: + RemotingTestHTTP(const std::string& name); + ~RemotingTestHTTP(); + + void setUp(); + + static CppUnit::Test* suite(); +}; + + +class RemotingTestHTTPCompressed: public RemotingTest +{ +public: + RemotingTestHTTPCompressed(const std::string& name); + ~RemotingTestHTTPCompressed(); + + void setUp(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); +}; + + +class RemotingTestHTTPNonChunked: public RemotingTest +{ +public: + RemotingTestHTTPNonChunked(const std::string& name); + ~RemotingTestHTTPNonChunked(); + + void setUp(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); +}; + + +class RemotingTestHTTPAuth: public RemotingTest +{ +public: + RemotingTestHTTPAuth(const std::string& name); + ~RemotingTestHTTPAuth(); + + void setUp(); + void tearDown(); + + void testUnauthorized(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); + ITester::Ptr createUnauthorizedProxy(const std::string& uri); + +private: + Poco::SharedPtr _pHTTPServer; +}; + + +class RemotingTestHTTPAuthChunked: public RemotingTestHTTPAuth +{ +public: + RemotingTestHTTPAuthChunked(const std::string& name); + ~RemotingTestHTTPAuthChunked(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); +}; + + +#endif // RemotingTest_INCLUDED diff --git a/RemotingNG/HTTP/testsuite/src/Struct1Deserializer.h b/RemotingNG/HTTP/testsuite/src/Struct1Deserializer.h new file mode 100644 index 0000000000..0d01503b67 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Struct1Deserializer.h @@ -0,0 +1,66 @@ +// +// Struct1Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Struct1_INCLUDED +#define TypeDeserializer_Struct1_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Struct1& value) + { + using namespace std::string_literals; + + bool ret = deser.deserializeStructBegin(name, isMandatory); + if (ret) + { + deserializeImpl(deser, value); + deser.deserializeStructEnd(name); + } + return ret; + } + + static void deserializeImpl(Deserializer& deser, Struct1& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aString"s,"anInt"s,"aDouble"s,"anEnum"s,"anEnum2"s}; + bool ret = false; + TypeDeserializer::deserialize(REMOTING__NAMES[0], true, deser, value.aString); + TypeDeserializer::deserialize(REMOTING__NAMES[1], true, deser, value.anInt); + TypeDeserializer::deserialize(REMOTING__NAMES[2], true, deser, value.aDouble); + int genanEnum; + ret = TypeDeserializer::deserialize(REMOTING__NAMES[3], true, deser, genanEnum); + if (ret) value.anEnum = static_cast(genanEnum); + int genanEnum2; + ret = TypeDeserializer::deserialize(REMOTING__NAMES[4], true, deser, genanEnum2); + if (ret) value.anEnum2 = static_cast(genanEnum2); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Struct1_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Struct1Serializer.h b/RemotingNG/HTTP/testsuite/src/Struct1Serializer.h new file mode 100644 index 0000000000..45cd1324f6 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Struct1Serializer.h @@ -0,0 +1,57 @@ +// +// Struct1Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Struct1_INCLUDED +#define TypeSerializer_Struct1_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Struct1& value, Serializer& ser) + { + using namespace std::string_literals; + + ser.serializeStructBegin(name); + serializeImpl(value, ser); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Struct1& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aString"s,"anInt"s,"aDouble"s,"anEnum"s,"anEnum2"s,""s}; + TypeSerializer::serialize(REMOTING__NAMES[0], value.aString, ser); + TypeSerializer::serialize(REMOTING__NAMES[1], value.anInt, ser); + TypeSerializer::serialize(REMOTING__NAMES[2], value.aDouble, ser); + TypeSerializer::serialize(REMOTING__NAMES[3], static_cast(value.anEnum), ser); + TypeSerializer::serialize(REMOTING__NAMES[4], static_cast(value.anEnum2), ser); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Struct1_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Struct2Deserializer.h b/RemotingNG/HTTP/testsuite/src/Struct2Deserializer.h new file mode 100644 index 0000000000..66f847564a --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Struct2Deserializer.h @@ -0,0 +1,65 @@ +// +// Struct2Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Struct2_INCLUDED +#define TypeDeserializer_Struct2_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Struct1Deserializer.h" +#include "Struct1Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Struct2& value) + { + using namespace std::string_literals; + + bool ret = deser.deserializeStructBegin(name, isMandatory); + if (ret) + { + deserializeImpl(deser, value); + deser.deserializeStructEnd(name); + } + return ret; + } + + static void deserializeImpl(Deserializer& deser, Struct2& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aVector"s,"anotherVector"s,"anURI"s,"anUUID"s,"aDateTime"s,"aLocalDateTime"s,"aTimestamp"s}; + TypeDeserializer>::deserialize(REMOTING__NAMES[0], true, deser, value.aVector); + TypeDeserializer>>::deserialize(REMOTING__NAMES[1], true, deser, value.anotherVector); + TypeDeserializer::deserialize(REMOTING__NAMES[2], true, deser, value.anURI); + TypeDeserializer::deserialize(REMOTING__NAMES[3], true, deser, value.anUUID); + TypeDeserializer::deserialize(REMOTING__NAMES[4], true, deser, value.aDateTime); + TypeDeserializer::deserialize(REMOTING__NAMES[5], true, deser, value.aLocalDateTime); + TypeDeserializer::deserialize(REMOTING__NAMES[6], true, deser, value.aTimestamp); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Struct2_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Struct2Serializer.h b/RemotingNG/HTTP/testsuite/src/Struct2Serializer.h new file mode 100644 index 0000000000..3f59d81f6e --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Struct2Serializer.h @@ -0,0 +1,61 @@ +// +// Struct2Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Struct2_INCLUDED +#define TypeSerializer_Struct2_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Struct1Deserializer.h" +#include "Struct1Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Struct2& value, Serializer& ser) + { + using namespace std::string_literals; + + ser.serializeStructBegin(name); + serializeImpl(value, ser); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Struct2& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aVector"s,"anotherVector"s,"anURI"s,"anUUID"s,"aDateTime"s,"aLocalDateTime"s,"aTimestamp"s,""s}; + TypeSerializer>::serialize(REMOTING__NAMES[0], value.aVector, ser); + TypeSerializer>>::serialize(REMOTING__NAMES[1], value.anotherVector, ser); + TypeSerializer::serialize(REMOTING__NAMES[2], value.anURI, ser); + TypeSerializer::serialize(REMOTING__NAMES[3], value.anUUID, ser); + TypeSerializer::serialize(REMOTING__NAMES[4], value.aDateTime, ser); + TypeSerializer::serialize(REMOTING__NAMES[5], value.aLocalDateTime, ser); + TypeSerializer::serialize(REMOTING__NAMES[6], value.aTimestamp, ser); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Struct2_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Struct3Deserializer.h b/RemotingNG/HTTP/testsuite/src/Struct3Deserializer.h new file mode 100644 index 0000000000..7dc2c4c15f --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Struct3Deserializer.h @@ -0,0 +1,68 @@ +// +// Struct3Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Struct3_INCLUDED +#define TypeDeserializer_Struct3_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Struct2Deserializer.h" +#include "Struct2Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Struct3& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMESPACE("http://www.appinf.com/types"s); + bool ret = deser.deserializeStructBegin(name, isMandatory); + deser.pushProperty(SerializerBase::PROP_NAMESPACE, REMOTING__NAMESPACE); + if (ret) + { + deserializeImpl(deser, value); + deser.popProperty(SerializerBase::PROP_NAMESPACE); + deser.deserializeStructEnd(name); + } + else deser.popProperty(SerializerBase::PROP_NAMESPACE); + return ret; + } + + static void deserializeImpl(Deserializer& deser, Struct3& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aCharVector"s,"aComplexVector"s,"aList"s,"aSet"s,"aMultiSet"s,"aNullable"s}; + TypeDeserializer>::deserialize(REMOTING__NAMES[0], true, deser, value.aCharVector); + TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, deser, value.aComplexVector); + TypeDeserializer>::deserialize(REMOTING__NAMES[2], true, deser, value.aList); + TypeDeserializer>::deserialize(REMOTING__NAMES[3], true, deser, value.aSet); + TypeDeserializer>::deserialize(REMOTING__NAMES[4], true, deser, value.aMultiSet); + TypeDeserializer>::deserialize(REMOTING__NAMES[5], true, deser, value.aNullable); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Struct3_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Struct3Serializer.h b/RemotingNG/HTTP/testsuite/src/Struct3Serializer.h new file mode 100644 index 0000000000..642dbf6fb2 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Struct3Serializer.h @@ -0,0 +1,64 @@ +// +// Struct3Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Struct3_INCLUDED +#define TypeSerializer_Struct3_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Struct2Deserializer.h" +#include "Struct2Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Struct3& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMESPACE("http://www.appinf.com/types"s); + ser.registerNamespace(REMOTING__NAMESPACE); + ser.serializeStructBegin(name); + ser.pushProperty(SerializerBase::PROP_NAMESPACE, REMOTING__NAMESPACE); + serializeImpl(value, ser); + ser.popProperty(SerializerBase::PROP_NAMESPACE); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Struct3& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aCharVector"s,"aComplexVector"s,"aList"s,"aSet"s,"aMultiSet"s,"aNullable"s,""s}; + TypeSerializer>::serialize(REMOTING__NAMES[0], value.aCharVector, ser); + TypeSerializer>::serialize(REMOTING__NAMES[1], value.aComplexVector, ser); + TypeSerializer>::serialize(REMOTING__NAMES[2], value.aList, ser); + TypeSerializer>::serialize(REMOTING__NAMES[3], value.aSet, ser); + TypeSerializer>::serialize(REMOTING__NAMES[4], value.aMultiSet, ser); + TypeSerializer>::serialize(REMOTING__NAMES[5], value.aNullable, ser); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Struct3_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Struct4Deserializer.h b/RemotingNG/HTTP/testsuite/src/Struct4Deserializer.h new file mode 100644 index 0000000000..bbb944f024 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Struct4Deserializer.h @@ -0,0 +1,61 @@ +// +// Struct4Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Struct4_INCLUDED +#define TypeDeserializer_Struct4_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Struct4Deserializer.h" +#include "Struct4Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Struct4& value) + { + using namespace std::string_literals; + + bool ret = deser.deserializeStructBegin(name, isMandatory); + if (ret) + { + deserializeImpl(deser, value); + deser.deserializeStructEnd(name); + } + return ret; + } + + static void deserializeImpl(Deserializer& deser, Struct4& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"value"s,"vec"s,"ptr"s}; + TypeDeserializer::deserialize(REMOTING__NAMES[0], true, deser, value.value); + TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, deser, value.vec); + TypeDeserializer>::deserialize(REMOTING__NAMES[2], true, deser, value.ptr); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Struct4_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Struct4Serializer.h b/RemotingNG/HTTP/testsuite/src/Struct4Serializer.h new file mode 100644 index 0000000000..c00248f010 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Struct4Serializer.h @@ -0,0 +1,59 @@ +// +// Struct4Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Struct4_INCLUDED +#define TypeSerializer_Struct4_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Struct4Deserializer.h" +#include "Struct4Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Struct4& value, Serializer& ser) + { + using namespace std::string_literals; + + ser.serializeStructBegin(name); + serializeImpl(value, ser); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Struct4& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"value"s,"vec"s,"ptr"s,""s,"http://www.appinf.com/types"s}; + TypeSerializer::serialize(REMOTING__NAMES[0], value.value, ser); + TypeSerializer>::serialize(REMOTING__NAMES[1], value.vec, ser); + ser.pushProperty(SerializerBase::PROP_NAMESPACE, REMOTING__NAMES[4]); + TypeSerializer>::serialize(REMOTING__NAMES[2], value.ptr, ser); + ser.popProperty(SerializerBase::PROP_NAMESPACE); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Struct4_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Struct5Deserializer.h b/RemotingNG/HTTP/testsuite/src/Struct5Deserializer.h new file mode 100644 index 0000000000..51973448cb --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Struct5Deserializer.h @@ -0,0 +1,57 @@ +// +// Struct5Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Struct5_INCLUDED +#define TypeDeserializer_Struct5_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Struct5& value) + { + using namespace std::string_literals; + + bool ret = deser.deserializeStructBegin(name, isMandatory); + if (ret) + { + deserializeImpl(deser, value); + deser.deserializeStructEnd(name); + } + return ret; + } + + static void deserializeImpl(Deserializer& deser, Struct5& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"tv"s}; + TypeDeserializer::deserialize(REMOTING__NAMES[0], true, deser, value.tv); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Struct5_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Struct5Serializer.h b/RemotingNG/HTTP/testsuite/src/Struct5Serializer.h new file mode 100644 index 0000000000..6114aa69e1 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Struct5Serializer.h @@ -0,0 +1,53 @@ +// +// Struct5Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Struct5_INCLUDED +#define TypeSerializer_Struct5_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Struct5& value, Serializer& ser) + { + using namespace std::string_literals; + + ser.serializeStructBegin(name); + serializeImpl(value, ser); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Struct5& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"tv"s,""s}; + TypeSerializer::serialize(REMOTING__NAMES[0], value.tv, ser); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Struct5_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/Tester.cpp b/RemotingNG/HTTP/testsuite/src/Tester.cpp new file mode 100644 index 0000000000..8ad1f71f5e --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Tester.cpp @@ -0,0 +1,269 @@ +// +// Tester.cpp +// +// Copyright (c) 2009-2011, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Tester.h" +#include "Poco/Exception.h" +#include "Poco/RemotingNG/Context.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Net/HTTPServerResponse.h" +#include "Poco/Net/HTTPCookie.h" + + +const int Class1::A_CONSTANT(1); + + +int Tester::testInt1(int i) +{ + return i; +} + + +void Tester::testInt2(int& i) +{ + i = 2112; +} + + +void Tester::testInt3(int i1, int& i2) +{ + i2 = i1; +} + + +Enum1 Tester::testEnum11(Enum1 e1) +{ + return e1; +} + + +void Tester::testEnum12(Enum1& e1) +{ + e1 = VALUE_2; +} + + +void Tester::testEnum13(Enum1 e1, Enum1& e2) +{ + e2 = e1; +} + + +Struct1::Enum2 Tester::testEnum21(Struct1::Enum2 e1) +{ + return e1; +} + + +void Tester::testEnum22(Struct1::Enum2& e1) +{ + e1 = Struct1::VALUE_2; +} + + +void Tester::testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2) +{ + e2 = e1; +} + + +Struct1 Tester::testStruct11(const Struct1& s1) +{ + return s1; +} + + +void Tester::testStruct12(Struct1& s1) +{ +} + + +void Tester::testStruct13(const Struct1& s1, Struct1& s2) +{ + s2 = s1; +} + + +Struct2 Tester::testStruct21(const Struct2& s1) +{ + return s1; +} + + +void Tester::testStruct22(Struct2& s1) +{ +} + + +void Tester::testStruct23(const Struct2& s1, Struct2& s2) +{ + s2 = s1; +} + + +Struct3 Tester::testStruct31(const Struct3& s1) +{ + return s1; +} + + +void Tester::testStruct32(Struct3& s1) +{ +} + + +void Tester::testStruct33(const Struct3& s1, Struct3& s2) +{ + s2 = s1; +} + + +Struct4 Tester::testStruct41(const Struct4& s1) +{ + return s1; +} + + +void Tester::testStruct42(Struct4& s1) +{ +} + + +void Tester::testStruct43(const Struct4& s1, Struct4& s2) +{ + s2 = s1; +} + + +Struct5 Tester::testStruct51(const Struct5& s1) +{ + return s1; +} + + +void Tester::testStruct52(Struct5& s1) +{ +} + + +void Tester::testStruct53(const Struct5& s1, Struct5& s2) +{ + s2 = s1; +} + + +Class1 Tester::testClass11(const Class1& c1) +{ + return c1; +} + + +void Tester::testClass12(Class1& c1) +{ +} + + +void Tester::testClass13(const Class1& c1, Class1& c2) +{ + c2 = c1; +} + + +Struct1::Ptr Tester::testPtr(Struct1::Ptr p1) +{ + return p1; +} + + +Struct1Vec Tester::testStruct1Vec1(const Struct1Vec& vec) +{ + return vec; +} + + +void Tester::testStruct1Vec2(Struct1Vec& vec) +{ +} + + +void Tester::testStruct1Vec3(const Struct1Vec& vec1, Struct1Vec& vec2) +{ + vec2 = vec1; +} + + +void Tester::testOneWay(const std::string& arg) +{ + _oneWayResult = arg; +} + + +std::string Tester::testOneWayResult() +{ + return _oneWayResult; +} + + +Poco::Timestamp::TimeVal Tester::testNestedType(Poco::Timestamp::TimeVal arg) +{ + return arg; +} + + +void Tester::testSynchronized() +{ +} + + +void Tester::testSynchronizedProxy() +{ +} + + +void Tester::testSynchronizedRemote() +{ +} + + +void Tester::testFault() +{ + throw Poco::ApplicationException("Something went wrong"); +} + + +void Tester::setCookie() +{ + Poco::RemotingNG::Context::Ptr pContext = Poco::RemotingNG::Context::get(); + Poco::Net::HTTPServerResponse* pResponse = pContext->getValue("httpResponse"); + Poco::Net::HTTPCookie cookie("testcookie", "testvalue"); + cookie.setMaxAge(5); + pResponse->addCookie(cookie); +} + + +bool Tester::verifyCookie() +{ + Poco::RemotingNG::Context::Ptr pContext = Poco::RemotingNG::Context::get(); + Poco::Net::HTTPServerRequest* pRequest = pContext->getValue("httpRequest"); + Poco::Net::NameValueCollection cookies; + pRequest->getCookies(cookies); + return cookies.get("testcookie", "") == "testvalue"; +} + + +void Tester::testAuthenticated() +{ +} + + +void Tester::testPermission() +{ +} diff --git a/RemotingNG/HTTP/testsuite/src/Tester.h b/RemotingNG/HTTP/testsuite/src/Tester.h new file mode 100644 index 0000000000..c55b3a212c --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/Tester.h @@ -0,0 +1,292 @@ +// +// Tester.h +// +// Definition of the Tester class. +// +// Copyright (c) 2009-2012, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef Tester_INCLUDED +#define Tester_INCLUDED + + +#include "Poco/Poco.h" +#include "Poco/SharedPtr.h" +#include "Poco/BinaryWriter.h" +#include "Poco/BinaryReader.h" +#include "Poco/BasicEvent.h" +#include "Poco/Nullable.h" +#include "Poco/URI.h" +#include "Poco/UUID.h" +#include "Poco/DateTime.h" +#include "Poco/LocalDateTime.h" +#include "Poco/Timestamp.h" +#include +#include +#include + + +enum Enum1 +{ + VALUE_1, + VALUE_2, + VALUE_3 +}; + + +//@ serialize +struct Struct1 +{ + typedef Poco::SharedPtr Ptr; + + enum Enum2 + { + VALUE_1 = 1, + VALUE_2 = 2, + VALUE_3 = 4 + }; + + std::string aString; + int anInt; + double aDouble; + Enum1 anEnum; + Enum2 anEnum2; +}; + + +typedef Struct1 AnotherStruct1; +typedef std::vector Struct1Vec; + + +//@ serialize +struct Struct2 +{ + Struct1Vec aVector; + std::vector anotherVector; + Poco::URI anURI; + Poco::UUID anUUID; + Poco::DateTime aDateTime; + Poco::LocalDateTime aLocalDateTime; + Poco::Timestamp aTimestamp; +}; + + +//@ serialize +//@ namespace="http://www.appinf.com/types" +struct Struct3 +{ + std::vector aCharVector; + std::vector aComplexVector; + std::list aList; + std::set aSet; + std::multiset aMultiSet; + Poco::Nullable aNullable; +}; + + +//@ serialize +struct Struct4 +{ + std::string value; + std::vector vec; + //@ namespace="http://www.appinf.com/types" + Poco::SharedPtr ptr; +}; + + +//@ serialize +struct Struct5 +{ + Poco::Timestamp::TimeVal tv; +}; + + +//@ serialize +class Class1 +{ +public: + Class1(): + _anEnum(VALUE_1), + _anInt(0) + { + } + + void setAnEnum(Enum1 anEnum) + { + _anEnum = anEnum; + } + + Enum1 getAnEnum() const + { + return _anEnum; + } + + void setAnInt(int anInt) + { + _anInt = anInt; + } + + int getAnInt() const + { + return _anInt; + } + + void setAString(const std::string& str) + { + _aString = str; + } + + const std::string& getAString() const + { + return _aString; + } + + void write(Poco::BinaryWriter& writer) + { + } + + void read(Poco::BinaryReader& reader) + { + } + + bool operator == (const Class1& cl) const + { + return _anEnum == cl._anEnum + && _anInt == cl._anInt; + } + + static const int A_CONSTANT; + +private: + Enum1 _anEnum; + int _anInt; + std::string _aString; +}; + + +//@ namespace="urn:appinf.com:service:Tester:1" +//@ remote +class Tester +{ +public: + //@ name=TestInt1 + //@ replyName=TestInt1Response + //@ $i={name="Value", direction=in} + int testInt1(int i); + + //@ name=TestInt2 + //@ replyName=TestInt2Response + //@ $i={name="Value", direction=inout} + void testInt2(int& i); + + //@ name=TestInt3 + //@ replyName=TestInt3Response + //@ $i1={name="Value1", direction=in} + //@ $i2={name="Value2", direction=out} + void testInt3(int i1, int& i2); + + Enum1 testEnum11(Enum1 e1); + + void testEnum12(Enum1& e1); + + //@ $e2={direction=out} + void testEnum13(Enum1 e1, Enum1& e2); + + Struct1::Enum2 testEnum21(Struct1::Enum2 e1); + + void testEnum22(Struct1::Enum2& e1); + + //@ $e2={direction=out} + void testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2); + + Struct1 testStruct11(const Struct1& s1); + + void testStruct12(Struct1& s1); + + //@ $s2={direction=out} + void testStruct13(const Struct1& s1, Struct1& s2); + + Struct2 testStruct21(const Struct2& s1); + + void testStruct22(Struct2& s1); + + //@ $s2={direction=out} + void testStruct23(const Struct2& s1, Struct2& s2); + + Struct3 testStruct31(const Struct3& s1); + + void testStruct32(Struct3& s1); + + //@ $s2={direction=out} + void testStruct33(const Struct3& s1, Struct3& s2); + + Struct4 testStruct41(const Struct4& s1); + + void testStruct42(Struct4& s1); + + //@ $s2={direction=out} + void testStruct43(const Struct4& s1, Struct4& s2); + + Struct5 testStruct51(const Struct5& s1); + + void testStruct52(Struct5& s1); + + //@ s2={direction=out} + void testStruct53(const Struct5& s1, Struct5& s2); + + Class1 testClass11(const Class1& c1); + + void testClass12(Class1& c1); + + //@ $c2={direction=out} + void testClass13(const Class1& c1, Class1& c2); + + Struct1::Ptr testPtr(Struct1::Ptr p1); + + Struct1Vec testStruct1Vec1(const Struct1Vec& vec); + + void testStruct1Vec2(Struct1Vec& vec); + + //@ $vec2={direction=out} + void testStruct1Vec3(const Struct1Vec& vec1, Struct1Vec& vec2); + + //@ oneway + void testOneWay(const std::string& arg); + + std::string testOneWayResult(); + + Poco::Timestamp::TimeVal testNestedType(Poco::Timestamp::TimeVal arg); + + //@ synchronized + void testSynchronized(); + + //@ synchronized=proxy + void testSynchronizedProxy(); + + //@ synchronized=remote + void testSynchronizedRemote(); + + void testFault(); + + void setCookie(); + + bool verifyCookie(); + + //@ authenticated + void testAuthenticated(); + + //@ permission="perm1" + void testPermission(); + +private: + std::string _oneWayResult; +}; + + +#endif // Tester_INCLUDED diff --git a/RemotingNG/HTTP/testsuite/src/TesterClientHelper.cpp b/RemotingNG/HTTP/testsuite/src/TesterClientHelper.cpp new file mode 100644 index 0000000000..3a7ddd7169 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterClientHelper.cpp @@ -0,0 +1,55 @@ +// +// TesterClientHelper.cpp +// +// Package: Generated +// Module: TesterClientHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterClientHelper.h" +#include "Poco/SingletonHolder.h" +#include "TesterProxyFactory.h" + + +namespace +{ + Poco::SingletonHolder shTesterClientHelper; +} + + +TesterClientHelper::TesterClientHelper(): + _pORB(0) +{ + _pORB = &Poco::RemotingNG::ORB::instance(); + _pORB->registerProxyFactory("Tester", new TesterProxyFactory); +} + + +TesterClientHelper::~TesterClientHelper() +{ +} + + +ITester::Ptr TesterClientHelper::findImpl(const std::string& uri) +{ + Poco::RemotingNG::Identifiable::Ptr pInterface = _pORB->findObject(uri); + return pInterface.cast(); +} + + +ITester::Ptr TesterClientHelper::findImpl(const std::string& uri, const std::string& protocol) +{ + Poco::RemotingNG::Identifiable::Ptr pInterface = _pORB->findObject(uri, ITester::remoting__typeId(), protocol); + return pInterface.cast(); +} + + +TesterClientHelper& TesterClientHelper::instance() +{ + return *shTesterClientHelper.get(); +} + + diff --git a/RemotingNG/HTTP/testsuite/src/TesterClientHelper.h b/RemotingNG/HTTP/testsuite/src/TesterClientHelper.h new file mode 100644 index 0000000000..2c1614728c --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterClientHelper.h @@ -0,0 +1,72 @@ +// +// TesterClientHelper.h +// +// Package: Generated +// Module: TesterClientHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterClientHelper_INCLUDED +#define TesterClientHelper_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/ORB.h" + + +class TesterClientHelper +{ +public: + TesterClientHelper(); + /// Creates a TesterClientHelper. + + ~TesterClientHelper(); + /// Destroys the TesterClientHelper. + + static ITester::Ptr find(const std::string& uri); + /// Return an interface for the service object identified by the given URI. + /// + /// Depending on whether the service object has been registered on the same ORB, or not, + /// the ORB will either return a RemoteObject (with forwards calls locally, without the + /// need for serialization/deserialization), or a Proxy. + /// + /// The URI must have the following format: :///// + + static ITester::Ptr find(const std::string& uri, const std::string& protocol); + /// Return a Proxy for the service object identified by the given URI. + /// + /// The given protocol name is used to determine the Transport used by + /// the Proxy. This is used for objects identified by URIs that do not + /// follow the standard Remoting URI structure. + +private: + ITester::Ptr findImpl(const std::string& uri); + + ITester::Ptr findImpl(const std::string& uri, const std::string& protocol); + + static TesterClientHelper& instance(); + + Poco::RemotingNG::ORB* _pORB; +}; + + +inline ITester::Ptr TesterClientHelper::find(const std::string& uri) +{ + return TesterClientHelper::instance().findImpl(uri); +} + + +inline ITester::Ptr TesterClientHelper::find(const std::string& uri, const std::string& protocol) +{ + return TesterClientHelper::instance().findImpl(uri, protocol); +} + + + + +#endif // TesterClientHelper_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/TesterProxy.cpp b/RemotingNG/HTTP/testsuite/src/TesterProxy.cpp new file mode 100644 index 0000000000..bfdcb6061c --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterProxy.cpp @@ -0,0 +1,1115 @@ +// +// TesterProxy.cpp +// +// Package: Generated +// Module: TesterProxy +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterProxy.h" +#include "Class1Deserializer.h" +#include "Class1Serializer.h" +#include "Poco/RemotingNG/Deserializer.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Poco/RemotingNG/URIUtility.h" +#include "Struct1Deserializer.h" +#include "Struct1Serializer.h" +#include "Struct2Deserializer.h" +#include "Struct2Serializer.h" +#include "Struct3Deserializer.h" +#include "Struct3Serializer.h" +#include "Struct4Deserializer.h" +#include "Struct4Serializer.h" +#include "Struct5Deserializer.h" +#include "Struct5Serializer.h" + + +TesterProxy::TesterProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid): + ITester(), + Poco::RemotingNG::Proxy(oid), + _testClass11Ret(), + _testEnum11Ret(), + _testEnum21Ret(), + _testInt1Ret(), + _testNestedTypeRet(), + _testOneWayResultRet(), + _testPtrRet(), + _testStruct11Ret(), + _testStruct1Vec1Ret(), + _testStruct21Ret(), + _testStruct31Ret(), + _testStruct41Ret(), + _testStruct51Ret(), + _verifyCookieRet() +{ +} + + +TesterProxy::~TesterProxy() +{ +} + + +void TesterProxy::setCookie() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"setCookie"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("setCookieReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testAuthenticated() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testAuthenticated"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testAuthenticatedReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Class1 TesterProxy::testClass11(const Class1& c1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass11"s,"c1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], c1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass11Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testClass11Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testClass11Ret; +} + + +void TesterProxy::testClass12(Class1& c1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass12"s,"c1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], c1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass12Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, c1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testClass13(const Class1& c1, Class1& c2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass13"s,"c1"s,"c2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], c1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass13Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, c2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Enum1 TesterProxy::testEnum11(Enum1 e1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum11"s,"e1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum11Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__tmpReturn; + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, remoting__tmpReturn); + _testEnum11Ret = static_cast(remoting__tmpReturn); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testEnum11Ret; +} + + +void TesterProxy::testEnum12(Enum1& e1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum12"s,"e1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum12Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testEnum13(Enum1 e1, Enum1& e2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum13"s,"e1"s,"e2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum13Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__e2Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, remoting__e2Tmp); + e2 = static_cast(remoting__e2Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Struct1::Enum2 TesterProxy::testEnum21(Struct1::Enum2 e1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum21"s,"e1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum21Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__tmpReturn; + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, remoting__tmpReturn); + _testEnum21Ret = static_cast(remoting__tmpReturn); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testEnum21Ret; +} + + +void TesterProxy::testEnum22(Struct1::Enum2& e1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum22"s,"e1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum22Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum23"s,"e1"s,"e2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum23Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__e2Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, remoting__e2Tmp); + e2 = static_cast(remoting__e2Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testFault() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testFault"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testFaultReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +int TesterProxy::testInt1(int i) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt1"s,"Value"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], i, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt1Response"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testInt1Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testInt1Ret; +} + + +void TesterProxy::testInt2(int& i) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt2"s,"Value"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], i, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt2Response"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, i); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testInt3(int i1, int& i2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt3"s,"Value1"s,"Value2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], i1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt3Response"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, i2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Poco::Int64 TesterProxy::testNestedType(Poco::Int64 arg) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testNestedType"s,"arg"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], arg, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testNestedTypeReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testNestedTypeRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testNestedTypeRet; +} + + +void TesterProxy::testOneWay(const std::string& arg) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testOneWay"s,"arg"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginMessage(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], arg, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.sendMessage(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); +} + + +std::string TesterProxy::testOneWayResult() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testOneWayResult"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testOneWayResultReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testOneWayResultRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testOneWayResultRet; +} + + +void TesterProxy::testPermission() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testPermission"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testPermissionReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Poco::SharedPtr TesterProxy::testPtr(Poco::SharedPtr p1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testPtr"s,"p1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[1], p1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testPtrReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer>::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testPtrRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testPtrRet; +} + + +Struct1 TesterProxy::testStruct11(const Struct1& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct11"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct11Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct11Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct11Ret; +} + + +void TesterProxy::testStruct12(Struct1& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct12"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct12Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct13(const Struct1& s1, Struct1& s2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct13"s,"s1"s,"s2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct13Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +std::vector TesterProxy::testStruct1Vec1(const std::vector& vec) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec1"s,"vec"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[1], vec, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec1Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + _testStruct1Vec1Ret.clear(); + Poco::RemotingNG::TypeDeserializer>::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct1Vec1Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct1Vec1Ret; +} + + +void TesterProxy::testStruct1Vec2(std::vector& vec) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec2"s,"vec"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[1], vec, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec2Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, remoting__deser, vec); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct1Vec3(const std::vector& vec1, std::vector& vec2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec3"s,"vec1"s,"vec2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[1], vec1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec3Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[2], true, remoting__deser, vec2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Struct2 TesterProxy::testStruct21(const Struct2& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct21"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct21Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct21Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct21Ret; +} + + +void TesterProxy::testStruct22(Struct2& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct22"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct22Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct23(const Struct2& s1, Struct2& s2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct23"s,"s1"s,"s2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct23Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Struct3 TesterProxy::testStruct31(const Struct3& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct31"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct31Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct31Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct31Ret; +} + + +void TesterProxy::testStruct32(Struct3& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct32"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct32Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct33(const Struct3& s1, Struct3& s2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct33"s,"s1"s,"s2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct33Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Struct4 TesterProxy::testStruct41(const Struct4& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct41"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct41Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct41Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct41Ret; +} + + +void TesterProxy::testStruct42(Struct4& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct42"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct42Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct43(const Struct4& s1, Struct4& s2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct43"s,"s1"s,"s2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct43Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Struct5 TesterProxy::testStruct51(const Struct5& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct51"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct51Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct51Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct51Ret; +} + + +void TesterProxy::testStruct52(Struct5& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct52"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct52Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct53(const Struct5& s1, Struct5& s2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct53"s,"s1"s,"s2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct53Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testSynchronized() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronized"s}; + Poco::FastMutex::ScopedLock remoting__lock(remoting__mutex()); + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testSynchronizedProxy() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronizedProxy"s}; + Poco::FastMutex::ScopedLock remoting__lock(remoting__mutex()); + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedProxyReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testSynchronizedRemote() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronizedRemote"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedRemoteReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +bool TesterProxy::verifyCookie() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"verifyCookie"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("verifyCookieReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _verifyCookieRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _verifyCookieRet; +} + + +const std::string TesterProxy::DEFAULT_NS("urn:appinf.com:service:Tester:1"); diff --git a/RemotingNG/HTTP/testsuite/src/TesterProxy.h b/RemotingNG/HTTP/testsuite/src/TesterProxy.h new file mode 100644 index 0000000000..5c981b4131 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterProxy.h @@ -0,0 +1,145 @@ +// +// TesterProxy.h +// +// Package: Generated +// Module: TesterProxy +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterProxy_INCLUDED +#define TesterProxy_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Proxy.h" + + +class TesterProxy: public ITester, public Poco::RemotingNG::Proxy +{ +public: + using Ptr = Poco::AutoPtr; + + TesterProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid); + /// Creates a TesterProxy. + + virtual ~TesterProxy(); + /// Destroys the TesterProxy. + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + + void setCookie(); + + void testAuthenticated(); + + Class1 testClass11(const Class1& c1); + + void testClass12(Class1& c1); + + void testClass13(const Class1& c1, Class1& c2); + + Enum1 testEnum11(Enum1 e1); + + void testEnum12(Enum1& e1); + + void testEnum13(Enum1 e1, Enum1& e2); + + Struct1::Enum2 testEnum21(Struct1::Enum2 e1); + + void testEnum22(Struct1::Enum2& e1); + + void testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2); + + void testFault(); + + int testInt1(int i); + + void testInt2(int& i); + + void testInt3(int i1, int& i2); + + Poco::Int64 testNestedType(Poco::Int64 arg); + + void testOneWay(const std::string& arg); + + std::string testOneWayResult(); + + void testPermission(); + + Poco::SharedPtr testPtr(Poco::SharedPtr p1); + + Struct1 testStruct11(const Struct1& s1); + + void testStruct12(Struct1& s1); + + void testStruct13(const Struct1& s1, Struct1& s2); + + std::vector testStruct1Vec1(const std::vector& vec); + + void testStruct1Vec2(std::vector& vec); + + void testStruct1Vec3(const std::vector& vec1, std::vector& vec2); + + Struct2 testStruct21(const Struct2& s1); + + void testStruct22(Struct2& s1); + + void testStruct23(const Struct2& s1, Struct2& s2); + + Struct3 testStruct31(const Struct3& s1); + + void testStruct32(Struct3& s1); + + void testStruct33(const Struct3& s1, Struct3& s2); + + Struct4 testStruct41(const Struct4& s1); + + void testStruct42(Struct4& s1); + + void testStruct43(const Struct4& s1, Struct4& s2); + + Struct5 testStruct51(const Struct5& s1); + + void testStruct52(Struct5& s1); + + void testStruct53(const Struct5& s1, Struct5& s2); + + void testSynchronized(); + + void testSynchronizedProxy(); + + void testSynchronizedRemote(); + + bool verifyCookie(); + +private: + static const std::string DEFAULT_NS; + mutable Class1 _testClass11Ret; + mutable Enum1 _testEnum11Ret; + mutable Struct1::Enum2 _testEnum21Ret; + mutable int _testInt1Ret; + mutable Poco::Int64 _testNestedTypeRet; + mutable std::string _testOneWayResultRet; + mutable Poco::SharedPtr _testPtrRet; + mutable Struct1 _testStruct11Ret; + mutable std::vector _testStruct1Vec1Ret; + mutable Struct2 _testStruct21Ret; + mutable Struct3 _testStruct31Ret; + mutable Struct4 _testStruct41Ret; + mutable Struct5 _testStruct51Ret; + mutable bool _verifyCookieRet; +}; + + +inline const Poco::RemotingNG::Identifiable::TypeId& TesterProxy::remoting__typeId() const +{ + return ITester::remoting__typeId(); +} + + + + +#endif // TesterProxy_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/TesterProxyFactory.cpp b/RemotingNG/HTTP/testsuite/src/TesterProxyFactory.cpp new file mode 100644 index 0000000000..17b514427d --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterProxyFactory.cpp @@ -0,0 +1,32 @@ +// +// TesterProxyFactory.cpp +// +// Package: Generated +// Module: TesterProxyFactory +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterProxyFactory.h" + + +TesterProxyFactory::TesterProxyFactory(): + Poco::RemotingNG::ProxyFactory() + +{ +} + + +TesterProxyFactory::~TesterProxyFactory() +{ +} + + +Poco::RemotingNG::Proxy* TesterProxyFactory::createProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid) const +{ + return new TesterProxy(oid); +} + + diff --git a/RemotingNG/HTTP/testsuite/src/TesterProxyFactory.h b/RemotingNG/HTTP/testsuite/src/TesterProxyFactory.h new file mode 100644 index 0000000000..0f84b4e4ca --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterProxyFactory.h @@ -0,0 +1,38 @@ +// +// TesterProxyFactory.h +// +// Package: Generated +// Module: TesterProxyFactory +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterProxyFactory_INCLUDED +#define TesterProxyFactory_INCLUDED + + +#include "Poco/RemotingNG/ProxyFactory.h" +#include "TesterProxy.h" + + +class TesterProxyFactory: public Poco::RemotingNG::ProxyFactory +{ +public: + TesterProxyFactory(); + /// Creates a TesterProxyFactory. + + ~TesterProxyFactory(); + /// Destroys the TesterProxyFactory. + + Poco::RemotingNG::Proxy* createProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid) const; + /// Creates and returns a new Proxy object. + +}; + + + + +#endif // TesterProxyFactory_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/TesterRemoteObject.cpp b/RemotingNG/HTTP/testsuite/src/TesterRemoteObject.cpp new file mode 100644 index 0000000000..3bf1fb48d8 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterRemoteObject.cpp @@ -0,0 +1,34 @@ +// +// TesterRemoteObject.cpp +// +// Package: Generated +// Module: TesterRemoteObject +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterRemoteObject.h" + + +TesterRemoteObject::TesterRemoteObject(const Poco::RemotingNG::Identifiable::ObjectId& oid, Poco::SharedPtr pServiceObject): + ITester(), + Poco::RemotingNG::RemoteObject(oid), + _pServiceObject(pServiceObject) +{ +} + + +TesterRemoteObject::~TesterRemoteObject() +{ + try + { + } + catch (...) + { + poco_unexpected(); + } +} + + diff --git a/RemotingNG/HTTP/testsuite/src/TesterRemoteObject.h b/RemotingNG/HTTP/testsuite/src/TesterRemoteObject.h new file mode 100644 index 0000000000..1fc29aea34 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterRemoteObject.h @@ -0,0 +1,387 @@ +// +// TesterRemoteObject.h +// +// Package: Generated +// Module: TesterRemoteObject +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterRemoteObject_INCLUDED +#define TesterRemoteObject_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/RemoteObject.h" +#include "Poco/SharedPtr.h" + + +class TesterRemoteObject: public ITester, public Poco::RemotingNG::RemoteObject +{ +public: + using Ptr = Poco::AutoPtr; + + TesterRemoteObject(const Poco::RemotingNG::Identifiable::ObjectId& oid, Poco::SharedPtr pServiceObject); + /// Creates a TesterRemoteObject. + + virtual ~TesterRemoteObject(); + /// Destroys the TesterRemoteObject. + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + + void setCookie(); + + void testAuthenticated(); + + Class1 testClass11(const Class1& c1); + + void testClass12(Class1& c1); + + void testClass13(const Class1& c1, Class1& c2); + + Enum1 testEnum11(Enum1 e1); + + void testEnum12(Enum1& e1); + + void testEnum13(Enum1 e1, Enum1& e2); + + Struct1::Enum2 testEnum21(Struct1::Enum2 e1); + + void testEnum22(Struct1::Enum2& e1); + + void testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2); + + void testFault(); + + int testInt1(int i); + + void testInt2(int& i); + + void testInt3(int i1, int& i2); + + Poco::Int64 testNestedType(Poco::Int64 arg); + + void testOneWay(const std::string& arg); + + std::string testOneWayResult(); + + void testPermission(); + + Poco::SharedPtr testPtr(Poco::SharedPtr p1); + + Struct1 testStruct11(const Struct1& s1); + + void testStruct12(Struct1& s1); + + void testStruct13(const Struct1& s1, Struct1& s2); + + std::vector testStruct1Vec1(const std::vector& vec); + + void testStruct1Vec2(std::vector& vec); + + void testStruct1Vec3(const std::vector& vec1, std::vector& vec2); + + Struct2 testStruct21(const Struct2& s1); + + void testStruct22(Struct2& s1); + + void testStruct23(const Struct2& s1, Struct2& s2); + + Struct3 testStruct31(const Struct3& s1); + + void testStruct32(Struct3& s1); + + void testStruct33(const Struct3& s1, Struct3& s2); + + Struct4 testStruct41(const Struct4& s1); + + void testStruct42(Struct4& s1); + + void testStruct43(const Struct4& s1, Struct4& s2); + + Struct5 testStruct51(const Struct5& s1); + + void testStruct52(Struct5& s1); + + void testStruct53(const Struct5& s1, Struct5& s2); + + void testSynchronized(); + + void testSynchronizedProxy(); + + void testSynchronizedRemote(); + + bool verifyCookie(); + +private: + Poco::SharedPtr _pServiceObject; +}; + + +inline const Poco::RemotingNG::Identifiable::TypeId& TesterRemoteObject::remoting__typeId() const +{ + return ITester::remoting__typeId(); +} + + +inline void TesterRemoteObject::setCookie() +{ + _pServiceObject->setCookie(); +} + + +inline void TesterRemoteObject::testAuthenticated() +{ + _pServiceObject->testAuthenticated(); +} + + +inline Class1 TesterRemoteObject::testClass11(const Class1& c1) +{ + return _pServiceObject->testClass11(c1); +} + + +inline void TesterRemoteObject::testClass12(Class1& c1) +{ + _pServiceObject->testClass12(c1); +} + + +inline void TesterRemoteObject::testClass13(const Class1& c1, Class1& c2) +{ + _pServiceObject->testClass13(c1, c2); +} + + +inline Enum1 TesterRemoteObject::testEnum11(Enum1 e1) +{ + return _pServiceObject->testEnum11(e1); +} + + +inline void TesterRemoteObject::testEnum12(Enum1& e1) +{ + _pServiceObject->testEnum12(e1); +} + + +inline void TesterRemoteObject::testEnum13(Enum1 e1, Enum1& e2) +{ + _pServiceObject->testEnum13(e1, e2); +} + + +inline Struct1::Enum2 TesterRemoteObject::testEnum21(Struct1::Enum2 e1) +{ + return _pServiceObject->testEnum21(e1); +} + + +inline void TesterRemoteObject::testEnum22(Struct1::Enum2& e1) +{ + _pServiceObject->testEnum22(e1); +} + + +inline void TesterRemoteObject::testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2) +{ + _pServiceObject->testEnum23(e1, e2); +} + + +inline void TesterRemoteObject::testFault() +{ + _pServiceObject->testFault(); +} + + +inline int TesterRemoteObject::testInt1(int i) +{ + return _pServiceObject->testInt1(i); +} + + +inline void TesterRemoteObject::testInt2(int& i) +{ + _pServiceObject->testInt2(i); +} + + +inline void TesterRemoteObject::testInt3(int i1, int& i2) +{ + _pServiceObject->testInt3(i1, i2); +} + + +inline Poco::Int64 TesterRemoteObject::testNestedType(Poco::Int64 arg) +{ + return _pServiceObject->testNestedType(arg); +} + + +inline void TesterRemoteObject::testOneWay(const std::string& arg) +{ + _pServiceObject->testOneWay(arg); +} + + +inline std::string TesterRemoteObject::testOneWayResult() +{ + return _pServiceObject->testOneWayResult(); +} + + +inline void TesterRemoteObject::testPermission() +{ + _pServiceObject->testPermission(); +} + + +inline Poco::SharedPtr TesterRemoteObject::testPtr(Poco::SharedPtr p1) +{ + return _pServiceObject->testPtr(p1); +} + + +inline Struct1 TesterRemoteObject::testStruct11(const Struct1& s1) +{ + return _pServiceObject->testStruct11(s1); +} + + +inline void TesterRemoteObject::testStruct12(Struct1& s1) +{ + _pServiceObject->testStruct12(s1); +} + + +inline void TesterRemoteObject::testStruct13(const Struct1& s1, Struct1& s2) +{ + _pServiceObject->testStruct13(s1, s2); +} + + +inline std::vector TesterRemoteObject::testStruct1Vec1(const std::vector& vec) +{ + return _pServiceObject->testStruct1Vec1(vec); +} + + +inline void TesterRemoteObject::testStruct1Vec2(std::vector& vec) +{ + _pServiceObject->testStruct1Vec2(vec); +} + + +inline void TesterRemoteObject::testStruct1Vec3(const std::vector& vec1, std::vector& vec2) +{ + _pServiceObject->testStruct1Vec3(vec1, vec2); +} + + +inline Struct2 TesterRemoteObject::testStruct21(const Struct2& s1) +{ + return _pServiceObject->testStruct21(s1); +} + + +inline void TesterRemoteObject::testStruct22(Struct2& s1) +{ + _pServiceObject->testStruct22(s1); +} + + +inline void TesterRemoteObject::testStruct23(const Struct2& s1, Struct2& s2) +{ + _pServiceObject->testStruct23(s1, s2); +} + + +inline Struct3 TesterRemoteObject::testStruct31(const Struct3& s1) +{ + return _pServiceObject->testStruct31(s1); +} + + +inline void TesterRemoteObject::testStruct32(Struct3& s1) +{ + _pServiceObject->testStruct32(s1); +} + + +inline void TesterRemoteObject::testStruct33(const Struct3& s1, Struct3& s2) +{ + _pServiceObject->testStruct33(s1, s2); +} + + +inline Struct4 TesterRemoteObject::testStruct41(const Struct4& s1) +{ + return _pServiceObject->testStruct41(s1); +} + + +inline void TesterRemoteObject::testStruct42(Struct4& s1) +{ + _pServiceObject->testStruct42(s1); +} + + +inline void TesterRemoteObject::testStruct43(const Struct4& s1, Struct4& s2) +{ + _pServiceObject->testStruct43(s1, s2); +} + + +inline Struct5 TesterRemoteObject::testStruct51(const Struct5& s1) +{ + return _pServiceObject->testStruct51(s1); +} + + +inline void TesterRemoteObject::testStruct52(Struct5& s1) +{ + _pServiceObject->testStruct52(s1); +} + + +inline void TesterRemoteObject::testStruct53(const Struct5& s1, Struct5& s2) +{ + _pServiceObject->testStruct53(s1, s2); +} + + +inline void TesterRemoteObject::testSynchronized() +{ + Poco::FastMutex::ScopedLock lock(mutex()); + _pServiceObject->testSynchronized(); +} + + +inline void TesterRemoteObject::testSynchronizedProxy() +{ + _pServiceObject->testSynchronizedProxy(); +} + + +inline void TesterRemoteObject::testSynchronizedRemote() +{ + Poco::FastMutex::ScopedLock lock(mutex()); + _pServiceObject->testSynchronizedRemote(); +} + + +inline bool TesterRemoteObject::verifyCookie() +{ + return _pServiceObject->verifyCookie(); +} + + + + +#endif // TesterRemoteObject_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/TesterServerHelper.cpp b/RemotingNG/HTTP/testsuite/src/TesterServerHelper.cpp new file mode 100644 index 0000000000..64692b3112 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterServerHelper.cpp @@ -0,0 +1,79 @@ +// +// TesterServerHelper.cpp +// +// Package: Generated +// Module: TesterServerHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterServerHelper.h" +#include "Poco/RemotingNG/URIUtility.h" +#include "Poco/SingletonHolder.h" +#include "TesterSkeleton.h" + + +namespace +{ + Poco::SingletonHolder shTesterServerHelper; +} + + +TesterServerHelper::TesterServerHelper(): + _pORB(0) +{ + _pORB = &Poco::RemotingNG::ORB::instance(); + registerSkeleton(); +} + + +TesterServerHelper::~TesterServerHelper() +{ +} + + +void TesterServerHelper::shutdown() +{ + TesterServerHelper::instance().unregisterSkeleton(); + shTesterServerHelper.reset(); +} + + +Poco::AutoPtr TesterServerHelper::createRemoteObjectImpl(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid) +{ + return new TesterRemoteObject(oid, pServiceObject); +} + + +TesterServerHelper& TesterServerHelper::instance() +{ + return *shTesterServerHelper.get(); +} + + +std::string TesterServerHelper::registerObjectImpl(Poco::AutoPtr pRemoteObject, const std::string& listenerId) +{ + return _pORB->registerObject(pRemoteObject, listenerId); +} + + +void TesterServerHelper::registerSkeleton() +{ + _pORB->registerSkeleton("Tester", new TesterSkeleton); +} + + +void TesterServerHelper::unregisterObjectImpl(const std::string& uri) +{ + _pORB->unregisterObject(uri); +} + + +void TesterServerHelper::unregisterSkeleton() +{ + _pORB->unregisterSkeleton("Tester", true); +} + + diff --git a/RemotingNG/HTTP/testsuite/src/TesterServerHelper.h b/RemotingNG/HTTP/testsuite/src/TesterServerHelper.h new file mode 100644 index 0000000000..797468b939 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterServerHelper.h @@ -0,0 +1,105 @@ +// +// TesterServerHelper.h +// +// Package: Generated +// Module: TesterServerHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterServerHelper_INCLUDED +#define TesterServerHelper_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/ORB.h" +#include "Poco/RemotingNG/ServerHelper.h" +#include "Tester.h" +#include "TesterRemoteObject.h" + + +class TesterServerHelper +{ +public: + using Service = Tester; + + TesterServerHelper(); + /// Creates a TesterServerHelper. + + ~TesterServerHelper(); + /// Destroys the TesterServerHelper. + + static Poco::AutoPtr createRemoteObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid); + /// Creates and returns a RemoteObject wrapper for the given Tester instance. + + static std::string registerObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid, const std::string& listenerId); + /// Creates a RemoteObject wrapper for the given Tester instance + /// and registers it with the ORB and the Listener instance + /// uniquely identified by the Listener's ID. + /// + /// Returns the URI created for the object. + + static std::string registerRemoteObject(Poco::AutoPtr pRemoteObject, const std::string& listenerId); + /// Registers the given RemoteObject with the ORB and the Listener instance + /// uniquely identified by the Listener's ID. + /// + /// Returns the URI created for the object. + + static void shutdown(); + /// Removes the Skeleton for Tester from the ORB. + + static void unregisterObject(const std::string& uri); + /// Unregisters a service object identified by URI from the ORB. + +private: + static Poco::AutoPtr createRemoteObjectImpl(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid); + + static TesterServerHelper& instance(); + /// Returns a static instance of the helper class. + + std::string registerObjectImpl(Poco::AutoPtr pRemoteObject, const std::string& listenerId); + + void registerSkeleton(); + + void unregisterObjectImpl(const std::string& uri); + + void unregisterSkeleton(); + + Poco::RemotingNG::ORB* _pORB; +}; + + +inline Poco::AutoPtr TesterServerHelper::createRemoteObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid) +{ + return TesterServerHelper::instance().createRemoteObjectImpl(pServiceObject, oid); +} + + +inline std::string TesterServerHelper::registerObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid, const std::string& listenerId) +{ + return TesterServerHelper::instance().registerObjectImpl(createRemoteObject(pServiceObject, oid), listenerId); +} + + +inline std::string TesterServerHelper::registerRemoteObject(Poco::AutoPtr pRemoteObject, const std::string& listenerId) +{ + return TesterServerHelper::instance().registerObjectImpl(pRemoteObject, listenerId); +} + + +inline void TesterServerHelper::unregisterObject(const std::string& uri) +{ + TesterServerHelper::instance().unregisterObjectImpl(uri); +} + + + + +REMOTING_SPECIALIZE_SERVER_HELPER(, Tester) + + +#endif // TesterServerHelper_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/TesterSkeleton.cpp b/RemotingNG/HTTP/testsuite/src/TesterSkeleton.cpp new file mode 100644 index 0000000000..bb74ad798c --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterSkeleton.cpp @@ -0,0 +1,2665 @@ +// +// TesterSkeleton.cpp +// +// Package: Generated +// Module: TesterSkeleton +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterSkeleton.h" +#include "Class1Deserializer.h" +#include "Class1Serializer.h" +#include "Poco/RemotingNG/Deserializer.h" +#include "Poco/RemotingNG/MethodHandler.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/RemotingNG/ServerTransport.h" +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Poco/SharedPtr.h" +#include "Struct1Deserializer.h" +#include "Struct1Serializer.h" +#include "Struct2Deserializer.h" +#include "Struct2Serializer.h" +#include "Struct3Deserializer.h" +#include "Struct3Serializer.h" +#include "Struct4Deserializer.h" +#include "Struct4Serializer.h" +#include "Struct5Deserializer.h" +#include "Struct5Serializer.h" + + +class TesterSetCookieMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"setCookie"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->setCookie(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("setCookieReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::setCookie"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::setCookie"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::setCookie"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestAuthenticatedMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testAuthenticated"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + if (!remoting__trans.authenticate(REMOTING__NAMES[0])) + throw Poco::RemotingNG::AuthenticationFailedException(); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testAuthenticated(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testAuthenticatedReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testAuthenticated"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testAuthenticated"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testAuthenticated"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestClass11MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass11"s,"c1"s}; + bool remoting__requestSucceeded = false; + try + { + Class1 c1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, c1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Class1 remoting__return = remoting__pCastedRO->testClass11(c1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass11Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testClass11"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testClass11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testClass11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestClass12MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass12"s,"c1"s}; + bool remoting__requestSucceeded = false; + try + { + Class1 c1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, c1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testClass12(c1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass12Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], c1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testClass12"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testClass12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testClass12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestClass13MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass13"s,"c1"s,"c2"s}; + bool remoting__requestSucceeded = false; + try + { + Class1 c1; + Class1 c2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, c1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testClass13(c1, c2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass13Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], c2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testClass13"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testClass13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testClass13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum11MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum11"s,"e1"s}; + bool remoting__requestSucceeded = false; + try + { + Enum1 e1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Enum1 remoting__return = remoting__pCastedRO->testEnum11(e1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum11Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum11"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum12MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum12"s,"e1"s}; + bool remoting__requestSucceeded = false; + try + { + Enum1 e1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testEnum12(e1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum12Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], e1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum12"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum13MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum13"s,"e1"s,"e2"s}; + bool remoting__requestSucceeded = false; + try + { + Enum1 e1; + Enum1 e2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testEnum13(e1, e2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum13Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], e2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum13"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum21MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum21"s,"e1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1::Enum2 e1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct1::Enum2 remoting__return = remoting__pCastedRO->testEnum21(e1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum21Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum21"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum21"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum21"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum22MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum22"s,"e1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1::Enum2 e1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testEnum22(e1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum22Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], e1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum22"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum22"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum22"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum23MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum23"s,"e1"s,"e2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1::Enum2 e1; + Struct1::Enum2 e2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testEnum23(e1, e2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum23Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], e2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum23"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum23"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum23"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestFaultMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testFault"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testFault(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testFaultReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testFault"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testFault"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testFault"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestInt1MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt1"s,"Value"s}; + bool remoting__requestSucceeded = false; + try + { + int i; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, i); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + int remoting__return = remoting__pCastedRO->testInt1(i); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt1Response"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testInt1"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testInt1"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testInt1"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestInt2MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt2"s,"Value"s}; + bool remoting__requestSucceeded = false; + try + { + int i; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, i); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testInt2(i); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt2Response"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], i, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testInt2"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testInt2"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testInt2"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestInt3MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt3"s,"Value1"s,"Value2"s}; + bool remoting__requestSucceeded = false; + try + { + int i1; + int i2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, i1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testInt3(i1, i2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt3Response"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], i2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testInt3"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testInt3"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testInt3"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestNestedTypeMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testNestedType"s,"arg"s}; + bool remoting__requestSucceeded = false; + try + { + Poco::Int64 arg; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, arg); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Poco::Int64 remoting__return = remoting__pCastedRO->testNestedType(arg); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testNestedTypeReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testNestedType"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testNestedType"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testNestedType"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestOneWayMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testOneWay"s,"arg"s}; + std::string arg; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, arg); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + try + { + remoting__pCastedRO->testOneWay(arg); + } + catch (...) + { + } + } + +}; + + +class TesterTestOneWayResultMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testOneWayResult"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + std::string remoting__return = remoting__pCastedRO->testOneWayResult(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testOneWayResultReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testOneWayResult"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testOneWayResult"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testOneWayResult"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestPermissionMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testPermission"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + if (!remoting__trans.authenticate(REMOTING__NAMES[0])) + throw Poco::RemotingNG::AuthenticationFailedException(); + static const std::string REMOTING__PERMISSION("perm1"); + if (!remoting__trans.authorize(REMOTING__NAMES[0], REMOTING__PERMISSION)) + throw Poco::RemotingNG::NoPermissionException(REMOTING__PERMISSION); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testPermission(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testPermissionReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testPermission"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testPermission"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testPermission"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestPtrMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testPtr"s,"p1"s}; + bool remoting__requestSucceeded = false; + try + { + Poco::SharedPtr p1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, remoting__deser, p1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Poco::SharedPtr remoting__return = remoting__pCastedRO->testPtr(p1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testPtrReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer>::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testPtr"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testPtr"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testPtr"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct11MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct11"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct1 remoting__return = remoting__pCastedRO->testStruct11(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct11Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct11"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct12MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct12"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct12(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct12Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct12"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct13MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct13"s,"s1"s,"s2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1 s1; + Struct1 s2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct13(s1, s2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct13Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct13"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct1Vec1MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec1"s,"vec"s}; + bool remoting__requestSucceeded = false; + try + { + std::vector vec; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, remoting__deser, vec); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + std::vector remoting__return = remoting__pCastedRO->testStruct1Vec1(vec); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec1Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer>::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct1Vec1"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct1Vec1"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct1Vec1"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct1Vec2MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec2"s,"vec"s}; + bool remoting__requestSucceeded = false; + try + { + std::vector vec; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, remoting__deser, vec); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct1Vec2(vec); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec2Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[1], vec, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct1Vec2"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct1Vec2"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct1Vec2"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct1Vec3MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec3"s,"vec1"s,"vec2"s}; + bool remoting__requestSucceeded = false; + try + { + std::vector vec1; + std::vector vec2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, remoting__deser, vec1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct1Vec3(vec1, vec2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec3Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[2], vec2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct1Vec3"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct1Vec3"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct1Vec3"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct21MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct21"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct2 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct2 remoting__return = remoting__pCastedRO->testStruct21(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct21Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct21"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct21"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct21"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct22MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct22"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct2 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct22(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct22Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct22"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct22"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct22"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct23MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct23"s,"s1"s,"s2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct2 s1; + Struct2 s2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct23(s1, s2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct23Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct23"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct23"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct23"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct31MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct31"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct3 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct3 remoting__return = remoting__pCastedRO->testStruct31(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct31Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct31"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct31"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct31"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct32MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct32"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct3 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct32(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct32Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct32"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct32"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct32"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct33MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct33"s,"s1"s,"s2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct3 s1; + Struct3 s2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct33(s1, s2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct33Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct33"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct33"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct33"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct41MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct41"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct4 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct4 remoting__return = remoting__pCastedRO->testStruct41(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct41Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct41"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct41"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct41"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct42MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct42"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct4 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct42(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct42Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct42"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct42"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct42"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct43MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct43"s,"s1"s,"s2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct4 s1; + Struct4 s2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct43(s1, s2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct43Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct43"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct43"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct43"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct51MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct51"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct5 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct5 remoting__return = remoting__pCastedRO->testStruct51(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct51Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct51"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct51"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct51"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct52MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct52"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct5 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct52(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct52Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct52"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct52"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct52"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct53MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct53"s,"s1"s,"s2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct5 s1; + Struct5 s2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct53(s1, s2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct53Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct53"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct53"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct53"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestSynchronizedMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronized"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testSynchronized(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testSynchronized"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testSynchronized"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testSynchronized"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestSynchronizedProxyMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronizedProxy"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testSynchronizedProxy(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedProxyReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testSynchronizedProxy"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testSynchronizedProxy"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testSynchronizedProxy"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestSynchronizedRemoteMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronizedRemote"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testSynchronizedRemote(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedRemoteReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testSynchronizedRemote"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testSynchronizedRemote"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testSynchronizedRemote"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterVerifyCookieMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"verifyCookie"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + bool remoting__return = remoting__pCastedRO->verifyCookie(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("verifyCookieReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::verifyCookie"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::verifyCookie"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::verifyCookie"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +TesterSkeleton::TesterSkeleton(): + Poco::RemotingNG::Skeleton() + +{ + using namespace std::string_literals; + + addMethodHandler("TestInt1"s, new TesterTestInt1MethodHandler); + addMethodHandler("TestInt2"s, new TesterTestInt2MethodHandler); + addMethodHandler("TestInt3"s, new TesterTestInt3MethodHandler); + addMethodHandler("setCookie"s, new TesterSetCookieMethodHandler); + addMethodHandler("testAuthenticated"s, new TesterTestAuthenticatedMethodHandler); + addMethodHandler("testClass11"s, new TesterTestClass11MethodHandler); + addMethodHandler("testClass12"s, new TesterTestClass12MethodHandler); + addMethodHandler("testClass13"s, new TesterTestClass13MethodHandler); + addMethodHandler("testEnum11"s, new TesterTestEnum11MethodHandler); + addMethodHandler("testEnum12"s, new TesterTestEnum12MethodHandler); + addMethodHandler("testEnum13"s, new TesterTestEnum13MethodHandler); + addMethodHandler("testEnum21"s, new TesterTestEnum21MethodHandler); + addMethodHandler("testEnum22"s, new TesterTestEnum22MethodHandler); + addMethodHandler("testEnum23"s, new TesterTestEnum23MethodHandler); + addMethodHandler("testFault"s, new TesterTestFaultMethodHandler); + addMethodHandler("testNestedType"s, new TesterTestNestedTypeMethodHandler); + addMethodHandler("testOneWay"s, new TesterTestOneWayMethodHandler); + addMethodHandler("testOneWayResult"s, new TesterTestOneWayResultMethodHandler); + addMethodHandler("testPermission"s, new TesterTestPermissionMethodHandler); + addMethodHandler("testPtr"s, new TesterTestPtrMethodHandler); + addMethodHandler("testStruct11"s, new TesterTestStruct11MethodHandler); + addMethodHandler("testStruct12"s, new TesterTestStruct12MethodHandler); + addMethodHandler("testStruct13"s, new TesterTestStruct13MethodHandler); + addMethodHandler("testStruct1Vec1"s, new TesterTestStruct1Vec1MethodHandler); + addMethodHandler("testStruct1Vec2"s, new TesterTestStruct1Vec2MethodHandler); + addMethodHandler("testStruct1Vec3"s, new TesterTestStruct1Vec3MethodHandler); + addMethodHandler("testStruct21"s, new TesterTestStruct21MethodHandler); + addMethodHandler("testStruct22"s, new TesterTestStruct22MethodHandler); + addMethodHandler("testStruct23"s, new TesterTestStruct23MethodHandler); + addMethodHandler("testStruct31"s, new TesterTestStruct31MethodHandler); + addMethodHandler("testStruct32"s, new TesterTestStruct32MethodHandler); + addMethodHandler("testStruct33"s, new TesterTestStruct33MethodHandler); + addMethodHandler("testStruct41"s, new TesterTestStruct41MethodHandler); + addMethodHandler("testStruct42"s, new TesterTestStruct42MethodHandler); + addMethodHandler("testStruct43"s, new TesterTestStruct43MethodHandler); + addMethodHandler("testStruct51"s, new TesterTestStruct51MethodHandler); + addMethodHandler("testStruct52"s, new TesterTestStruct52MethodHandler); + addMethodHandler("testStruct53"s, new TesterTestStruct53MethodHandler); + addMethodHandler("testSynchronized"s, new TesterTestSynchronizedMethodHandler); + addMethodHandler("testSynchronizedProxy"s, new TesterTestSynchronizedProxyMethodHandler); + addMethodHandler("testSynchronizedRemote"s, new TesterTestSynchronizedRemoteMethodHandler); + addMethodHandler("verifyCookie"s, new TesterVerifyCookieMethodHandler); +} + + +TesterSkeleton::~TesterSkeleton() +{ +} + + +const std::string TesterSkeleton::DEFAULT_NS("urn:appinf.com:service:Tester:1"); diff --git a/RemotingNG/HTTP/testsuite/src/TesterSkeleton.h b/RemotingNG/HTTP/testsuite/src/TesterSkeleton.h new file mode 100644 index 0000000000..5f5f5fecf0 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/TesterSkeleton.h @@ -0,0 +1,44 @@ +// +// TesterSkeleton.h +// +// Package: Generated +// Module: TesterSkeleton +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterSkeleton_INCLUDED +#define TesterSkeleton_INCLUDED + + +#include "Poco/RemotingNG/Skeleton.h" +#include "TesterRemoteObject.h" + + +class TesterSkeleton: public Poco::RemotingNG::Skeleton +{ +public: + TesterSkeleton(); + /// Creates a TesterSkeleton. + + virtual ~TesterSkeleton(); + /// Destroys a TesterSkeleton. + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + + static const std::string DEFAULT_NS; +}; + + +inline const Poco::RemotingNG::Identifiable::TypeId& TesterSkeleton::remoting__typeId() const +{ + return ITester::remoting__typeId(); +} + + + + +#endif // TesterSkeleton_INCLUDED + diff --git a/RemotingNG/HTTP/testsuite/src/WinDriver.cpp b/RemotingNG/HTTP/testsuite/src/WinDriver.cpp new file mode 100644 index 0000000000..336a5885c9 --- /dev/null +++ b/RemotingNG/HTTP/testsuite/src/WinDriver.cpp @@ -0,0 +1,30 @@ +// +// WinDriver.cpp +// +// Windows test driver for Poco RemotingNG HTTP. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "WinTestRunner/WinTestRunner.h" +#include "HTTPTestSuite.h" + + +class TestDriver: public CppUnit::WinTestRunnerApp +{ + void TestMain() + { + CppUnit::WinTestRunner runner; + runner.addTest(HTTPTestSuite::suite()); + runner.run(); + } +}; + + +TestDriver theDriver; diff --git a/RemotingNG/JSONRPC/CMakeLists.txt b/RemotingNG/JSONRPC/CMakeLists.txt new file mode 100644 index 0000000000..b642eaa15e --- /dev/null +++ b/RemotingNG/JSONRPC/CMakeLists.txt @@ -0,0 +1,37 @@ +# Sources +file(GLOB SRCS_JSONRPC_G "src/*.cpp") +POCO_SOURCES_AUTO(SRCS_JSONRPC ${SRCS_JSONRPC_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "include/*.h") +POCO_HEADERS_AUTO(SRCS_JSONRPC ${HDRS_G}) + +# Version Resource +if(MSVC AND BUILD_SHARED_LIBS) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) + list(APPEND SRCS_JSONRPC ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) +endif() + +add_library(RemotingNGJSONRPC ${SRCS_JSONRPC}) +add_library(Poco::RemotingNGJSONRPC ALIAS RemotingNGJSONRPC) +set_target_properties(RemotingNGJSONRPC + PROPERTIES + VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} + OUTPUT_NAME PocoRemotingNGJSONRPC + DEFINE_SYMBOL RemotingNGJSONRPC_EXPORTS +) + +target_link_libraries(RemotingNGJSONRPC PUBLIC Poco::Foundation Poco::Net Poco::RemotingNG) +target_include_directories(RemotingNGJSONRPC + PUBLIC + $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src +) + +POCO_INSTALL(RemotingNGJSONRPC) +POCO_GENERATE_PACKAGE(RemotingNGJSONRPC) + +if(ENABLE_TESTS) + add_subdirectory(testsuite) +endif() diff --git a/RemotingNG/JSONRPC/Makefile b/RemotingNG/JSONRPC/Makefile new file mode 100644 index 0000000000..973af99ac9 --- /dev/null +++ b/RemotingNG/JSONRPC/Makefile @@ -0,0 +1,17 @@ +# +# Makefile +# +# Makefile for Poco RemotingNG JSONRPC Transport +# + +include $(POCO_BASE)/build/rules/global + +objects = Deserializer Listener Serializer Transport TransportFactory CookieStore \ + JSONRPCRequestHandler JSONRPCRequestHandlerFactory \ + JSValue JSScalar JSObject JSArray JSONParser + +target = PocoRemotingNGJSONRPC +target_version = $(LIBVERSION) +target_libs = PocoRemotingNG PocoNet PocoFoundation $(POCO_LICENSING) + +include $(POCO_BASE)/build/rules/lib diff --git a/RemotingNG/JSONRPC/cmake/PocoRemotingNGJSONRPCConfig.cmake b/RemotingNG/JSONRPC/cmake/PocoRemotingNGJSONRPCConfig.cmake new file mode 100644 index 0000000000..c447552599 --- /dev/null +++ b/RemotingNG/JSONRPC/cmake/PocoRemotingNGJSONRPCConfig.cmake @@ -0,0 +1,5 @@ +include(CMakeFindDependencyMacro) +find_dependency(PocoFoundation) +find_dependency(PocoNet) +find_dependency(PocoRemotingNG) +include("${CMAKE_CURRENT_LIST_DIR}/PocoRemotingNGJSONRPCTargets.cmake") diff --git a/RemotingNG/JSONRPC/dependencies b/RemotingNG/JSONRPC/dependencies new file mode 100644 index 0000000000..1a0d5344ca --- /dev/null +++ b/RemotingNG/JSONRPC/dependencies @@ -0,0 +1,3 @@ +RemotingNG +Net +Foundation diff --git a/RemotingNG/JSONRPC/doc/00230-RemotingNGJSONRPCTransportUserGuide.page b/RemotingNG/JSONRPC/doc/00230-RemotingNGJSONRPCTransportUserGuide.page new file mode 100644 index 0000000000..d682fff302 --- /dev/null +++ b/RemotingNG/JSONRPC/doc/00230-RemotingNGJSONRPCTransportUserGuide.page @@ -0,0 +1,245 @@ +Remoting NG JSON-RPC Transport User Guide +Remoting NG + +!!!Introduction + +The JSON-RPC Transport is a very lightweight HTTP-based Transport implementation, +supporting the [[http://www.jsonrpc.org/specification JSON-RPC 2.0]] +protocol specification. + +This transport is a good choice if web browser-based JavaScript applications +need to invoke native methods on the server. + +The JSON-RPC transport supports the following features: + + - HTTP compression (GZIP content transfer encoding) for requests and responses. + - HTTP authentication (basic or digest, client only) + - CORS ([[http://www.w3.org/TR/cors/ Cross-Origin Resource Sharing]]) + - HTTPS + + +!!!Basic JSON-RPC Transport Usage + +!!Server Usage + +To use the JSON-RPC Transport in a server, the following three steps must +be performed: + + 1. Register the Poco::RemotingNG::JSONRPC::TransportFactory with the ORB, + 2. Optionally configure the listener (e.g., to enable CORS), + 3. Register the Listener with the ORB, and finally, + 4. Register the individual objects with the ORB. + +Following is an example code fragment for setting up a JSON-RPC Listener, +configuring it to enable CORS (from any origin), +and registering a service object for use with the listener. + + Poco::RemotingNG::JSONRPC::Listener::Ptr pListener = new Poco::RemotingNG::JSONRPC::Listener("localhost:8080"); + pListener->enableCORS(true); + std::string listener = Poco::RemotingNG::ORB::instance().registerListener(pListener); + + st::string uri = Sample::TimeServiceServerHelper::registerObject( + new Sample::TimeService, + "TheTimeService", + listener + ); +---- + +Please see the Poco::RemotingNG::JSONRPC::Listener class documentation for detailed information +about how to setup and configure the listener. + + +!!Client Usage + +To use the JSON-RPC Transport in a client, the following two steps +must be performed: + + 1. Register the Poco::RemotingNG::JSONRPC::TransportFactory with the ORB, and + 2. Retrieve the interface (proxy) object using the helper class. + +Following is an example code fragment for setting up a JSON-RPC Transport, +and obtaining a Proxy object for invoking methods on the service object. + + Poco::RemotingNG::JSONRPC::TransportFactory::registerFactory(); + Sample::ITimeService::Ptr pTimeService = MyProject::MyClassHelper::find( + "http://localhost:8080/jsonrpc/TimeService/TheTimeService"); + ); +---- + + +!Configuring The Client Transport + +To configure the client transport (e.g., to , +enable HTTP compression, or HTTP authentication), the Transport object must +be obtained from the proxy. This is done in two steps. First, the interface +pointer obtained from the client helper must be casted to a proxy: + + Poco::RemotingNG::Proxy::Ptr pProxy = pTimeService.cast(); +---- + +Second, the Transport object can be obtained from the proxy: + + Poco::RemotingNG::JSONRPC::Transport& trans = static_cast(pProxy->remoting__transport()); +---- + +These two casts can also be put into a utility function <[transportFromInterface()]>: + + template + Poco::RemotingNG::JSONRPC::Transport& transportFromInterface(Poco::AutoPtr pInterface) + { + Poco::RemotingNG::Proxy::Ptr pProxy = pInterface.template cast(); + if (pProxy) + { + return static_cast(pProxy->remoting__transport()); + } + else throw Poco::BadCastException(); + } +---- + +Using the <[transportFromInterface()]> function, we can write: + + Poco::RemotingNG::JSONRPC::Transport& trans = transportFromInterface(pTimeService); +---- + + +Now that we have access to the Transport object, we can configure it: + + trans.enableCompression(true); +---- + +Configuration should be done before the first method is invoked over the proxy. + +Please see the Poco::RemotingNG::JSONRPC::Transport class documentation for other +configuration options, including timeouts and user-agent string. + + +!Enabling HTTP Authentication + +The JSON-RPC Transport supports HTTP Basic and Digest authentication. To enable authentication +for a proxy object, first obtain the Transport object as shown in the previous section. +HTTP Basic Authentication can then be enabled with: + + trans.setAuthentication(Poco::RemotingNG::JSONRPC::Transport::AUTH_BASIC); + trans.setUsername("user"); + trans.setPassword("s3cr3t"); +---- + +To enable HTTP Digest Authentication: + + trans.setAuthentication(Poco::RemotingNG::JSONRPC::Transport::AUTH_DIGEST); + trans.setUsername("user"); + trans.setPassword("s3cr3t"); + trans.enableChunkedTransferEncoding(false); +---- + +Please note that chunked transfer encoding must be disabled in order to use HTTP Digest +Authentication. + +It is also possible to enable both Basic and Digest authentication and use whatever +the server requests: + + trans.setAuthentication(Poco::RemotingNG::JSONRPC::Transport::AUTH_ANY); + trans.setUsername("user"); + trans.setPassword("s3cr3t"); + trans.enableChunkedTransferEncoding(false); +---- + + +!Cookies + +The JSONRPC Transport supports HTTP cookies. Any cookies sent by the server through +a HTTP response will be sent back to the server with subsequent HTTP requests. +The lifetime (maximum age) of cookies, if set, will be honored, and expired cookies +will not be sent back to the server. + +Cookies are mostly useful for session-based authentication. The cookies stored +in a Transport object can be obtained and shared with a different Transport +object. This is useful if a JSONRPC server uses session cookies for authentication +and the same session needs to be used by multiple proxy instances. + +Cookies are stored in a Poco::RemotingNG::JSONRPC::CookieStore object. A pointer +(Poco::RemotingNG::JSONRPC::CookieStore::Ptr) to this object can be obtained +by calling Poco::RemotingNG::JSONRPC::Transport::getCookieStore(). The cookie +store can then be shared with a different Transport by calling +Poco::RemotingNG::JSONRPC::Transport::setCookieStore(). + + +!!Performance Considerations + +The performance of the JSON-RPC Transport is considerably lower than +the that of the TCP Transport. Some of the reasons +for this are: + + * JSON generation and especially JSON parsing overhead, + * JSON uses more bandwidth than a binary protocol, and + * the HTTP overhead is larger than the overhead for a + simple socket connection. + +Applications for which remote method call performance is critical, +and which do not need to work with non Remoting applications +should therefore prefer the TCP transport to the JSON-RPC +transport. + + +!!Text Encoding Considerations + +All strings used in remote interfaces must be properly UTF-8 encoded +when using the JSON-RPC transport. Encoding errors may lead to failures +when parsing JSON-RPC request or response messages. + + +!!!Interoperability + +The Remoting NG JSON-RPC Transport should work well with other JSON-RPC 2.0 +client or server implementations. The client always passes arguments by +name (as object), however, the server can handle objects passed by name and +by position (as array). +Furthermore, the JSON-RPC Transport does not support batched requests. + + +!!!Using The JSON-RPC Transport With HTTPS + +The JSON-RPC transport normally uses a plain, unencrypted HTTP +connection between the client and the server. To make the JSON-RPC Transport use a secure +HTTP socket connection, the following steps must be performed. + + +!!HTTPS On The Server Side + +On the server side, the listener must be created using a +Poco::Net::SecureServerSocket. + + Poco::Net::SecureServerSocket serverSocket(8443); + std::string listener = Poco::RemotingNG::ORB::instance().registerListener( + new Poco::RemotingNG::JSONRPC::Listener("localhost:8443", serverSocket) + ); + std::string uri = MyProject::MyClassHelper::registerObject( + new MyProject::MyClass, + "MyObject", + listener + ); +---- + + +!!HTTPS On The Client Side + +On the client side, the JSON-RPC transport uses a private +Poco::Net::HTTPSessionFactory object to create +the Poco::Net::HTTPClientSession for talking to the server. +So, all that needs to be done to enable HTTPS on the +client is to register the Poco::Net::HTTPSSessionInstantiator +with the session factory. Then, a https URI can be used to +access the web service. + + Poco::RemotingNG::JSONRPC::Transport::httpSessionFactory().registerProtocol( + "https", + new Poco::Net::HTTPSSessionInstantiator + ); + + Poco::RemotingNG::JSONRPC::TransportFactory::registerFactory(); + + MyProject::IMyClass::Ptr pObj = MyProject::MyClassHelper::find( + "https://localhost:8443/jsonrpc/MyClass/TheObject" + ); +---- + diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/CookieStore.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/CookieStore.h new file mode 100644 index 0000000000..c150962bf9 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/CookieStore.h @@ -0,0 +1,84 @@ +// +// CookieStore.h +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: CookieStore +// +// Definition of the CookieStore class. +// +// Copyright (c) 2006-2012, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_CookieStore_INCLUDED +#define RemotingNG_JSONRPC_CookieStore_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "Poco/Net/HTTPRequest.h" +#include "Poco/Net/HTTPResponse.h" +#include "Poco/Net/HTTPCookie.h" +#include "Poco/RefCountedObject.h" +#include "Poco/Timestamp.h" +#include "Poco/AutoPtr.h" +#include "Poco/Mutex.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API CookieStore: public Poco::RefCountedObject + /// A CookieStore object stores cookies set by a JSONRPC server. + /// + /// Normally, each Transport (and thus Proxy) instance has its own cookie + /// store instance. However, CookieStore objects can also be shared + /// among multiple Transport instances connected to the same server. + /// + /// A typical use case for this is sharing session cookies among all + /// Transport/Proxy instances connected to the same server. + /// + /// Note: The application must take care that CookieStore objects are + /// only shared among Transport instances connected to the same server. +{ +public: + using Ptr = Poco::AutoPtr; + + CookieStore(); + /// Creates an empty CookieStore. + + ~CookieStore(); + /// Destroys the CookieStore. + + void addCookies(Poco::Net::HTTPRequest& request); + /// Adds the stored cookies to the given request object. + + void updateCookies(const Poco::Net::HTTPResponse& response); + /// Updates the stored cookies with the cookies from + /// the given response object. + +private: + struct CookieInfo + { + Poco::Net::HTTPCookie cookie; + Poco::Timestamp expireTime; + }; + using CookieMap = std::map; + + CookieMap _cookies; + Poco::FastMutex _mutex; +}; + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_CookieStore_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Deserializer.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Deserializer.h new file mode 100644 index 0000000000..0994399cad --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Deserializer.h @@ -0,0 +1,108 @@ +// +// Deserializer.h +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: Deserializer +// +// Definition of the Deserializer class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_Deserializer_INCLUDED +#define RemotingNG_JSONRPC_Deserializer_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "Poco/RemotingNG/JSONRPC/Serializer.h" +#include "Poco/RemotingNG/JSONRPC/JSValue.h" +#include "Poco/RemotingNG/Deserializer.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API Deserializer: public Poco::RemotingNG::Deserializer + /// The Deserializer implementation for the JSONRPC Transport. + /// + /// For more information, please see the Serializer documentation. +{ +public: + Deserializer(); + /// Creates the Deserializer. + + ~Deserializer(); + /// Destroys the Deserializer. + + // Poco::RemotingNG::Deserializer + Poco::RemotingNG::SerializerBase::MessageType findMessage(std::string& name); + void deserializeMessageBegin(const std::string& name, SerializerBase::MessageType type); + void deserializeMessageEnd(const std::string& name, SerializerBase::MessageType type); + bool deserializeStructBegin(const std::string& name, bool isMandatory); + void deserializeStructEnd(const std::string& name); + bool deserializeSequenceBegin(const std::string& name, bool isMandatory, Poco::UInt32& lengthHint); + void deserializeSequenceEnd(const std::string& name); + bool deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull); + void deserializeNullableEnd(const std::string& name); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int8& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt8& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int16& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt16& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int32& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt32& val); + bool deserialize(const std::string& name, bool isMandatory, long& val); + bool deserialize(const std::string& name, bool isMandatory, unsigned long& val); +#ifndef POCO_INT64_IS_LONG + bool deserialize(const std::string& name, bool isMandatory, Poco::Int64& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt64& val); +#endif + bool deserialize(const std::string& name, bool isMandatory, float& val); + bool deserialize(const std::string& name, bool isMandatory, double& val); + bool deserialize(const std::string& name, bool isMandatory, bool& val); + bool deserialize(const std::string& name, bool isMandatory, char& val); + bool deserialize(const std::string& name, bool isMandatory, std::string& val); + bool deserialize(const std::string& name, bool isMandatory, std::vector& val); + int id() const; + void associateSerializer(Serializer& ser); + +protected: + void resetImpl(); + void setupImpl(std::istream& inStream); + +private: + Deserializer(const Deserializer&); + Deserializer& operator=(const Deserializer&); + + JSValue::Ptr findValue(const std::string& name, bool isMandatory, bool& found); + +private: + std::vector _objectStack; + std::vector _indexStack; + int _id; + Serializer* _pAssociatedSerializer; +}; + + +// +// inlines +// +inline int Deserializer::id() const +{ + return _id; +} + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_Deserializer_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSArray.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSArray.h new file mode 100644 index 0000000000..5eebe74ab6 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSArray.h @@ -0,0 +1,65 @@ +// +// JSArray.h +// +// Library: RemotingNG/JSONRPC +// Package: JSValue +// Module: JSArray +// +// Definition of the JSArray class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_JSArray_INCLUDED +#define RemotingNG_JSONRPC_JSArray_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSValue.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API JSArray: public JSValue + /// This class represents a JSON Array. + /// + /// Internal representation is a std::vector. + /// Element access is by numeric index (0 .. size - 1). + /// + /// The JSArray can be grown by accessing the size-th + /// element. +{ +public: + JSArray(); + /// Creates an empty JSArray. + + // JSValue + Type type() const; + std::size_t size() const; + const Ptr& operator [] (std::size_t index) const; + Ptr& operator [] (std::size_t index); + +protected: + ~JSArray(); + /// Destroys the JSArray. + +private: + using Vector = std::vector; + + Vector _vector; +}; + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_JSArray_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONParser.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONParser.h new file mode 100644 index 0000000000..861eea36f0 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONParser.h @@ -0,0 +1,106 @@ +// +// JSONParser.h +// +// Library: RemotingNG/JSONRPC +// Package: JSONParser +// Module: JSONParser +// +// Definition of the JSONParser class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_JSONParser_INCLUDED +#define RemotingNG_JSONRPC_JSONParser_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "Poco/RemotingNG/JSONRPC/JSValue.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API JSONParser + /// A simple parser for JSON. +{ +public: + JSONParser(std::istream& istr); + /// Creates a JSONParser for parsing the given stream. + + ~JSONParser(); + /// Destroys the JSONParser. + + JSValue::Ptr parse(); + /// Reads a JSValue from the stream. + + void setMaxDepth(std::size_t maxDepth); + /// Sets the maximum allowed depth of the JSON document. + + std::size_t getMaxDepth() const; + /// Returns the maximum allowed depth of the JSON document. + + constexpr static std::size_t MAX_DEPTH = 50; + +protected: + int parseValue(int ch, JSValue::Ptr& pValue); + int parseObject(int ch, JSValue::Ptr& pObject); + int parseArray(int ch, JSValue::Ptr& pArray); + int parseScalar(int ch, JSValue::Ptr& pScalar); + int parseString(int ch, std::string& str); + int parseUnicode(int ch, std::string& str); + int skipWhitespace(int ch); + static bool isWhitespace(int ch); + static bool isEOF(int ch); + +private: + JSONParser(); + JSONParser(const JSONParser&); + JSONParser& operator = (const JSONParser&); + + std::streambuf& _streambuf; + std::size_t _depth = 0; + std::size_t _maxDepth = MAX_DEPTH; +}; + + +// +// inlines +// +inline void JSONParser::setMaxDepth(std::size_t maxDepth) +{ + _maxDepth = maxDepth; +} + + +inline std::size_t JSONParser::getMaxDepth() const +{ + return _maxDepth; +} + + +inline bool JSONParser::isWhitespace(int ch) +{ + return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n' || ch == '\f'; +} + + +inline bool JSONParser::isEOF(int ch) +{ + return ch == -1; +} + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_JSONParser_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPC.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPC.h new file mode 100644 index 0000000000..19bc5506f9 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPC.h @@ -0,0 +1,62 @@ +// +// JSONRPC.h +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: JSONRPC +// +// Basic definitions for the Poco RemotingNG JSONRPC library. +// This file must be the first file included by every other JSONRPC +// header file. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_JSONRPC_INCLUDED +#define RemotingNG_JSONRPC_JSONRPC_INCLUDED + + +#ifndef Foundation_Foundation_INCLUDED +#include "Poco/Foundation.h" +#endif + + +// +// The following block is the standard way of creating macros which make exporting +// from a DLL simpler. All files within this DLL are compiled with the RemotingNGJSONRPC_EXPORTS +// symbol defined on the command line. This symbol should not be defined on any project +// that uses this DLL. This way any other project whose source files include this file sees +// RemotingNGJSONRPC_API functions as being imported from a DLL, whereas this DLL sees symbols +// defined with this macro as being exported. +// +#if defined(_WIN32) && defined(POCO_DLL) + #if defined(RemotingNGJSONRPC_EXPORTS) + #define RemotingNGJSONRPC_API __declspec(dllexport) + #else + #define RemotingNGJSONRPC_API __declspec(dllimport) + #endif +#endif + + +#if !defined(RemotingNGJSONRPC_API) + #define RemotingNGJSONRPC_API +#endif + + +// +// Automatically link JSON library. +// +#if defined(_MSC_VER) + #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(RemotingNGJSONRPC_EXPORTS) + #pragma comment(lib, "PocoRemotingNGJSONRPC" POCO_LIB_SUFFIX) + #endif +#endif + + +#endif // RemotingNG_JSONRPC_JSONRPC_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPCRequestHandler.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPCRequestHandler.h new file mode 100644 index 0000000000..ab10fe0252 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPCRequestHandler.h @@ -0,0 +1,61 @@ +// +// JSONRPCRequestHandler.h +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: JSONRPCRequestHandler +// +// Definition of the JSONRPCRequestHandler class. +// +// Copyright (c) 2006-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_JSONRPCRequestHandler_INCLUDED +#define RemotingNG_JSONRPC_JSONRPCRequestHandler_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "Poco/RemotingNG/JSONRPC/Listener.h" +#include "Poco/Net/HTTPRequestHandler.h" +#include "Poco/Logger.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API JSONRPCRequestHandler: public Poco::Net::HTTPRequestHandler + /// The HTTPRequestHandler implementation for RemotingNG JSONRPC. +{ +public: + JSONRPCRequestHandler(Listener& listener); + /// Creates a JSONRPCRequestHandler, using the given Listener. + + ~JSONRPCRequestHandler(); + /// Destroys the JSONRPCRequestHandler. + + // Poco::Net::HTTPRequestHandler + void handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response); + +protected: + bool handleCORS(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response); + +private: + JSONRPCRequestHandler(); + + Listener& _listener; + Poco::Logger& _logger; +}; + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_JSONRPCRequestHandler_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPCRequestHandlerFactory.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPCRequestHandlerFactory.h new file mode 100644 index 0000000000..2e90d237d8 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSONRPCRequestHandlerFactory.h @@ -0,0 +1,57 @@ +// +// JSONRPCRequestHandlerFactory.h +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: JSONRPCRequestHandlerFactory +// +// Definition of the JSONRPCRequestHandlerFactory class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_JSONRPCRequestHandlerFactory_INCLUDED +#define RemotingNG_JSONRPC_JSONRPCRequestHandlerFactory_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "Poco/Net/HTTPRequestHandlerFactory.h" +#include "Poco/Net/HTTPRequestHandler.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class Listener; + + +class RemotingNGJSONRPC_API JSONRPCRequestHandlerFactory: public Poco::Net::HTTPRequestHandlerFactory + /// A factory for JSONRPCRequestHandler objects. +{ +public: + JSONRPCRequestHandlerFactory(Listener& listener); + /// Creates the JSONRPCRequestHandlerFactory. + + ~JSONRPCRequestHandlerFactory(); + /// Destroys the JSONRPCRequestHandlerFactory. + + // Poco::Net::HTTPRequestHandlerFactory + Poco::Net::HTTPRequestHandler* createRequestHandler(const Poco::Net::HTTPServerRequest& request); + +private: + Listener& _listener; +}; + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_JSONRPCRequestHandlerFactory_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSObject.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSObject.h new file mode 100644 index 0000000000..410296f566 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSObject.h @@ -0,0 +1,64 @@ +// +// JSObject.h +// +// Library: RemotingNG/JSONRPC +// Package: JSValue +// Module: JSObject +// +// Definition of the JSObject class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_JSObject_INCLUDED +#define RemotingNG_JSONRPC_JSObject_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSValue.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API JSObject: public JSValue + /// This class represents a JSON Object. + /// + /// Internal representation is a std::map + /// from std::string to JSValue::Ptr. + /// Element access is by name. +{ +public: + JSObject(); + /// Creates an empty JSObject. + + // JSValue + Type type() const; + std::size_t size() const; + const Ptr& operator [] (const std::string& name) const; + Ptr& operator [] (const std::string& name); + bool has(const std::string& name) const; + +protected: + ~JSObject(); + /// Destroys the JSObject. + +private: + using Map = std::map; + + Map _map; +}; + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_JSObject_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSScalar.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSScalar.h new file mode 100644 index 0000000000..3708810f01 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSScalar.h @@ -0,0 +1,61 @@ +// +// JSScalar.h +// +// Library: RemotingNG/JSONRPC +// Package: JSValue +// Module: JSScalar +// +// Definition of the JSScalar class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_JSScalar_INCLUDED +#define RemotingNG_JSONRPC_JSScalar_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSValue.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API JSScalar: public JSValue + /// This class represents a scalar JSON value. + /// + /// Internal storage is always as std::string. +{ +public: + JSScalar(Type type = JS_STRING); + /// Creates an empty JSScalar with the given type. + + JSScalar(const std::string& value, Type type = JS_STRING); + /// Creates a JSScalar with the given value and type. + + // JSValue + Type type() const; + + const std::string& stringValue() const; + +protected: + ~JSScalar(); + /// Destroys the JSScalar. + +private: + std::string _value; + Type _type; +}; + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_JSScalar_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSValue.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSValue.h new file mode 100644 index 0000000000..dff5c70cc0 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/JSValue.h @@ -0,0 +1,136 @@ +// +// JSValue.h +// +// Library: RemotingNG/JSONRPC +// Package: JSValue +// Module: JSValue +// +// Definition of the JSValue class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_JSValue_INCLUDED +#define RemotingNG_JSONRPC_JSValue_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "Poco/RefCountedObject.h" +#include "Poco/NumberParser.h" +#include "Poco/AutoPtr.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API JSValue: public Poco::RefCountedObject + /// This class represents a generic JavaScript object. + /// + /// Subclasses implement scalar values, arrays and objects. +{ +public: + using Ptr = Poco::AutoPtr; + + enum Type + { + JS_OBJECT, + JS_ARRAY, + JS_STRING, + JS_NUMBER, + JS_BOOL + }; + + virtual Type type() const = 0; + /// Returns the type of the object. + + virtual std::size_t size() const; + /// Returns the size of the object. + + virtual const std::string& stringValue() const; + /// Returns the object's value as string. + + Poco::Int32 asInt32() const; + /// Returns the object's value as Int32. + + Poco::Int64 asInt64() const; + /// Returns the object's value as Int64. + + Poco::UInt32 asUInt32() const; + /// Returns the object's value as UInt32. + + Poco::UInt64 asUInt64() const; + /// Returns the object's value as UInt64. + + double asDouble() const; + /// Returns the object's value as double. + + bool asBool() const; + /// Returns the object's value as boolean. + + virtual const Ptr& operator [] (const std::string& name) const; + virtual Ptr& operator [] (const std::string& name); + + virtual const Ptr& operator [] (std::size_t index) const; + virtual Ptr& operator [] (std::size_t index); + + virtual bool has(const std::string& name) const; +}; + + +// +// inlines +// +inline Poco::Int32 JSValue::asInt32() const +{ + return Poco::NumberParser::parse(stringValue()); +} + + +inline Poco::Int64 JSValue::asInt64() const +{ + return Poco::NumberParser::parse64(stringValue()); +} + + +inline Poco::UInt32 JSValue::asUInt32() const +{ + return Poco::NumberParser::parseUnsigned(stringValue()); +} + + +inline Poco::UInt64 JSValue::asUInt64() const +{ + return Poco::NumberParser::parseUnsigned64(stringValue()); +} + + +inline double JSValue::asDouble() const +{ + return Poco::NumberParser::parseFloat(stringValue()); +} + + +inline bool JSValue::asBool() const +{ + const std::string& value = stringValue(); + if (value == "true") + return true; + else if (value == "false") + return false; + else throw Poco::SyntaxException("not a boolean value"); +} + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_JSValue_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Listener.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Listener.h new file mode 100644 index 0000000000..9527936818 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Listener.h @@ -0,0 +1,176 @@ +// +// Listener.h +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: Listener +// +// Definition of the Listener class. +// +// Copyright (c) 2006-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_Listener_INCLUDED +#define RemotingNG_JSONRPC_Listener_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "Poco/RemotingNG/Listener.h" +#include "Poco/Net/HTTPServerParams.h" +#include "Poco/Net/HTTPServer.h" +#include "Poco/Net/ServerSocket.h" +#include "Poco/SharedPtr.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API Listener: public Poco::RemotingNG::Listener + /// The RemotingNG Listener implementation for the JSONRPC transport. + /// + /// For more information, please see the Transport class. +{ +public: + using Ptr = Poco::AutoPtr; + + enum Protocol + { + PROTO_HTTP, + PROTO_HTTPS + }; + + Listener(const std::string& endPoint, Protocol proto); + /// Creates a Listener for the given endpoint, + /// which must be in : format. + /// + /// The value specified for proto determines the URI + /// scheme used by createURI(). + /// + /// Note that the Listener instance created by this constructor + /// does not actually accept requests itself. It merely registers an + /// endpoint in the ORB. A Poco::Net::HTTPServer must be created + /// for accepting JSON-RPC requests using a JSONRPCRequestHandler. + + Listener(const std::string& endPoint, Poco::Net::HTTPServerParams::Ptr pParams = new Poco::Net::HTTPServerParams); + /// Creates a Listener for the given endpoint, + /// which must be in : format. + /// + /// This constructor will create a Poco::Net::HTTPServer + /// instance for handling incoming JSONRPC requests, using + /// a Poco::Net::ServerSocket bound to endPoint. + + Listener(const std::string& endPoint, const Poco::Net::ServerSocket& socket, Poco::Net::HTTPServerParams::Ptr pParams = new Poco::Net::HTTPServerParams); + /// Creates a Listener for the given endpoint, + /// which must be in : format. + /// + /// This constructor will create a Poco::Net::HTTPServer + /// instance using the given server socket for handling + /// incoming JSONRPC requests. The given server socket can + /// be a Poco::Net::ServerSocket or a Poco::Net::SecureServerSocket + /// which must be bound to a socket address corresponding to + /// the given endPoint. + + ~Listener(); + /// Destroys the Listener. + + void enableChunkedTransferEncoding(bool enable = true); + /// Enables or disables chunked transfer encoding for responses. + /// Default is enabled. + + bool isChunkedTransferEncodingEnabled() const; + /// Returns true iff chunked transfer encoding is enabled for responses. + + void enableCompression(bool enable = true); + /// Enables or disables GZIP compression for responses. + /// Default is enabled. + /// + /// Note that chunked transfer encoding must also be enabled + /// in order to allow compression. + + bool isCompressionEnabled() const; + /// Returns true iff GZIP compression is enabled for responses. + + void enableCORS(bool enable = true); + /// Enables or disables CORS (Cross Origin Resource Sharing). + /// Default is disabled. + + bool isCORSEnabled() const; + /// Returns true iff CORS is enabled. + + void setCORSAllowedOrigin(const std::string& origin); + /// Sets the CORS allowed origin. + /// + /// Can be empty (default), an asterisk ("*"), or a specific origin + /// in the form of a complete http(s) URL ("http://domain.com"). + /// + /// In case of an empty origin specified here, all origins will + /// be accepted and the origin specified by the client will simply + /// be echoed back. If an asterisk is specified, again, all origins + /// will be accepted, but the asterisk will be sent back to the client + /// in the "Access-Control-Allow-Origin" header. + /// If any other origin is given, the origin presented by the client + /// must exactly match the specified origin for the request to be accepted. + + const std::string& getCORSAllowedOrigin() const; + /// Retuns the CORS allowed origin. + /// + /// See setCORSAllowedOrigin() for more information. + + // Poco::RemotingNG::Listener + void start(); + void stop(); + const std::string& protocol() const; + std::string createURI(const Poco::RemotingNG::Identifiable::TypeId& typeId, const Poco::RemotingNG::Identifiable::ObjectId& objectId); + bool handlesURI(const std::string& uri); + void registerObject(Poco::RemotingNG::RemoteObject::Ptr pRemoteObject, Poco::RemotingNG::Skeleton::Ptr pSkeleton); + void unregisterObject(Poco::RemotingNG::RemoteObject::Ptr pRemoteObject); + +private: + bool _secure; + Poco::SharedPtr _pHTTPServer; + bool _enableChunkedTransferEncoding; + bool _enableCompression; + bool _enableCORS; + std::string _corsAllowedOrigin; +}; + + +// +// inlines +// +inline bool Listener::isChunkedTransferEncodingEnabled() const +{ + return _enableChunkedTransferEncoding; +} + + +inline bool Listener::isCompressionEnabled() const +{ + return _enableCompression; +} + + +inline bool Listener::isCORSEnabled() const +{ + return _enableCORS; +} + + +inline const std::string& Listener::getCORSAllowedOrigin() const +{ + return _corsAllowedOrigin; +} + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_Listener_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Serializer.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Serializer.h new file mode 100644 index 0000000000..dcd74df3fc --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Serializer.h @@ -0,0 +1,218 @@ +// +// Serializer.h +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: Serializer +// +// Definition of the Serializer class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_Serializer_INCLUDED +#define RemotingNG_JSONRPC_Serializer_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/NumberFormatter.h" +#include "Poco/SharedPtr.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API Serializer: public Poco::RemotingNG::Serializer + /// The Serializer implementation for the JSONRPC + /// Transport. +{ +public: + static const std::string JSON_JSONRPC; + static const std::string JSON_VERSION; + static const std::string JSON_METHOD; + static const std::string JSON_PARAMS; + static const std::string JSON_ID; + static const std::string JSON_RESULT; + static const std::string JSON_ERROR; + static const std::string JSON_CODE; + static const std::string JSON_MESSAGE; + static const std::string JSON_TRUE; + static const std::string JSON_FALSE; + static const std::string JSON_NULL; + + enum State + { + ST_MESSAGE, + ST_OBJECT, + ST_OBJECT_FIRST, + ST_ARRAY, + ST_ARRAY_FIRST + }; + + Serializer(); + /// Creates the Serializer. + + ~Serializer(); + /// Destroys the Serializer. + + // Poco::RemotingNG::Serializer + void serializeMessageBegin(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type); + void serializeMessageEnd(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type); + void serializeFaultMessage(const std::string& name, const Poco::Exception& exc); + void serializeStructBegin(const std::string& name); + void serializeStructEnd(const std::string& name); + void serializeSequenceBegin(const std::string& name, Poco::UInt32 numElems); + void serializeSequenceEnd(const std::string& name); + void serializeNullableBegin(const std::string& name, bool isNull); + void serializeNullableEnd(const std::string& name); + void serialize(const std::string& name, Poco::Int8 val); + void serialize(const std::string& name, Poco::UInt8 val); + void serialize(const std::string& name, Poco::Int16 val); + void serialize(const std::string& name, Poco::UInt16 val); + void serialize(const std::string& name, Poco::Int32 val); + void serialize(const std::string& name, Poco::UInt32 val); + void serialize(const std::string& name, long val); + void serialize(const std::string& name, unsigned long val); +#ifndef POCO_INT64_IS_LONG + void serialize(const std::string& name, Poco::Int64 val); + void serialize(const std::string& name, Poco::UInt64 val); +#endif + void serialize(const std::string& name, float val); + void serialize(const std::string& name, double val); + void serialize(const std::string& name, bool val); + void serialize(const std::string& name, char val); + void serialize(const std::string& name, const std::string& val); + void serialize(const std::string& name, const std::vector& val); + void resetId(int newId = 0); + static std::string escapeString(const std::string& val); + +protected: + void resetImpl(); + void setupImpl(std::ostream& out); + +private: + Serializer(const Serializer&); + Serializer& operator=(const Serializer&); + + void serializeMethodStart(const std::string& methodName); + /// Indicates the begin of method serialization. + + void serializeMethodEnd(const std::string& methodName); + /// Indicates the end of method serialization. + + void serializeData(const std::string& name, const std::string& val); + /// Serializes string data. + + void writeSeparator(); + +private: + std::ostream* _pStream; + int _indent; + int _id; + std::vector _state; +}; + + +// +// inlines +// +inline void Serializer::serialize(const std::string& name, Poco::Int8 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +inline void Serializer::serialize(const std::string& name, Poco::UInt8 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +inline void Serializer::serialize(const std::string& name, Poco::Int16 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +inline void Serializer::serialize(const std::string& name, Poco::UInt16 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +inline void Serializer::serialize(const std::string& name, Poco::Int32 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +inline void Serializer::serialize(const std::string& name, Poco::UInt32 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +inline void Serializer::serialize(const std::string& name, long val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +inline void Serializer::serialize(const std::string& name, unsigned long val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +#ifndef POCO_INT64_IS_LONG +inline void Serializer::serialize(const std::string& name, Poco::Int64 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +inline void Serializer::serialize(const std::string& name, Poco::UInt64 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} +#endif + + +inline void Serializer::serialize(const std::string& name, float val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +inline void Serializer::serialize(const std::string& name, double val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +inline void Serializer::serialize(const std::string& name, bool val) +{ + serializeData(name, val? JSON_TRUE : JSON_FALSE); +} + + +inline void Serializer::resetId(int newId) +{ + _id = newId; +} + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_Serializer_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Transport.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Transport.h new file mode 100644 index 0000000000..b8f652c779 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/Transport.h @@ -0,0 +1,290 @@ +// +// Transport.h +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: Transport +// +// Definition of the Transport class. +// +// Copyright (c) 2006-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_Transport_INCLUDED +#define RemotingNG_JSONRPC_Transport_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "Poco/RemotingNG/JSONRPC/Serializer.h" +#include "Poco/RemotingNG/JSONRPC/Deserializer.h" +#include "Poco/RemotingNG/JSONRPC/CookieStore.h" +#include "Poco/RemotingNG/Transport.h" +#include "Poco/RemotingNG/Credentials.h" +#include "Poco/Net/HTTPClientSession.h" +#include "Poco/Net/HTTPSessionFactory.h" +#include "Poco/Net/HTTPCredentials.h" +#include "Poco/SharedPtr.h" +#include "Poco/URI.h" +#include +#include + + +namespace Poco +{ + class DeflatingOutputStream; +} + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API Transport: public Poco::RemotingNG::Transport + /// The Transport implementation for RemotingNG JSONRPC. + /// + /// This transport implements the JSON-RPC 2.0 protocol + /// (see for the specification). + /// + /// Parameters are always passed by-name through an object, passing + /// by position (array) is not supported. Furthermore, batched requests + /// are not supported. + /// + /// The transport supports HTTP Basic and HTTP Digest authentication. + /// Please note that for HTTP Digest authentication to work, chunked transfer + /// encoding must be disabled. Also, HTTP Digest authentication is not supported + /// for one-way requests. +{ +public: + static const std::string PROTOCOL; + static const std::string CONTENT_TYPE; + + enum AuthMode + /// Authentication mode. + { + AUTH_NONE = 0, /// No authentication. + AUTH_BASIC = 1, /// HTTP Basic Authentication only (credentials are always sent). + AUTH_DIGEST = 2, /// HTTP Digest Authentication only. + AUTH_ANY = 3 /// HTTP Basic or Digest authentication (whichever the server requests). + }; + + Transport(); + /// Creates a Transport for JSON-RPC 2.0. + + ~Transport(); + /// Destroys the Transport. + + Poco::Timespan getTimeout() const; + /// Returns the HTTP timeout. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + void setTimeout(const Poco::Timespan& timeout); + /// Sets the HTTP timeout. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + bool isKeepAliveEnabled() const; + /// Returns true iff HTTP/1.1 persistent connections are enabled. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + void enableKeepAlive(bool enable); + /// Enables or disables HTTP/1.1 persistent connections. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + Poco::Timespan getKeepAliveTimeout() const; + /// Returns the timeout for HTTP/1.1 persistent connections. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + void setKeepAliveTimeout(const Poco::Timespan& timeout); + /// Sets the timeout for HTTP/1.1 persistent connections. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + bool isChunkedTransferEncodingEnabled() const; + /// Returns true iff chunked transfer encoding is enabled, + /// which is the default unless enableChunkedTransferEncoding(false) has + /// been called. + + void enableChunkedTransferEncoding(bool enable = true); + /// Enables or disables chunked transfer encoding for HTTP requests. + /// This is normally enabled. However, some poorly implemented HTTP stacks cannot + /// handle chunked HTTP messages. Also, chunked transfer encoding must be + /// disabled if AUTH_DIGEST or AUTH_ANY authentication is used. + /// + /// Regardless of this setting, chunked transfer encoding is always supported + /// for responses sent by the server. + + bool isCompressionEnabled() const; + /// Returns true iff HTTP compression (GZIP) is enabled for requests. + /// Default is disabled. + + void enableCompression(bool enable); + /// Enables or disables HTTP compression via GZIP Content-Encoding for + /// requests. + /// This is normally disabled, due to a lack of support by most servers. + /// + /// Note that chunked transfer encoding must also be enabled in + /// order to allow compression. + /// + /// Regardless of this setting, server responses can always be compressed + /// using GZIP Content-Encoding. + + void setAuthentication(AuthMode authMode); + /// Sets the authentication mode. + /// + /// Please note that for AUTH_DIGEST or AUTH_ANY, chunked + /// transfer encoding must be disabled. + + AuthMode getAuthentication() const; + /// Returns the authentication mode. + + void setCredentials(const Credentials& creds); + /// Sets the credentials for client authentication. + /// + /// The Credentials object should contain a username + /// (Credentials::ATTR_USERNAME, "n") and a password + /// (Credentials::ATTR_PASSWORD, "p") attribute. + + Credentials getCredentials() const; + /// Returns the credentials, containing username and password + /// attributes. + + //@ deprecated + void setUsername(const std::string& username); + /// Sets the username for HTTP authentication. + /// + /// This method is deprecated and may be removed in a future version. + /// Code should be changed to use setCredentials() instead. + + //@ deprecated + const std::string& getUsername() const; + /// Returns the username for HTTP authentication. + /// + /// This method is deprecated and may be removed in a future version. + /// Code should be changed to use getCredentials() instead. + + //@ deprecated + void setPassword(const std::string& password); + /// Sets the password for HTTP authentication. + /// + /// This method is deprecated and may be removed in a future version. + /// Code should be changed to use setCredentials() instead. + + //@ deprecated + const std::string& getPassword() const; + /// Returns the password for HTTP authentication. + /// + /// This method is deprecated and may be removed in a future version. + /// Code should be changed to use getCredentials() instead. + + const std::string& getUserAgent() const; + /// Returns the value of the User-Agent header sent with JSON-RPC HTTP + /// requests, or an empty string if no User-Agent value has been set. + + void setUserAgent(const std::string& userAgent); + /// Sets the value of the User-Agent header sent with JSON-RPC HTTP + /// requests. If an empty string is given (default), no User-Agent + /// header is included in the request. + + void setCustomHeader(const std::string& name, const std::string& value); + /// Adds a custom HTTP header to the HTTP request. + + void removeCustomHeader(const std::string& name); + /// Removes a custom HTTP header previously added with setCustomHeader(). + + bool hasCustomHeader(const std::string& name) const; + /// Returns true if a custom HTTP header with the given name has been set. + + const std::string& getCustomHeader(const std::string& name) const; + /// Returns the value of the custom HTTP header with the given name. + /// + /// Throws a Poco::NotFoundException if the custom header with the + /// given name does not exist. + + void setProxyConfig(const Poco::Net::ProxyConfig& proxyConfig); + /// Sets the proxy configuration. + + const Poco::Net::ProxyConfig& getProxyConfig() const; + /// Returns the proxy configuration. + + CookieStore::Ptr getCookieStore() const; + /// Returns the CookieStore. + + void setCookieStore(CookieStore::Ptr pCookieStore); + /// Sets the CookieStore. + + static Poco::Net::HTTPSessionFactory& httpSessionFactory(); + /// Returns the Poco::Net::HTTPSessionFactory instance used by + /// the transport. + + // Poco::RemotingNG::Transport + const std::string& endPoint() const; + void connect(const std::string& endPoint); + void disconnect(); + bool connected() const; + Poco::RemotingNG::Serializer& beginMessage(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + void sendMessage(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + Poco::RemotingNG::Serializer& beginRequest(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + Poco::RemotingNG::Deserializer& sendRequest(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + void endRequest(); + +protected: + const Poco::Net::HTTPClientSession& requireSession() const; + Poco::Net::HTTPClientSession& requireSession(); + void prepareRequest(Poco::Net::HTTPRequest& request, const std::string& messageName); + + static const std::string USER_AGENT; + +private: + Poco::Net::HTTPCredentials _creds; + Poco::Net::ProxyConfig _proxyConfig; + Poco::SharedPtr _pSession; + Serializer _serializer; + Deserializer _deserializer; + std::string _endPoint; + Poco::URI _endPointURI; + bool _keepAlive; + bool _chunkedTransferEncoding; + bool _compression; + AuthMode _authMode; + std::string _userAgent; + std::map _customHeaders; + Poco::SharedPtr _pStream; + Poco::SharedPtr _pDeflater; + CookieStore::Ptr _pCookieStore; + + static Poco::Net::HTTPSessionFactory _httpSessionFactory; + + friend class JSONRPCRequestHandler; +}; + + +// +// inlines +// +inline Poco::Net::HTTPSessionFactory& Transport::httpSessionFactory() +{ + return _httpSessionFactory; +} + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_Transport_INCLUDED diff --git a/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/TransportFactory.h b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/TransportFactory.h new file mode 100644 index 0000000000..8dc03bafd8 --- /dev/null +++ b/RemotingNG/JSONRPC/include/Poco/RemotingNG/JSONRPC/TransportFactory.h @@ -0,0 +1,56 @@ +// +// TransportFactory.h +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: TransportFactory +// +// Definition of the TransportFactory class. +// +// Copyright (c) 2006-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_JSONRPC_TransportFactory_INCLUDED +#define RemotingNG_JSONRPC_TransportFactory_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "Poco/RemotingNG/JSONRPC/Serializer.h" +#include "Poco/RemotingNG/TransportFactory.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class RemotingNGJSONRPC_API TransportFactory: public Poco::RemotingNG::TransportFactory + /// The TransportFactory for RemotingNG JSONRPC Transport objects. +{ +public: + TransportFactory(); + /// Creates a TransportFactory. + + ~TransportFactory(); + /// Destroys the TransportFactory. + + Poco::RemotingNG::Transport* createTransport(); + + static void registerFactory(); + /// Helper function to register the factory with the manager. + + static void unregisterFactory(); + /// Helper function to unregister the factory with the manager. +}; + + +} } } // namespace Poco::RemotingNG::JSONRPC + + +#endif // RemotingNG_JSONRPC_TransportFactory_INCLUDED diff --git a/RemotingNG/JSONRPC/src/CookieStore.cpp b/RemotingNG/JSONRPC/src/CookieStore.cpp new file mode 100644 index 0000000000..ce71c2d4e1 --- /dev/null +++ b/RemotingNG/JSONRPC/src/CookieStore.cpp @@ -0,0 +1,83 @@ +// +// CookieStore.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: CookieStore +// +// Copyright (c) 2006-2012, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/CookieStore.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +CookieStore::CookieStore() +{ +} + + +CookieStore::~CookieStore() +{ +} + + +void CookieStore::addCookies(Poco::Net::HTTPRequest& request) +{ + Poco::FastMutex::ScopedLock lock(_mutex); + + Poco::Timestamp now; + Poco::Net::NameValueCollection cookies; + for (CookieMap::const_iterator it = _cookies.begin(); it != _cookies.end(); ++it) + { + if (it->second.expireTime == 0 || now <= it->second.expireTime) + { + cookies.add(it->second.cookie.getName(), it->second.cookie.getValue()); + } + } + request.setCookies(cookies); +} + + +void CookieStore::updateCookies(const Poco::Net::HTTPResponse& response) +{ + Poco::FastMutex::ScopedLock lock(_mutex); + + std::vector cookies; + response.getCookies(cookies); + Poco::Timestamp now; + for (std::vector::const_iterator it = cookies.begin(); it != cookies.end(); ++it) + { + if (it->getMaxAge() == -1) + { + CookieInfo ci; + ci.cookie = *it; + ci.expireTime = 0; + _cookies[it->getName()] = ci; + } + else if (it->getMaxAge() == 0) + { + _cookies.erase(it->getName()); + } + else + { + CookieInfo ci; + ci.cookie = *it; + ci.expireTime += it->getMaxAge()*Poco::Timestamp::resolution(); + _cookies[it->getName()] = ci; + } + } +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/Deserializer.cpp b/RemotingNG/JSONRPC/src/Deserializer.cpp new file mode 100644 index 0000000000..aea61ef0e9 --- /dev/null +++ b/RemotingNG/JSONRPC/src/Deserializer.cpp @@ -0,0 +1,475 @@ +// +// Deserializer.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: Deserializer +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/Deserializer.h" +#include "Poco/RemotingNG/JSONRPC/Serializer.h" +#include "Poco/RemotingNG/JSONRPC/JSONParser.h" +#include "Poco/RemotingNG/JSONRPC/JSObject.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/NumberParser.h" +#include "Poco/Base64Decoder.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +Deserializer::Deserializer(): + _pAssociatedSerializer(0) +{ +} + + +Deserializer::~Deserializer() +{ +} + + +Poco::RemotingNG::SerializerBase::MessageType Deserializer::findMessage(std::string& name) +{ + poco_assert (!_objectStack.empty()); + + name = (*_objectStack.front())[Serializer::JSON_METHOD]->stringValue(); + return Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST; +} + + +void Deserializer::deserializeMessageBegin(const std::string& name, SerializerBase::MessageType type) +{ + poco_assert_dbg (_objectStack.size() == 1); + + switch (type) + { + case Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST: + { + _id = (*_objectStack.front())[Serializer::JSON_ID]->asInt32(); + JSValue::Ptr pParams; + if (_objectStack.front()->has(Serializer::JSON_PARAMS)) + pParams = (*_objectStack.front())[Serializer::JSON_PARAMS]; + else + pParams = new JSObject; + _objectStack.push_back(pParams); + if (pParams->type() == JSValue::JS_ARRAY) + { + _indexStack.push_back(0); + } + if (_pAssociatedSerializer) _pAssociatedSerializer->resetId(_id); + } + break; + + case Poco::RemotingNG::SerializerBase::MESSAGE_REPLY: + if (_objectStack.front()->has(Serializer::JSON_ERROR)) + { + JSValue::Ptr pError = (*_objectStack.front())[Serializer::JSON_ERROR]; + throw RemoteException((*pError)[Serializer::JSON_MESSAGE]->stringValue(), (*pError)[Serializer::JSON_CODE]->asInt32()); + } + else + { + _id = (*_objectStack.front())[Serializer::JSON_ID]->asInt32(); + JSValue::Ptr pResult = (*_objectStack.front())[Serializer::JSON_RESULT]; + _objectStack.push_back(pResult); + } + break; + + default: + poco_bugcheck(); + } +} + + +void Deserializer::deserializeMessageEnd(const std::string& name, SerializerBase::MessageType type) +{ + poco_assert_dbg (_objectStack.size() == 2); + + switch (type) + { + case Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST: + if (_objectStack.back()->type() == JSValue::JS_ARRAY) + { + _indexStack.pop_back(); + } + // fallthrough + + case Poco::RemotingNG::SerializerBase::MESSAGE_REPLY: + _objectStack.pop_back(); + poco_assert_dbg(_objectStack.size() == 1); + break; + + default: + poco_bugcheck(); + } +} + + +bool Deserializer::deserializeStructBegin(const std::string& name, bool isMandatory) +{ + if (name.empty() && _objectStack.size() == 1 && _objectStack.back()->type() == JSValue::JS_OBJECT) + return true; + + bool found = false; + JSValue::Ptr pObject = findValue(name, isMandatory, found); + if (found) + { + if (pObject->type() != JSValue::JS_OBJECT) + Poco::RemotingNG::DeserializerException("expected object, found something else", name); + + _objectStack.push_back(pObject); + return true; + } + else if (isMandatory) + { + throw Poco::RemotingNG::MissingParamException(name); + } + return false; +} + + +void Deserializer::deserializeStructEnd(const std::string& name) +{ + _objectStack.pop_back(); +} + + +bool Deserializer::deserializeSequenceBegin(const std::string& name, bool isMandatory, Poco::UInt32& sizeHint) +{ + if (name.empty() && _objectStack.size() == 1 && _objectStack.back()->type() == JSValue::JS_ARRAY) + { + _indexStack.push_back(0); + sizeHint = static_cast(_objectStack.back()->size()); + return true; + } + + bool found = false; + JSValue::Ptr pArray = findValue(name, isMandatory, found); + if (found) + { + if (pArray->type() != JSValue::JS_ARRAY) + Poco::RemotingNG::DeserializerException("expected array, found something else", name); + + sizeHint = static_cast(pArray->size()); + _objectStack.push_back(pArray); + _indexStack.push_back(0); + return true; + } + else if (isMandatory) + { + throw Poco::RemotingNG::MissingParamException(name); + } + return false; +} + + +void Deserializer::deserializeSequenceEnd(const std::string& name) +{ + _indexStack.pop_back(); + _objectStack.pop_back(); +} + + +bool Deserializer::deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + isNull = pValue.isNull(); + // findValue() will be called again and must return the same value + // Therefore we must adjust the _indexStack's topmost counter. + if (!isNull && _objectStack.back()->type() == JSValue::JS_ARRAY) + { + _indexStack.back()--; + } + } + return found; +} + + +void Deserializer::deserializeNullableEnd(const std::string& name) +{ +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int8& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = static_cast(pValue->asInt32()); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt8& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = static_cast(pValue->asUInt32()); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int16& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = static_cast(pValue->asInt32()); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt16& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = static_cast(pValue->asUInt32()); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int32& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = pValue->asInt32(); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt32& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = pValue->asUInt32(); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, long& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { +#ifdef POCO_INT64_IS_LONG + val = pValue->asInt64(); +#else + val = pValue->asInt32(); +#endif + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, unsigned long& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { +#ifdef POCO_INT64_IS_LONG + val = pValue->asUInt64(); +#else + val = pValue->asUInt32(); +#endif + } + return found; +} + + +#ifndef POCO_INT64_IS_LONG +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int64& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = pValue->asInt64(); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt64& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = pValue->asUInt64(); + } + return found; +} +#endif + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, float& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = static_cast(pValue->asDouble()); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, double& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = pValue->asDouble(); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, bool& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = pValue->asBool(); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, char& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + const std::string& str = pValue->stringValue(); + if (str.size() == 1) + val = str[0]; + else + throw Poco::RemotingNG::DeserializerException(std::string("Illegal char value ") + str); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, std::string& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + val = pValue->stringValue(); + } + return found; +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, std::vector& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + std::istringstream istr(pValue->stringValue()); + Poco::Base64Decoder decoder(istr); + val.clear(); + int ch = decoder.get(); + while (ch != -1) + { + val.push_back(static_cast(ch)); + ch = decoder.get(); + } + } + return found; +} + + +void Deserializer::setupImpl(std::istream& in) +{ + resetImpl(); + JSONParser parser(in); + _objectStack.push_back(parser.parse()); + int ch = in.get(); + while (ch != -1) ch = in.get(); +} + + +JSValue::Ptr Deserializer::findValue(const std::string& name, bool isMandatory, bool& found) +{ + if (_objectStack.back()->type() == JSValue::JS_ARRAY) + { + if (_indexStack.empty()) + { + throw Poco::RemotingNG::DeserializerException("Expected object, but found array", name); + } + else if (_indexStack.back() < _objectStack.back()->size()) + { + found = true; + return (*_objectStack.back())[_indexStack.back()++]; + } + else + { + found = false; + } + } + else if (_objectStack.back()->has(name)) + { + found = true; + return (*_objectStack.back())[name]; + } + else if (isMandatory) + { + throw Poco::RemotingNG::MissingParamException(name); + } + return JSValue::Ptr(); +} + + +void Deserializer::resetImpl() +{ + _objectStack.clear(); + _indexStack.clear(); +} + + +void Deserializer::associateSerializer(Serializer& ser) +{ + _pAssociatedSerializer = &ser; +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/JSArray.cpp b/RemotingNG/JSONRPC/src/JSArray.cpp new file mode 100644 index 0000000000..09611dcaf9 --- /dev/null +++ b/RemotingNG/JSONRPC/src/JSArray.cpp @@ -0,0 +1,71 @@ +// +// JSArray.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSValue +// Module: JSArray +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/JSArray.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +JSArray::JSArray() +{ +} + + +JSArray::~JSArray() +{ +} + + +JSValue::Type JSArray::type() const +{ + return JS_ARRAY; +} + + +std::size_t JSArray::size() const +{ + return _vector.size(); +} + + +const JSValue::Ptr& JSArray::operator [] (std::size_t index) const +{ + if (index < _vector.size()) + return _vector[index]; + else + throw Poco::InvalidAccessException("index out of range"); +} + + +JSValue::Ptr& JSArray::operator [] (std::size_t index) +{ + if (index < _vector.size()) + { + return _vector[index]; + } + else if (index == _vector.size()) + { + _vector.push_back(JSValue::Ptr()); + return _vector.back(); + } + else throw Poco::InvalidAccessException("index out of range"); +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/JSONParser.cpp b/RemotingNG/JSONRPC/src/JSONParser.cpp new file mode 100644 index 0000000000..749780bd24 --- /dev/null +++ b/RemotingNG/JSONRPC/src/JSONParser.cpp @@ -0,0 +1,247 @@ +// +// JSONParser.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSONParser +// Module: JSONParser +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/JSONParser.h" +#include "Poco/RemotingNG/JSONRPC/JSScalar.h" +#include "Poco/RemotingNG/JSONRPC/JSObject.h" +#include "Poco/RemotingNG/JSONRPC/JSArray.h" +#include "Poco/NumberParser.h" +#include "Poco/UTF8Encoding.h" +#include "Poco/Exception.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class DepthGuard +{ +public: + DepthGuard(std::size_t& depth, std::size_t maxDepth): + _depth(depth) + { + if (++_depth > maxDepth) throw Poco::SyntaxException("too many levels"); + } + + ~DepthGuard() + { + --_depth; + } + +private: + std::size_t& _depth; +}; + + +JSONParser::JSONParser(std::istream& istr): + _streambuf(*istr.rdbuf()) +{ +} + + +JSONParser::~JSONParser() +{ +} + + +JSValue::Ptr JSONParser::parse() +{ + _depth = 0; + JSValue::Ptr pResult; + parseValue(_streambuf.sbumpc(), pResult); + return pResult; +} + + +int JSONParser::parseValue(int ch, JSValue::Ptr& pValue) +{ + ch = skipWhitespace(ch); + if (ch == '{') + return parseObject(ch, pValue); + else if (ch == '[') + return parseArray(ch, pValue); + else if (!isEOF(ch)) + return parseScalar(ch, pValue); + else + throw Poco::DataFormatException("no JSON content found"); +} + + +int JSONParser::parseObject(int ch, JSValue::Ptr& pObject) +{ + poco_assert_dbg (ch == '{'); + + DepthGuard depthGuard(_depth, _maxDepth); + + pObject = new JSObject; + ch = skipWhitespace(_streambuf.sbumpc()); + while (ch != '}') + { + std::string name; + ch = skipWhitespace(ch); + ch = parseString(ch, name); + ch = skipWhitespace(ch); + if (ch != ':') throw Poco::SyntaxException("excepted ':'"); + JSValue::Ptr pValue; + ch = parseValue(_streambuf.sbumpc(), pValue); + (*pObject)[name] = pValue; + ch = skipWhitespace(ch); + if (ch == ',') + ch = skipWhitespace(_streambuf.sbumpc()); + else if (ch != '}') + throw Poco::SyntaxException("expected '}' or ','"); + } + if (ch == '}') ch = _streambuf.sbumpc(); + return ch; +} + + +int JSONParser::parseArray(int ch, JSValue::Ptr& pArray) +{ + poco_assert_dbg (ch == '['); + + DepthGuard depthGuard(_depth, _maxDepth); + + pArray = new JSArray; + ch = skipWhitespace(_streambuf.sbumpc()); + while (ch != ']') + { + ch = skipWhitespace(ch); + JSValue::Ptr pValue; + ch = parseValue(ch, pValue); + (*pArray)[pArray->size()] = pValue; + ch = skipWhitespace(ch); + if (ch == ',') + ch = skipWhitespace(_streambuf.sbumpc()); + else if (ch != ']') + throw Poco::SyntaxException("expected ']' or ','"); + } + if (ch == ']') ch = _streambuf.sbumpc(); + return ch; +} + + +int JSONParser::parseScalar(int ch, JSValue::Ptr& pObject) +{ + std::string value; + if (ch == '"') + { + ch = parseString(ch, value); + pObject = new JSScalar(value, JSScalar::JS_STRING); + } + else + { + while (!isEOF(ch) && !isWhitespace(ch) && ch != ',' && ch != ']' && ch != '}') + { + value += static_cast(ch); + ch = _streambuf.sbumpc(); + } + if (value == "true" || value == "false") + pObject = new JSScalar(value, JSScalar::JS_BOOL); + else if (value != "null") + pObject = new JSScalar(value, JSScalar::JS_NUMBER); // TODO: check number syntax + } + return ch; +} + + +int JSONParser::parseString(int ch, std::string& str) +{ + str.clear(); + if (ch != '"') throw Poco::SyntaxException(std::string("string expected, but found '") + std::string(1, ch) + "\'"); + ch = _streambuf.sbumpc(); + while (ch != '"' && !isEOF(ch)) + { + if (ch == '\\') + { + ch = _streambuf.sbumpc(); + switch (ch) + { + case '"': + case '\\': + case '/': + str += static_cast(ch); + break; + case 'b': + str += '\b'; + break; + case 'f': + str += '\f'; + break; + case 'n': + str += '\n'; + break; + case 'r': + str += '\r'; + break; + case 't': + str += '\t'; + break; + case 'u': + ch = parseUnicode(ch, str); + continue; + default: + throw Poco::SyntaxException("invalid escape sequence"); + } + } + else + { + str += static_cast(ch); + } + ch = _streambuf.sbumpc(); + } + if (ch == '"') ch = _streambuf.sbumpc(); + return ch; +} + + +int JSONParser::parseUnicode(int ch, std::string& str) +{ + poco_assert (ch == 'u'); + + std::string hex; + ch = _streambuf.sbumpc(); + while (ch != -1 && hex.size() < 4) + { + hex += static_cast(ch); + ch = _streambuf.sbumpc(); + } + if (hex.size() == 4) + { + int code = Poco::NumberParser::parseHex(hex); + unsigned char buffer[8]; + Poco::UTF8Encoding utf8; + int n = utf8.convert(code, buffer, sizeof(buffer)); + str.append(reinterpret_cast(&buffer[0]), n); + } + else throw Poco::SyntaxException("bad unicode character reference in string"); + + return ch; +} + + +int JSONParser::skipWhitespace(int ch) +{ + while (isWhitespace(ch)) + { + ch = _streambuf.sbumpc(); + } + return ch; +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/JSONRPCRequestHandler.cpp b/RemotingNG/JSONRPC/src/JSONRPCRequestHandler.cpp new file mode 100644 index 0000000000..4b78ef3671 --- /dev/null +++ b/RemotingNG/JSONRPC/src/JSONRPCRequestHandler.cpp @@ -0,0 +1,350 @@ +// +// JSONRPCRequestHandler.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: JSONRPCRequestHandler +// +// Copyright (c) 2006-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/JSONRPCRequestHandler.h" +#include "Poco/RemotingNG/JSONRPC/Serializer.h" +#include "Poco/RemotingNG/JSONRPC/Deserializer.h" +#include "Poco/RemotingNG/JSONRPC/Transport.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Net/HTTPServerResponse.h" +#include "Poco/Net/HTTPBasicCredentials.h" +#include "Poco/RemotingNG/ORB.h" +#include "Poco/RemotingNG/ServerTransport.h" +#include "Poco/RemotingNG/Context.h" +#include "Poco/StringTokenizer.h" +#include "Poco/StreamCopier.h" +#include "Poco/InflatingStream.h" +#include "Poco/DeflatingStream.h" +#include + + +using namespace std::string_literals; + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +class JSONRPCServerTransport: public Poco::RemotingNG::ServerTransport +{ +public: + JSONRPCServerTransport(Listener& listener, const Credentials& credentials): + _listener(listener), + _credentials(credentials) + { + } + + bool authenticate(const std::string& /*method*/) + { + Authenticator::Ptr pAuth = _listener.getAuthenticator(); + if (pAuth) + { + return pAuth->authenticate(_credentials).done(); + } + return false; + } + + bool authorize(const std::string& method, const std::string& permission) + { + Authorizer::Ptr pAuth = _listener.getAuthorizer(); + if (pAuth) + { + return pAuth->authorize(method, permission); + } + return false; + } + +private: + const Listener& _listener; + const Credentials& _credentials; +}; + + +class ChunkedServerTransport: public JSONRPCServerTransport +{ +public: + ChunkedServerTransport(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response, Listener& listener, const Poco::RemotingNG::Credentials& credentials): + JSONRPCServerTransport(listener, credentials), + _request(request), + _response(response), + _enableCompression(listener.isCompressionEnabled()), + _pDeflater(0), + _replySent(false) + { + _deserializer.associateSerializer(_serializer); + } + + ~ChunkedServerTransport() + { + delete _pDeflater; + } + + Poco::RemotingNG::Deserializer& beginRequest() + { + if (_request.get("Content-Encoding"s, ""s) == "gzip") + { + Poco::InflatingInputStream inflater(_request.stream(), Poco::InflatingStreamBuf::STREAM_GZIP); + _deserializer.setup(inflater); + } + else + { + _deserializer.setup(_request.stream()); + } + return _deserializer; + } + + Poco::RemotingNG::Serializer& sendReply(Poco::RemotingNG::SerializerBase::MessageType messageType) + { + // consume extra request content + std::istream& istr = _request.stream(); + int ch = istr.get(); + while (ch != -1) ch = istr.get(); + + _response.setChunkedTransferEncoding(true); + _response.setContentType(Transport::CONTENT_TYPE); + bool compressResponse(_enableCompression && _request.hasToken("Accept-Encoding"s, "gzip"s)); + if (compressResponse) + { + _response.set("Content-Encoding"s, "gzip"); + _pDeflater = new Poco::DeflatingOutputStream(_response.send(), Poco::DeflatingStreamBuf::STREAM_GZIP, 1); + _serializer.setup(*_pDeflater); + } + else + { + _serializer.setup(_response.send()); + } + _replySent = true; + return _serializer; + } + + void endRequest() + { + if (!_replySent) // one-way message + { + _replySent = true; + _response.send(); + } + } + +private: + Poco::Net::HTTPServerRequest& _request; + Poco::Net::HTTPServerResponse& _response; + Poco::RemotingNG::JSONRPC::Serializer _serializer; + Poco::RemotingNG::JSONRPC::Deserializer _deserializer; + bool _enableCompression; + Poco::DeflatingOutputStream* _pDeflater; + bool _replySent; +}; + + +class NonChunkedServerTransport: public JSONRPCServerTransport +{ +public: + NonChunkedServerTransport(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response, Listener& listener, const Poco::RemotingNG::Credentials& credentials): + JSONRPCServerTransport(listener, credentials), + _request(request), + _response(response) + { + _deserializer.associateSerializer(_serializer); + } + + Poco::RemotingNG::Deserializer& beginRequest() + { + if (_request.get("Content-Encoding"s, ""s) == "gzip") + { + Poco::InflatingInputStream inflater(_request.stream(), Poco::InflatingStreamBuf::STREAM_GZIP); + _deserializer.setup(inflater); + } + else + { + _deserializer.setup(_request.stream()); + } + return _deserializer; + } + + Poco::RemotingNG::Serializer& sendReply(Poco::RemotingNG::SerializerBase::MessageType messageType) + { + // consume extra request content + std::istream& istr = _request.stream(); + int ch = istr.get(); + while (ch != -1) ch = istr.get(); + + _response.setContentType(Transport::CONTENT_TYPE); + _serializer.setup(_bufferStream); + return _serializer; + } + + void endRequest() + { + _response.setContentLength(static_cast(_bufferStream.tellp())); + std::ostream& ostr = _response.send(); + Poco::StreamCopier::copyStream(_bufferStream, ostr); + } + +private: + Poco::Net::HTTPServerRequest& _request; + Poco::Net::HTTPServerResponse& _response; + Poco::RemotingNG::JSONRPC::Serializer _serializer; + Poco::RemotingNG::JSONRPC::Deserializer _deserializer; + std::stringstream _bufferStream; +}; + + +JSONRPCRequestHandler::JSONRPCRequestHandler(Listener& listener): + _listener(listener), + _logger(Poco::Logger::get("RemotingNG.JSONRPC.JSONRPCRequestHandler"s)) +{ +} + + +JSONRPCRequestHandler::~JSONRPCRequestHandler() +{ +} + + +void JSONRPCRequestHandler::handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) +{ + if (_logger.debug()) + { + std::string message(request.getMethod()); + message += " "; + message += request.getURI(); + message += " "; + message += request.getVersion(); + message += " from "; + message += request.clientAddress().toString(); + _logger.debug(message); + } + + const std::string& method = request.getMethod(); + if (method == Poco::Net::HTTPRequest::HTTP_HEAD) + { + response.send(); + return; + } + else if (_listener.isCORSEnabled() && method == Poco::Net::HTTPRequest::HTTP_OPTIONS && request.has("Origin")) + { + if (handleCORS(request, response)) + { + response.set("Access-Control-Allow-Methods"s, "POST"s); + response.set("Access-Control-Allow-Headers"s, "Accept, Content-Type"s); + } + response.setContentLength(0); + response.send(); + return; + } + else if (method != Poco::Net::HTTPRequest::HTTP_POST) + { + response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_METHOD_NOT_ALLOWED); + response.setContentLength(0); + response.send(); + return; + } + std::string ce = request.get("Content-Encoding"s, ""s); + if (!ce.empty() && ce != "gzip") + { + response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_UNSUPPORTEDMEDIATYPE); + response.setContentLength(0); + response.send(); + return; + } + + if (_listener.isCORSEnabled() && request.has("Origin"s)) + { + if (!handleCORS(request, response)) + { + response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_METHOD_NOT_ALLOWED); + response.setContentLength(0); + response.send(); + return; + } + } + + Poco::RemotingNG::Credentials credentials; + Poco::RemotingNG::ScopedContext scopedContext; + scopedContext.context()->setValue("transport"s, Transport::PROTOCOL); + scopedContext.context()->setValue("remoteAddress"s, request.clientAddress()); + scopedContext.context()->setValue("localAddress"s, request.serverAddress()); + scopedContext.context()->setValue("uri"s, request.getURI()); + scopedContext.context()->clearCredentials(); + if (request.hasCredentials()) + { + std::string scheme; + std::string authInfo; + request.getCredentials(scheme, authInfo); + if (scheme == Poco::Net::HTTPBasicCredentials::SCHEME) + { + Poco::Net::HTTPBasicCredentials creds(authInfo); + scopedContext.context()->setValue("username"s, creds.getUsername()); + scopedContext.context()->setValue("password"s, creds.getPassword()); + credentials.setAttribute(Credentials::ATTR_USERNAME, creds.getUsername()); + credentials.setAttribute(Credentials::ATTR_PASSWORD, creds.getPassword()); + scopedContext.context()->setCredentials(credentials); + } + } + scopedContext.context()->setValue("httpRequest"s, &request); + scopedContext.context()->setValue("httpResponse"s, &response); + + const std::string& uri = request.getURI(); + Poco::RemotingNG::ORB& orb = Poco::RemotingNG::ORB::instance(); + bool supportsChunked = (_listener.isChunkedTransferEncodingEnabled() && request.getVersion() != Poco::Net::HTTPServerRequest::HTTP_1_0); + if (supportsChunked) + { + ChunkedServerTransport transport(request, response, _listener, credentials); + bool serviceFound = orb.invoke(_listener, uri, transport); + if (!serviceFound) + { + RemotingException exc("Unknown service"); + transport.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT).serializeFaultMessage("", exc); + transport.endRequest(); + } + } + else + { + NonChunkedServerTransport transport(request, response, _listener, credentials); + bool serviceFound = orb.invoke(_listener, uri, transport); + if (!serviceFound) + { + RemotingException exc("Unknown service"); + transport.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT).serializeFaultMessage("", exc); + transport.endRequest(); + } + } +} + + +bool JSONRPCRequestHandler::handleCORS(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) +{ + const std::string& allowedOrigin = _listener.getCORSAllowedOrigin(); + if (allowedOrigin.empty()) + { + response.set("Access-Control-Allow-Origin"s, request.get("Origin"s)); + response.set("Access-Control-Allow-Credentials"s, "true"s); + return true; + } + else if (allowedOrigin == "*" || allowedOrigin == request.get("Origin"s)) + { + response.set("Access-Control-Allow-Origin"s, allowedOrigin); + response.set("Access-Control-Allow-Credentials"s, "true"s); + return true; + } + return false; +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/JSONRPCRequestHandlerFactory.cpp b/RemotingNG/JSONRPC/src/JSONRPCRequestHandlerFactory.cpp new file mode 100644 index 0000000000..e7def411c7 --- /dev/null +++ b/RemotingNG/JSONRPC/src/JSONRPCRequestHandlerFactory.cpp @@ -0,0 +1,44 @@ +// +// JSONRPCRequestHandlerFactory.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: JSONRPCRequestHandlerFactory +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/JSONRPCRequestHandlerFactory.h" +#include "Poco/RemotingNG/JSONRPC/JSONRPCRequestHandler.h" +#include "Poco/Net/HTTPServerRequest.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +JSONRPCRequestHandlerFactory::JSONRPCRequestHandlerFactory(Listener& listener): + _listener(listener) +{ +} + + +JSONRPCRequestHandlerFactory::~JSONRPCRequestHandlerFactory() +{ +} + + +Poco::Net::HTTPRequestHandler* JSONRPCRequestHandlerFactory::createRequestHandler(const Poco::Net::HTTPServerRequest& request) +{ + return new JSONRPCRequestHandler(_listener); +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/JSObject.cpp b/RemotingNG/JSONRPC/src/JSObject.cpp new file mode 100644 index 0000000000..d56056ca41 --- /dev/null +++ b/RemotingNG/JSONRPC/src/JSObject.cpp @@ -0,0 +1,69 @@ +// +// JSObject.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSValue +// Module: JSObject +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/JSObject.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +JSObject::JSObject() +{ +} + + +JSObject::~JSObject() +{ +} + + +JSValue::Type JSObject::type() const +{ + return JS_OBJECT; +} + + +std::size_t JSObject::size() const +{ + return _map.size(); +} + + +const JSValue::Ptr& JSObject::operator [] (const std::string& name) const +{ + Map::const_iterator it = _map.find(name); + if (it != _map.end()) + return it->second; + else + throw Poco::NotFoundException(name); +} + + +JSValue::Ptr& JSObject::operator [] (const std::string& name) +{ + return _map[name]; +} + + +bool JSObject::has(const std::string& name) const +{ + return _map.find(name) != _map.end(); +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/JSScalar.cpp b/RemotingNG/JSONRPC/src/JSScalar.cpp new file mode 100644 index 0000000000..7902b31e87 --- /dev/null +++ b/RemotingNG/JSONRPC/src/JSScalar.cpp @@ -0,0 +1,55 @@ +// +// JSScalar.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSValue +// Module: JSScalar +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/JSScalar.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +JSScalar::JSScalar(Type type): + _type(type) +{ +} + + +JSScalar::JSScalar(const std::string& value, Type type): + _value(value), + _type(type) +{ +} + + +JSScalar::~JSScalar() +{ +} + + +JSValue::Type JSScalar::type() const +{ + return _type; +} + + +const std::string& JSScalar::stringValue() const +{ + return _value; +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/JSValue.cpp b/RemotingNG/JSONRPC/src/JSValue.cpp new file mode 100644 index 0000000000..5a58eef251 --- /dev/null +++ b/RemotingNG/JSONRPC/src/JSValue.cpp @@ -0,0 +1,68 @@ +// +// JSValue.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSValue +// Module: JSValue +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/JSValue.h" +#include "Poco/Exception.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +std::size_t JSValue::size() const +{ + return 0; +} + + +const std::string& JSValue::stringValue() const +{ + throw Poco::NotImplementedException("Cannot create string representation of non-scalar JSValue"); +} + + +const JSValue::Ptr& JSValue::operator [] (const std::string& name) const +{ + throw Poco::InvalidAccessException("Named value access is only supported for JSObject"); +} + + +JSValue::Ptr& JSValue::operator [] (const std::string& name) +{ + throw Poco::InvalidAccessException("Named value access is only supported for JSObject"); +} + + +const JSValue::Ptr& JSValue::operator [] (std::size_t index) const +{ + throw Poco::InvalidAccessException("Ordered value access is only supported for JSArray"); +} + + +JSValue::Ptr& JSValue::operator [] (std::size_t index) +{ + throw Poco::InvalidAccessException("Ordered value access is only supported for JSArray"); +} + + +bool JSValue::has(const std::string& name) const +{ + return false; +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/Listener.cpp b/RemotingNG/JSONRPC/src/Listener.cpp new file mode 100644 index 0000000000..4b5ad6f7b3 --- /dev/null +++ b/RemotingNG/JSONRPC/src/Listener.cpp @@ -0,0 +1,140 @@ +// +// Listener.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: Listener +// +// Copyright (c) 2006-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/Listener.h" +#include "Poco/RemotingNG/JSONRPC/Transport.h" +#include "Poco/RemotingNG/JSONRPC/JSONRPCRequestHandlerFactory.h" +#include "Poco/Net/HTTPRequestHandlerFactory.h" +#include "Poco/Net/HTTPServerRequest.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +Listener::Listener(const std::string& endPoint, Protocol proto): + Poco::RemotingNG::Listener(endPoint), + _secure(proto == PROTO_HTTPS), + _enableChunkedTransferEncoding(true), + _enableCompression(true), + _enableCORS(false) +{ +} + + +Listener::Listener(const std::string& endPoint, Poco::Net::HTTPServerParams::Ptr pParams): + Poco::RemotingNG::Listener(endPoint), + _secure(false), + _enableChunkedTransferEncoding(true), + _enableCompression(true), + _enableCORS(false) +{ + Poco::Net::SocketAddress addr(endPoint); + Poco::Net::ServerSocket socket(addr); + _pHTTPServer = new Poco::Net::HTTPServer(new JSONRPCRequestHandlerFactory(*this), socket, pParams); +} + + +Listener::Listener(const std::string& endPoint, const Poco::Net::ServerSocket& socket, Poco::Net::HTTPServerParams::Ptr pParams): + Poco::RemotingNG::Listener(endPoint), + _secure(socket.secure()), + _enableChunkedTransferEncoding(true), + _enableCompression(true), + _enableCORS(false) +{ + _pHTTPServer = new Poco::Net::HTTPServer(new JSONRPCRequestHandlerFactory(*this), socket, pParams); +} + + +Listener::~Listener() +{ +} + + +void Listener::enableChunkedTransferEncoding(bool enable) +{ + _enableChunkedTransferEncoding = enable; +} + + +void Listener::enableCompression(bool enable) +{ + _enableCompression = enable; +} + + +void Listener::enableCORS(bool enable) +{ + _enableCORS = enable; +} + + +void Listener::setCORSAllowedOrigin(const std::string& origin) +{ + _corsAllowedOrigin = origin; +} + + +void Listener::start() +{ + if (_pHTTPServer) _pHTTPServer->start(); +} + + +void Listener::stop() +{ + if (_pHTTPServer) _pHTTPServer->stop(); +} + + +const std::string& Listener::protocol() const +{ + return Transport::PROTOCOL; +} + + +std::string Listener::createURI(const Poco::RemotingNG::Identifiable::TypeId& typeId, const Poco::RemotingNG::Identifiable::ObjectId& objectId) +{ + std::string uri(_secure ? "https://" : "http://"); + uri += endPoint(); + uri += '/'; + uri += protocol(); + uri += '/'; + uri += typeId; + uri += '/'; + uri += objectId; + return uri; +} + + +bool Listener::handlesURI(const std::string& /*uri*/) +{ + return false; +} + + +void Listener::registerObject(Poco::RemotingNG::RemoteObject::Ptr /*pRemoteObject*/, Poco::RemotingNG::Skeleton::Ptr /*pSkeleton*/) +{ +} + + +void Listener::unregisterObject(Poco::RemotingNG::RemoteObject::Ptr /*pRemoteObject*/) +{ +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/Serializer.cpp b/RemotingNG/JSONRPC/src/Serializer.cpp new file mode 100644 index 0000000000..1c9e459ebd --- /dev/null +++ b/RemotingNG/JSONRPC/src/Serializer.cpp @@ -0,0 +1,314 @@ +// +// Serializer.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: Serializer +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/Serializer.h" +#include "Poco/NumberFormatter.h" +#include "Poco/Base64Encoder.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +const std::string Serializer::JSON_JSONRPC("jsonrpc"); +const std::string Serializer::JSON_VERSION("2.0"); +const std::string Serializer::JSON_METHOD("method"); +const std::string Serializer::JSON_PARAMS("params"); +const std::string Serializer::JSON_ID("id"); +const std::string Serializer::JSON_RESULT("result"); +const std::string Serializer::JSON_ERROR("error"); +const std::string Serializer::JSON_CODE("code"); +const std::string Serializer::JSON_MESSAGE("message"); +const std::string Serializer::JSON_TRUE("true"); +const std::string Serializer::JSON_FALSE("false"); +const std::string Serializer::JSON_NULL("null"); + + +Serializer::Serializer(): + _pStream(0), + _indent(0), + _id(0) +{ +} + + +Serializer::~Serializer() +{ +} + + +void Serializer::setupImpl(std::ostream& out) +{ + resetImpl(); + _pStream = &out; +} + + +void Serializer::serializeMessageBegin(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type) +{ + poco_assert_dbg(_pStream); + + switch (type) + { + case Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST: + *_pStream << + "{\n" << + "\t\"" << JSON_JSONRPC << "\": \"" << JSON_VERSION << "\",\n" << + "\t\"" << JSON_ID << "\": " << _id++ << ",\n" << + "\t\"" << JSON_METHOD << "\": \"" << name << "\",\n" << + "\t\"" << JSON_PARAMS << "\":\n" << + "\t{"; + _indent = 2; + _state.push_back(ST_OBJECT_FIRST); + break; + + case Poco::RemotingNG::SerializerBase::MESSAGE_REPLY: + *_pStream << + "{\n" << + "\t\"" << JSON_JSONRPC << "\": \"" << JSON_VERSION << "\",\n" << + "\t\"" << JSON_ID << "\": " << _id++ << ",\n" << + "\t\"" << JSON_RESULT << "\":\n" << + "\t{"; + _indent = 2; + _state.push_back(ST_OBJECT_FIRST); + break; + + default: + poco_bugcheck(); + } +} + + +void Serializer::serializeMessageEnd(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type) +{ + poco_assert_dbg(_pStream); + + switch (type) + { + case Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST: + case Poco::RemotingNG::SerializerBase::MESSAGE_REPLY: + _state.pop_back(); + _indent = 0; + *_pStream << + "\n" << + "\t}\n" << + "}\n"; + _pStream->flush(); + _pStream = 0; + break; + + default: + poco_bugcheck(); + } +} + + +void Serializer::serializeFaultMessage(const std::string& methodName, const Poco::Exception& e) +{ + poco_assert_dbg(_pStream); + + *_pStream << + "{\n" << + "\t\"" << JSON_JSONRPC << "\": \"" << JSON_VERSION << "\",\n" << + "\t\"" << JSON_ERROR << "\":\n" << + "\t{\n" << + "\t\t\"" << JSON_CODE << "\": " << 32000 << ",\n" << + "\t\t\"" << JSON_MESSAGE << "\": " << escapeString(e.displayText()) << "\n" << + "\t}\n" << + "}\n"; + _pStream->flush(); +} + + +void Serializer::serializeStructBegin(const std::string& name) +{ + if (!_state.empty()) + { + writeSeparator(); + if (_state.back() != ST_ARRAY) + { + *_pStream << std::string(_indent, '\t') << "\"" << name << "\":\n"; + } + } + *_pStream << std::string(_indent, '\t') << "{"; + ++_indent; + _state.push_back(ST_OBJECT_FIRST); +} + + +void Serializer::serializeStructEnd(const std::string& name) +{ + _state.pop_back(); + --_indent; + *_pStream << + "\n" << + std::string(_indent, '\t') << "}"; +} + + +void Serializer::serializeSequenceBegin(const std::string& name, Poco::UInt32 numElems) +{ + if (!_state.empty()) + { + writeSeparator(); + if (_state.back() != ST_ARRAY) + { + *_pStream << std::string(_indent, '\t') << "\"" << name << "\":\n"; + } + } + *_pStream << std::string(_indent, '\t') << "["; + ++_indent; + _state.push_back(ST_ARRAY_FIRST); +} + + +void Serializer::serializeSequenceEnd(const std::string& name) +{ + _state.pop_back(); + --_indent; + *_pStream << + "\n" << + std::string(_indent, '\t') << "]"; +} + + +void Serializer::serializeNullableBegin(const std::string& name, bool isNull) +{ + if (isNull) + { + serializeData(name, JSON_NULL); + } +} + + +void Serializer::serializeNullableEnd(const std::string&) +{ +} + + +void Serializer::serialize(const std::string& name, char val) +{ + std::string tmp("\""); + tmp += val; + tmp += '\"'; + serializeData(name, tmp); +} + + +void Serializer::serialize(const std::string& name, const std::vector& val) +{ + std::stringstream base64; + base64 << '\"'; + Poco::Base64Encoder encoder(base64); + encoder.write(&val[0], static_cast(val.size())); + encoder.close(); + base64 << '\"'; + serializeData(name, base64.str()); +} + + +void Serializer::serialize(const std::string& name, const std::string& val) +{ + serializeData(name, escapeString(val)); +} + + +void Serializer::serializeData(const std::string& name, const std::string& val) +{ + writeSeparator(); + *_pStream << std::string(_indent, '\t'); + if (_state.back() != ST_ARRAY) + { + *_pStream << "\"" << name << "\": "; + } + *_pStream << val; +} + + +void Serializer::writeSeparator() +{ + switch (_state.back()) + { + case ST_OBJECT_FIRST: + *_pStream << "\n"; + _state.back() = ST_OBJECT; + break; + case ST_ARRAY_FIRST: + *_pStream << "\n"; + _state.back() = ST_ARRAY; + break; + default: + *_pStream << ",\n"; + break; + } +} + + +void Serializer::resetImpl() +{ + _indent = 0; + _state.clear(); +} + + +std::string Serializer::escapeString(const std::string& val) +{ + std::string str("\""); + for (std::string::const_iterator it = val.begin(); it != val.end(); ++it) + { + switch (*it) + { + case '\f': + str += "\\f"; + break; + case '\t': + str += "\\t"; + break; + case '\r': + str += "\\r"; + break; + case '\n': + str += "\\n"; + break; + case '\b': + str += "\\b"; + break; + case '"': + str += "\\\""; + break; + case '\\': + str += "\\\\"; + break; + default: + if (static_cast(*it) < ' ') + { + str += "\\u"; + Poco::NumberFormatter::appendHex(str, static_cast(static_cast(*it)), 4); + } + else + { + str += *it; + } + } + } + str.append("\""); + return str; +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/Transport.cpp b/RemotingNG/JSONRPC/src/Transport.cpp new file mode 100644 index 0000000000..f44b391273 --- /dev/null +++ b/RemotingNG/JSONRPC/src/Transport.cpp @@ -0,0 +1,454 @@ +// +// Transport.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: Transport +// +// Copyright (c) 2006-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/Transport.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/Net/HTTPRequest.h" +#include "Poco/Net/HTTPResponse.h" +#include "Poco/Net/HTTPSessionFactory.h" +#include "Poco/Net/HTTPBasicCredentials.h" +#include "Poco/NullStream.h" +#include "Poco/InflatingStream.h" +#include "Poco/DeflatingStream.h" +#include "Poco/StreamCopier.h" +#include "Poco/NumberFormatter.h" + + +using namespace std::string_literals; + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +const std::string Transport::PROTOCOL("jsonrpc"); +const std::string Transport::USER_AGENT("User-Agent"); +const std::string Transport::CONTENT_TYPE("application/json; charset=\"utf-8\""); + + +Poco::Net::HTTPSessionFactory Transport::_httpSessionFactory; + + +Transport::Transport(): + _keepAlive(false), + _chunkedTransferEncoding(true), + _compression(false), + _authMode(AUTH_NONE), + _pCookieStore(new CookieStore) +{ +} + + +Transport::~Transport() +{ +} + + +Poco::Timespan Transport::getTimeout() const +{ + return requireSession().getTimeout(); +} + + +void Transport::setTimeout(const Poco::Timespan& timeout) +{ + requireSession().setTimeout(timeout); +} + + +bool Transport::isKeepAliveEnabled() const +{ + return _keepAlive; +} + + +void Transport::enableKeepAlive(bool enable) +{ + requireSession().setKeepAlive(enable); + _keepAlive = enable; +} + + +Poco::Timespan Transport::getKeepAliveTimeout() const +{ + return requireSession().getKeepAliveTimeout(); +} + + +void Transport::setKeepAliveTimeout(const Poco::Timespan& timeout) +{ + requireSession().setKeepAliveTimeout(timeout); +} + + +bool Transport::isChunkedTransferEncodingEnabled() const +{ + return _chunkedTransferEncoding; +} + + +void Transport::enableChunkedTransferEncoding(bool enable) +{ + _chunkedTransferEncoding = enable; +} + + +bool Transport::isCompressionEnabled() const +{ + return _compression; +} + + +void Transport::enableCompression(bool enable) +{ + _compression = enable; +} + + +void Transport::setAuthentication(AuthMode mode) +{ + _authMode = mode; +} + + +Transport::AuthMode Transport::getAuthentication() const +{ + return _authMode; +} + + +void Transport::setCredentials(const Credentials& creds) +{ + setUsername(creds.getAttribute(Credentials::ATTR_USERNAME)); + setPassword(creds.getAttribute(Credentials::ATTR_PASSWORD)); +} + + +Credentials Transport::getCredentials() const +{ + Credentials creds; + creds.setAttribute(Credentials::ATTR_USERNAME, getUsername()); + creds.setAttribute(Credentials::ATTR_PASSWORD, getPassword()); + return creds; +} + + +void Transport::setUsername(const std::string& username) +{ + _creds.setUsername(username); +} + + +const std::string& Transport::getUsername() const +{ + return _creds.getUsername(); +} + + +void Transport::setPassword( const std::string& password) +{ + _creds.setPassword(password); +} + + +const std::string& Transport::getPassword() const +{ + return _creds.getPassword(); +} + + +const std::string& Transport::getUserAgent() const +{ + return _userAgent; +} + + +void Transport::setUserAgent(const std::string& userAgent) +{ + _userAgent = userAgent; +} + + +void Transport::setCustomHeader(const std::string& name, const std::string& value) +{ + _customHeaders[name] = value; +} + + +void Transport::removeCustomHeader(const std::string& name) +{ + _customHeaders.erase(name); +} + + +bool Transport::hasCustomHeader(const std::string& name) const +{ + return _customHeaders.find(name) != _customHeaders.end(); +} + + +const std::string& Transport::getCustomHeader(const std::string& name) const +{ + const auto it = _customHeaders.find(name); + if (it != _customHeaders.end()) + return it->second; + else + throw Poco::NotFoundException(name); +} + + +void Transport::setProxyConfig(const Poco::Net::ProxyConfig& proxyConfig) +{ + _proxyConfig = proxyConfig; +} + + +const Poco::Net::ProxyConfig& Transport::getProxyConfig() const +{ + return _proxyConfig; +} + + +CookieStore::Ptr Transport::getCookieStore() const +{ + return _pCookieStore; +} + + +void Transport::setCookieStore(CookieStore::Ptr pCookieStore) +{ + _pCookieStore = pCookieStore; +} + + +const std::string& Transport::endPoint() const +{ + return _endPoint; +} + + +void Transport::connect(const std::string& endPoint) +{ + _endPoint = endPoint; + _endPointURI = endPoint; + _pSession = _httpSessionFactory.createClientSession(_endPointURI); + _pSession->setKeepAlive(_keepAlive); + if (!_proxyConfig.host.empty()) + { + _pSession->setProxyConfig(_proxyConfig); + } +} + + +void Transport::disconnect() +{ + _pSession = 0; + _endPoint.clear(); + _endPointURI.clear(); +} + + +bool Transport::connected() const +{ + return !_pSession.isNull(); +} + + +Poco::RemotingNG::Serializer& Transport::beginMessage(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType) +{ + return beginRequest(oid, tid, messageName, messageType); +} + + +void Transport::sendMessage(const Poco::RemotingNG::Identifiable::ObjectId& /*oid*/, const Poco::RemotingNG::Identifiable::TypeId& /*tid*/, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType /*messageType*/) +{ + _pDeflater = 0; + if (!_chunkedTransferEncoding) + { + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, _endPointURI.getPathEtc(), Poco::Net::HTTPMessage::HTTP_1_1); + prepareRequest(request, messageName); + request.setContentLength(static_cast(_pStream->tellp())); + std::ostream& ostr = _pSession->sendRequest(request); + Poco::StreamCopier::copyStream(*_pStream, ostr); + } + + Poco::Net::HTTPResponse response; + std::istream& istr = _pSession->receiveResponse(response); + if (_pCookieStore) + { + _pCookieStore->updateCookies(response); + } + Poco::NullOutputStream ostr; + Poco::StreamCopier::copyStream(istr, ostr); +} + + +Poco::RemotingNG::Serializer& Transport::beginRequest(const Poco::RemotingNG::Identifiable::ObjectId& /*oid*/, const Poco::RemotingNG::Identifiable::TypeId& /*tid*/, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType) +{ + if (messageType == Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST) + { + if (_chunkedTransferEncoding) + { + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, _endPointURI.getPathEtc(), Poco::Net::HTTPMessage::HTTP_1_1); + prepareRequest(request, messageName); + std::ostream& ostr = _pSession->sendRequest(request); + if (_compression) + { + _pDeflater = new Poco::DeflatingOutputStream(ostr, Poco::DeflatingStreamBuf::STREAM_GZIP, 1); + _serializer.setup(*_pDeflater); + } + else + { + _serializer.setup(ostr); + } + } + else + { + _pStream = new std::stringstream; + _serializer.setup(*_pStream); + } + return _serializer; + } + else + { + poco_bugcheck(); + throw Poco::BugcheckException(); + } +} + + +Poco::RemotingNG::Deserializer& Transport::sendRequest(const Poco::RemotingNG::Identifiable::ObjectId& /*oid*/, const Poco::RemotingNG::Identifiable::TypeId& /*tid*/, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType /*messageType*/) +{ + _pDeflater = 0; + Poco::Net::HTTPResponse response; + std::istream* pResponseStream; + + if (!_chunkedTransferEncoding) + { + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, _endPointURI.getPathEtc(), Poco::Net::HTTPMessage::HTTP_1_1); + prepareRequest(request, messageName); + request.setContentLength(static_cast(_pStream->tellp())); + std::ostream& requestStream = _pSession->sendRequest(request); + Poco::StreamCopier::copyStream(*_pStream, requestStream); + pResponseStream = &_pSession->receiveResponse(response); + + if (response.getStatus() == Poco::Net::HTTPResponse::HTTP_UNAUTHORIZED && (_authMode == AUTH_DIGEST || _authMode == AUTH_ANY)) + { + Poco::NullOutputStream nullStream; + Poco::StreamCopier::copyStream(*pResponseStream, nullStream); + + _creds.authenticate(request, response); + std::ostream& requestStream = _pSession->sendRequest(request); + _pStream->clear(); + _pStream->seekg(0); + Poco::StreamCopier::copyStream(*_pStream, requestStream); + pResponseStream = &_pSession->receiveResponse(response); + } + } + else + { + pResponseStream = &_pSession->receiveResponse(response); + } + if (_pCookieStore) + { + _pCookieStore->updateCookies(response); + } + + if (response.getStatus() == Poco::Net::HTTPResponse::HTTP_OK) + { + if (response.get("Content-Encoding"s, ""s) == "gzip") + { + Poco::InflatingInputStream inflater(*pResponseStream, Poco::InflatingStreamBuf::STREAM_GZIP); + _deserializer.setup(inflater); + } + else + { + _deserializer.setup(*pResponseStream); + } + + // consume extra response content + int ch = pResponseStream->get(); + while (ch != -1) ch = pResponseStream->get(); + + return _deserializer; + } + else + { + Poco::NullOutputStream nullStream; + Poco::StreamCopier::copyStream(*pResponseStream, nullStream); + throw Poco::RemotingNG::TransportException("HTTP Error", response.getReason()); + } +} + + +void Transport::endRequest() +{ + _serializer.reset(); + _deserializer.reset(); + _pStream = 0; + _pDeflater = 0; +} + + +const Poco::Net::HTTPClientSession& Transport::requireSession() const +{ + if (_pSession) + return *_pSession; + else + throw Poco::IllegalStateException("Transport not connected"); +} + + +Poco::Net::HTTPClientSession& Transport::requireSession() +{ + if (_pSession) + return *_pSession; + else + throw Poco::IllegalStateException("Transport not connected"); +} + + +void Transport::prepareRequest(Poco::Net::HTTPRequest& request, const std::string& /*messageName*/) +{ + request.setContentType(CONTENT_TYPE); + request.setChunkedTransferEncoding(_chunkedTransferEncoding); + request.set("Accept-Encoding"s, "gzip"s); + if (_compression && _chunkedTransferEncoding) + { + request.set("Content-Encoding"s, "gzip"s); + } + if (_authMode == AUTH_BASIC) + { + Poco::Net::HTTPBasicCredentials creds(_creds.getUsername(), _creds.getPassword()); + creds.authenticate(request); + } + if (!_userAgent.empty()) + { + request.set(USER_AGENT, _userAgent); + } + for (const auto& p: _customHeaders) + { + request.set(p.first, p.second); + } + if (_pCookieStore) + { + _pCookieStore->addCookies(request); + } +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/src/TransportFactory.cpp b/RemotingNG/JSONRPC/src/TransportFactory.cpp new file mode 100644 index 0000000000..a190ce0074 --- /dev/null +++ b/RemotingNG/JSONRPC/src/TransportFactory.cpp @@ -0,0 +1,58 @@ +// +// TransportFactory.cpp +// +// Library: RemotingNG/JSONRPC +// Package: JSONRPC +// Module: TransportFactory +// +// Copyright (c) 2006-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/JSONRPC/TransportFactory.h" +#include "Poco/RemotingNG/JSONRPC/Transport.h" +#include "Poco/RemotingNG/TransportFactoryManager.h" +#include "Poco/Net/HTTPSessionInstantiator.h" + + +namespace Poco { +namespace RemotingNG { +namespace JSONRPC { + + +TransportFactory::TransportFactory() +{ +} + + +TransportFactory::~TransportFactory() +{ +} + + +Poco::RemotingNG::Transport* TransportFactory::createTransport() +{ + return new Transport; +} + + +void TransportFactory::registerFactory() +{ + Transport::httpSessionFactory().registerProtocol("http", new Poco::Net::HTTPSessionInstantiator); + Poco::RemotingNG::TransportFactoryManager::instance().registerFactory(Transport::PROTOCOL, new TransportFactory); +} + + +void TransportFactory::unregisterFactory() +{ + Poco::RemotingNG::TransportFactoryManager::instance().unregisterFactory(Transport::PROTOCOL); + Transport::httpSessionFactory().unregisterProtocol("http"); +} + + +} } } // namespace Poco::RemotingNG::JSONRPC diff --git a/RemotingNG/JSONRPC/testsuite/CMakeLists.txt b/RemotingNG/JSONRPC/testsuite/CMakeLists.txt new file mode 100644 index 0000000000..53b407d558 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/CMakeLists.txt @@ -0,0 +1,32 @@ +# Sources +file(GLOB SRCS_G "src/*.cpp") +POCO_SOURCES_AUTO(TEST_SRCS ${SRCS_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "src/*.h") +POCO_HEADERS_AUTO(TEST_SRCS ${HDRS_G}) + +POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF + src/WinDriver.cpp +) + +add_executable(RemotingNGJSONRPC-testrunner ${TEST_SRCS}) +if(ANDROID) + add_test( + NAME RemotingNGJSONRPC + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/RemotingNGJSONRPC-testrunner -DTEST_PARAMETER=-all -P ${PROJECT_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake + ) +else() + add_test( + NAME RemotingNGJSONRPC + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND RemotingNGJSONRPC-testrunner -ignore ${PROJECT_SOURCE_DIR}/cppignore.lnx -all + ) + set_tests_properties(RemotingNGJSONRPC PROPERTIES ENVIRONMENT POCO_BASE=${PROJECT_SOURCE_DIR}) +endif() + +target_link_libraries(RemotingNGJSONRPC-testrunner PUBLIC Poco::RemotingNGJSONRPC Poco::RemotingNG Poco::Net CppUnit) +target_include_directories(RemotingNGJSONRPC-testrunner + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include +) diff --git a/RemotingNG/JSONRPC/testsuite/Makefile b/RemotingNG/JSONRPC/testsuite/Makefile new file mode 100644 index 0000000000..f14f66f842 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/Makefile @@ -0,0 +1,29 @@ +# +# Makefile +# +# Makefile for Poco RemotingNG JSONRPC Transport testsuite +# + +include $(POCO_BASE)/build/rules/global + +objects = \ + Driver \ + RemotingTest \ + SerializerTest \ + DeserializerTest \ + JSONParserTest \ + JSONRPCTestSuite \ + Tester \ + ITester \ + TesterClientHelper \ + TesterProxy \ + TesterProxyFactory \ + TesterRemoteObject \ + TesterServerHelper \ + TesterSkeleton + +target = testrunner +target_version = 1 +target_libs = PocoRemotingNGJSONRPC PocoRemotingNG PocoNet PocoFoundation CppUnit + +include $(POCO_BASE)/build/rules/exec diff --git a/RemotingNG/JSONRPC/testsuite/RemoteGen.xml b/RemotingNG/JSONRPC/testsuite/RemoteGen.xml new file mode 100644 index 0000000000..d72796584e --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/RemoteGen.xml @@ -0,0 +1,18 @@ + + + + + ../../../Foundation/include/Poco/Timestamp.h + src/Tester.h + + + + src + src + src + false + both + false + + + diff --git a/RemotingNG/JSONRPC/testsuite/src/Class1Deserializer.h b/RemotingNG/JSONRPC/testsuite/src/Class1Deserializer.h new file mode 100644 index 0000000000..1fa34f1dbd --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Class1Deserializer.h @@ -0,0 +1,66 @@ +// +// Class1Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Class1_INCLUDED +#define TypeDeserializer_Class1_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Class1& value) + { + using namespace std::string_literals; + + bool ret = deser.deserializeStructBegin(name, isMandatory); + if (ret) + { + deserializeImpl(deser, value); + deser.deserializeStructEnd(name); + } + return ret; + } + + static void deserializeImpl(Deserializer& deser, Class1& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"anEnum"s,"anInt"s,"aString"s}; + bool ret = false; + int gen_anEnum; + ret = TypeDeserializer::deserialize(REMOTING__NAMES[0], true, deser, gen_anEnum); + if (ret) value.setAnEnum(static_cast(gen_anEnum)); + int gen_anInt; + ret = TypeDeserializer::deserialize(REMOTING__NAMES[1], true, deser, gen_anInt); + if (ret) value.setAnInt(gen_anInt); + std::string gen_aString; + ret = TypeDeserializer::deserialize(REMOTING__NAMES[2], true, deser, gen_aString); + if (ret) value.setAString(gen_aString); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Class1_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/Class1Serializer.h b/RemotingNG/JSONRPC/testsuite/src/Class1Serializer.h new file mode 100644 index 0000000000..31094a9e94 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Class1Serializer.h @@ -0,0 +1,55 @@ +// +// Class1Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Class1_INCLUDED +#define TypeSerializer_Class1_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Class1& value, Serializer& ser) + { + using namespace std::string_literals; + + ser.serializeStructBegin(name); + serializeImpl(value, ser); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Class1& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"anEnum"s,"anInt"s,"aString"s,""s}; + TypeSerializer::serialize(REMOTING__NAMES[0], static_cast(value.getAnEnum()), ser); + TypeSerializer::serialize(REMOTING__NAMES[1], value.getAnInt(), ser); + TypeSerializer::serialize(REMOTING__NAMES[2], value.getAString(), ser); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Class1_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/DeserializerTest.cpp b/RemotingNG/JSONRPC/testsuite/src/DeserializerTest.cpp new file mode 100644 index 0000000000..6564047f6e --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/DeserializerTest.cpp @@ -0,0 +1,484 @@ +// +// DeserializerTest.cpp +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "DeserializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/JSONRPC/Deserializer.h" +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include + + +using namespace Poco::RemotingNG::JSONRPC; + + +DeserializerTest::DeserializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +DeserializerTest::~DeserializerTest() +{ +} + + +void DeserializerTest::testEmptyRequest() +{ + std::string request( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"method\": \"test\",\n" + "\t\"params\":\n" + "\t{\n" + "\t}\n" + "}\n" + ); + + Deserializer deser; + std::istringstream istr(request); + deser.setup(istr); + std::string meth; + deser.findMessage(meth); + assert (meth == "test"); + deser.deserializeMessageBegin("test", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.deserializeMessageEnd("test", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); +} + + +void DeserializerTest::testOneParamRequest() +{ + std::string request( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"method\": \"test\",\n" + "\t\"params\":\n" + "\t{\n" + "\t\t\"p1\": 42\n" + "\t}\n" + "}\n" + ); + + Deserializer deser; + std::istringstream istr(request); + deser.setup(istr); + std::string meth; + deser.findMessage(meth); + assert (meth == "test"); + deser.deserializeMessageBegin("test", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int p1; + bool ok = deser.deserialize("p1", true, p1); + assert (ok); + assert (p1 == 42); + deser.deserializeMessageEnd("test", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); +} + + +void DeserializerTest::testTwoParamRequest() +{ + std::string request( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"method\": \"test\",\n" + "\t\"params\":\n" + "\t{\n" + "\t\t\"p1\": 42,\n" + "\t\t\"p2\": \"foo\"\n" + "\t}\n" + "}\n" + ); + + Deserializer deser; + std::istringstream istr(request); + deser.setup(istr); + std::string meth; + deser.findMessage(meth); + assert (meth == "test"); + deser.deserializeMessageBegin("test", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int p1; + bool ok = deser.deserialize("p1", true, p1); + assert (ok); + assert (p1 == 42); + std::string p2; + ok = deser.deserialize("p2", true, p2); + assert (ok); + assert (p2 == "foo"); + deser.deserializeMessageEnd("test", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); +} + + +void DeserializerTest::testEmptyReply() +{ + std::string reply( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"result\":\n" + "\t{\n" + "\t}\n" + "}\n" + ); + + Deserializer deser; + std::istringstream istr(reply); + deser.setup(istr); + deser.deserializeMessageBegin("test", Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + deser.deserializeMessageEnd("test", Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); +} + + +void DeserializerTest::testOneParamReply() +{ + std::string reply( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"result\":\n" + "\t{\n" + "\t\t\"return\": 42\n" + "\t}\n" + "}\n" + ); + + Deserializer deser; + std::istringstream istr(reply); + deser.setup(istr); + deser.deserializeMessageBegin("test", Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int ret; + bool ok = deser.deserialize("return", true, ret); + assert (ok); + assert (ret == 42); + deser.deserializeMessageEnd("test", Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); +} + + +void DeserializerTest::testTwoParamReply() +{ + std::string reply( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"result\":\n" + "\t{\n" + "\t\t\"return\": 42,\n" + "\t\t\"p1\": \"bar\"\n" + "\t}\n" + "}\n" + ); + + Deserializer deser; + std::istringstream istr(reply); + deser.setup(istr); + deser.deserializeMessageBegin("test", Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int ret; + bool ok = deser.deserialize("return", true, ret); + assert (ok); + assert (ret == 42); + std::string p1; + ok = deser.deserialize("p1", true, p1); + assert (ok); + assert (p1 == "bar"); + deser.deserializeMessageEnd("test", Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); +} + + +void DeserializerTest::testComplexRequest() +{ + std::string reply( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"result\":\n" + "\t{\n" + "\t\t\"p1\":\n" + "\t\t[\n" + "\t\t\t1,\n" + "\t\t\t2\n" + "\t\t],\n" + "\t\t\"p2\":\n" + "\t\t{\n" + "\t\t\t\"p21\": 1,\n" + "\t\t\t\"p22\": 2\n" + "\t\t}\n" + "\t}\n" + "}\n" + ); + + Deserializer deser; + std::istringstream istr(reply); + deser.setup(istr); + deser.deserializeMessageBegin("test", Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::UInt32 size; + bool ok = deser.deserializeSequenceBegin("p1", true, size); + assert (ok); + assert (size == 2); + int p1; + ok = deser.deserialize("p1", true, p1); + assert (ok); + assert (p1 == 1); + ok = deser.deserialize("p1", true, p1); + assert (ok); + assert (p1 == 2); + deser.deserializeSequenceEnd("p1"); + ok = deser.deserializeStructBegin("p2", true); + int p21; + ok = deser.deserialize("p21", true, p21); + assert (ok); + assert (p21 == 1); + int p22; + ok = deser.deserialize("p22", true, p22); + assert (ok); + assert (p22 == 2); + deser.deserializeStructEnd("p2"); + deser.deserializeMessageEnd("test", Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); +} + + +void DeserializerTest::testError() +{ + std::string reply( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"error\":\n" + "\t{\n" + "\t\t\"code\": 32000,\n" + "\t\t\"message\": \"Syntax error\"\n" + "\t}\n" + "}\n" + ); + + try + { + Deserializer deser; + std::istringstream istr(reply); + deser.setup(istr); + deser.deserializeMessageBegin("test", Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + deser.deserializeMessageEnd("test", Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.code() == 32000); + assert (exc.message() == "Syntax error"); + } +} + + +void DeserializerTest::testObject() +{ + std::string object( + "{\n" + "\t\"value\": \"foo\"\n" + "}" + ); + + Deserializer deser; + std::istringstream istr(object); + deser.setup(istr); + deser.deserializeStructBegin("", true); + std::string value; + bool ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "foo"); + deser.deserializeStructEnd(""); +} + + +void DeserializerTest::testUnexpectedArray() +{ + std::string array( + "[\n" + "\t\"foo\"\n" + "]" + ); + + Deserializer deser; + std::istringstream istr(array); + deser.setup(istr); + try + { + deser.deserializeStructBegin("", true); + fail("expects object - must throw"); + } + catch (Poco::RemotingNG::DeserializerException&) + { + } +} + + +void DeserializerTest::testArray() +{ + std::string array( + "[\n" + "\t\"foo\",\n" + "\t\"bar\"\n" + "]" + ); + + Deserializer deser; + std::istringstream istr(array); + deser.setup(istr); + Poco::UInt32 length; + deser.deserializeSequenceBegin("", true, length); + assert (length == 2); + std::string value; + bool ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "foo"); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "bar"); + deser.deserializeSequenceEnd(""); +} + + +void DeserializerTest::testUnexpectedObject() +{ + std::string object( + "{\n" + "\t\"value\": \"foo\"\n" + "}" + ); + + Deserializer deser; + std::istringstream istr(object); + deser.setup(istr); + Poco::UInt32 length; + try + { + deser.deserializeSequenceBegin("", true, length); + fail ("expected array - must throw"); + } + catch (Poco::RemotingNG::DeserializerException&) + { + } +} + + +void DeserializerTest::testComplexObject() +{ + std::string object( + "{\n" + "\t\"object\":\n" + "\t{\n" + "\t\t\"value\": \"foo\"\n" + "\t},\n" + "\t\"array\":\n" + "\t[\n" + "\t\t\"foo\",\n" + "\t\t\"bar\"\n" + "\t]\n" + "}" + ); + + Deserializer deser; + std::istringstream istr(object); + deser.setup(istr); + deser.deserializeStructBegin("", true); + deser.deserializeStructBegin("object", true); + std::string value; + bool ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "foo"); + deser.deserializeStructEnd("object"); + Poco::UInt32 length; + deser.deserializeSequenceBegin("array", true, length); + assert (length == 2); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "foo"); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "bar"); + deser.deserializeSequenceEnd("array"); + deser.deserializeStructEnd(""); +} + + +void DeserializerTest::testComplexArray() +{ + std::string array( + "[\n" + "\t[\n" + "\t\t\"foo\"\n" + "\t],\n" + "\t[\n" + "\t\t\"f00\",\n" + "\t\t\"bar\",\n" + "\t\t\"baz\"\n" + "\t]\n" + "]" + ); + + Deserializer deser; + std::istringstream istr(array); + deser.setup(istr); + Poco::UInt32 length; + deser.deserializeSequenceBegin("", true, length); + assert (length == 2); + deser.deserializeSequenceBegin("array", true, length); + assert (length == 1); + std::string value; + bool ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "foo"); + deser.deserializeSequenceEnd("array"); + + deser.deserializeSequenceBegin("array", true, length); + assert (length == 3); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "f00"); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "bar"); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "baz"); + deser.deserializeSequenceEnd("array"); + deser.deserializeSequenceEnd(""); +} + + +void DeserializerTest::setUp() +{ +} + + +void DeserializerTest::tearDown() +{ +} + + +CppUnit::Test* DeserializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DeserializerTest"); + + CppUnit_addTest(pSuite, DeserializerTest, testEmptyRequest); + CppUnit_addTest(pSuite, DeserializerTest, testOneParamRequest); + CppUnit_addTest(pSuite, DeserializerTest, testTwoParamRequest); + CppUnit_addTest(pSuite, DeserializerTest, testEmptyReply); + CppUnit_addTest(pSuite, DeserializerTest, testOneParamReply); + CppUnit_addTest(pSuite, DeserializerTest, testTwoParamReply); + CppUnit_addTest(pSuite, DeserializerTest, testComplexRequest); + CppUnit_addTest(pSuite, DeserializerTest, testError); + CppUnit_addTest(pSuite, DeserializerTest, testObject); + CppUnit_addTest(pSuite, DeserializerTest, testUnexpectedArray); + CppUnit_addTest(pSuite, DeserializerTest, testArray); + CppUnit_addTest(pSuite, DeserializerTest, testUnexpectedObject); + CppUnit_addTest(pSuite, DeserializerTest, testComplexObject); + CppUnit_addTest(pSuite, DeserializerTest, testComplexArray); + + return pSuite; +} diff --git a/RemotingNG/JSONRPC/testsuite/src/DeserializerTest.h b/RemotingNG/JSONRPC/testsuite/src/DeserializerTest.h new file mode 100644 index 0000000000..6fb0b6ba5e --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/DeserializerTest.h @@ -0,0 +1,53 @@ +// +// DeserializerTest.h +// +// Definition of the DeserializerTest class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef DeserializerTest_INCLUDED +#define DeserializerTest_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "CppUnit/TestCase.h" + + +class DeserializerTest: public CppUnit::TestCase +{ +public: + DeserializerTest(const std::string& name); + ~DeserializerTest(); + + void testEmptyRequest(); + void testOneParamRequest(); + void testTwoParamRequest(); + void testEmptyReply(); + void testOneParamReply(); + void testTwoParamReply(); + void testComplexRequest(); + void testError(); + void testObject(); + void testUnexpectedArray(); + void testArray(); + void testUnexpectedObject(); + void testComplexObject(); + void testComplexArray(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // DeserializerTest_INCLUDED diff --git a/RemotingNG/JSONRPC/testsuite/src/Driver.cpp b/RemotingNG/JSONRPC/testsuite/src/Driver.cpp new file mode 100644 index 0000000000..1822f36504 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Driver.cpp @@ -0,0 +1,19 @@ +// +// Driver.cpp +// +// Console-based test driver for Poco RemotingNG JSONRPC. +// +// Copyright (c) 2006-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "CppUnit/TestRunner.h" +#include "JSONRPCTestSuite.h" + + +CppUnitMain(JSONRPCTestSuite) diff --git a/RemotingNG/JSONRPC/testsuite/src/ITester.cpp b/RemotingNG/JSONRPC/testsuite/src/ITester.cpp new file mode 100644 index 0000000000..6588bc9828 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/ITester.cpp @@ -0,0 +1,33 @@ +// +// ITester.cpp +// +// Package: Generated +// Module: ITester +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "ITester.h" + + +ITester::ITester(): + Poco::RefCountedObject() + +{ +} + + +ITester::~ITester() +{ +} + + +const Poco::RemotingNG::Identifiable::TypeId& ITester::remoting__typeId() +{ + static const std::string REMOTING__TYPE_ID("Tester"); + return REMOTING__TYPE_ID; +} + + diff --git a/RemotingNG/JSONRPC/testsuite/src/ITester.h b/RemotingNG/JSONRPC/testsuite/src/ITester.h new file mode 100644 index 0000000000..5c2c26d307 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/ITester.h @@ -0,0 +1,126 @@ +// +// ITester.h +// +// Package: Generated +// Module: ITester +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef ITester_INCLUDED +#define ITester_INCLUDED + + +#include "Poco/AutoPtr.h" +#include "Poco/RefCountedObject.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Tester.h" + + +class ITester: public virtual Poco::RefCountedObject +{ +public: + using Ptr = Poco::AutoPtr; + + ITester(); + /// Creates a ITester. + + virtual ~ITester(); + /// Destroys the ITester. + + static const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId(); + /// Returns the TypeId of the class. + + virtual void setCookie() = 0; + + virtual void testAuthenticated() = 0; + + virtual Class1 testClass11(const Class1& c1) = 0; + + virtual void testClass12(Class1& c1) = 0; + + virtual void testClass13(const Class1& c1, Class1& c2) = 0; + + virtual Enum1 testEnum11(Enum1 e1) = 0; + + virtual void testEnum12(Enum1& e1) = 0; + + virtual void testEnum13(Enum1 e1, Enum1& e2) = 0; + + virtual Struct1::Enum2 testEnum21(Struct1::Enum2 e1) = 0; + + virtual void testEnum22(Struct1::Enum2& e1) = 0; + + virtual void testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2) = 0; + + virtual void testFault() = 0; + + virtual int testInt1(int i) = 0; + + virtual void testInt2(int& i) = 0; + + virtual void testInt3(int i1, int& i2) = 0; + + virtual Poco::Int64 testNestedType(Poco::Int64 arg) = 0; + + virtual void testOneWay(const std::string& arg) = 0; + + virtual std::string testOneWayResult() = 0; + + virtual void testPermission() = 0; + + virtual Poco::SharedPtr testPtr(Poco::SharedPtr p1) = 0; + + virtual Struct1 testStruct11(const Struct1& s1) = 0; + + virtual void testStruct12(Struct1& s1) = 0; + + virtual void testStruct13(const Struct1& s1, Struct1& s2) = 0; + + virtual std::vector testStruct1Vec1(const std::vector& vec) = 0; + + virtual void testStruct1Vec2(std::vector& vec) = 0; + + virtual void testStruct1Vec3(const std::vector& vec1, std::vector& vec2) = 0; + + virtual Struct2 testStruct21(const Struct2& s1) = 0; + + virtual void testStruct22(Struct2& s1) = 0; + + virtual void testStruct23(const Struct2& s1, Struct2& s2) = 0; + + virtual Struct3 testStruct31(const Struct3& s1) = 0; + + virtual void testStruct32(Struct3& s1) = 0; + + virtual void testStruct33(const Struct3& s1, Struct3& s2) = 0; + + virtual Struct4 testStruct41(const Struct4& s1) = 0; + + virtual void testStruct42(Struct4& s1) = 0; + + virtual void testStruct43(const Struct4& s1, Struct4& s2) = 0; + + virtual Struct5 testStruct51(const Struct5& s1) = 0; + + virtual void testStruct52(Struct5& s1) = 0; + + virtual void testStruct53(const Struct5& s1, Struct5& s2) = 0; + + virtual void testSynchronized() = 0; + + virtual void testSynchronizedProxy() = 0; + + virtual void testSynchronizedRemote() = 0; + + virtual bool verifyCookie() = 0; + +}; + + + + +#endif // ITester_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/JSONParserTest.cpp b/RemotingNG/JSONRPC/testsuite/src/JSONParserTest.cpp new file mode 100644 index 0000000000..04861b5c11 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/JSONParserTest.cpp @@ -0,0 +1,356 @@ +// +// JSONParserTest.cpp +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "JSONParserTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/JSONRPC/JSONParser.h" +#include + + +using namespace Poco::RemotingNG::JSONRPC; + + +JSONParserTest::JSONParserTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +JSONParserTest::~JSONParserTest() +{ +} + + +void JSONParserTest::testNull() +{ + std::string json("null"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue.isNull()); +} + + +void JSONParserTest::testNullWithWhitespace() +{ + std::string json(" null "); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue.isNull()); +} + + +void JSONParserTest::testInt() +{ + std::string json("42"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->asInt32() == 42); +} + + +void JSONParserTest::testIntWithWhitespace() +{ + std::string json(" 42 "); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->asInt32() == 42); +} + + +void JSONParserTest::testBool() +{ + std::string json("true"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->asBool()); +} + + +void JSONParserTest::testBoolWithWhitespace() +{ + std::string json(" false"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (!pValue->asBool()); +} + + +void JSONParserTest::testDouble() +{ + std::string json("42.5"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->asDouble() == 42.5); +} + + +void JSONParserTest::testDoubleWithWhitespace() +{ + std::string json(" 42.5"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->asDouble() == 42.5); +} + + +void JSONParserTest::testString() +{ + std::string json("\"abcde\\tfgh\\f\\r\\nijk\\blmn\\u0040opq\""); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->stringValue() == "abcde\tfgh\f\r\nijk\blmn@opq"); +} + + +void JSONParserTest::testStringWithWhitespace() +{ + std::string json(" \"abcde\\tfgh\\f\\r\\nijk\\blmn\\u0040\\u0041\\u0020opq\" "); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->stringValue() == "abcde\tfgh\f\r\nijk\blmn@A opq"); +} + + +void JSONParserTest::testEmptyObject() +{ + std::string json("{}"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 0); +} + + +void JSONParserTest::testEmptyObjectWithWhitespace() +{ + std::string json(" { \r\n } "); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 0); +} + + +void JSONParserTest::testObject1() +{ + std::string json( + "{\n" + "\t\"f1\": 42\n" + "}" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 1); + assert ((*pValue)["f1"]->asInt32() == 42); +} + + +void JSONParserTest::testObject2() +{ + std::string json( + "{\n" + "\t\"f1\": 42,\n" + "\t\"f2\": \"foo\"\n" + "}" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 2); + assert ((*pValue)["f1"]->asInt32() == 42); + assert ((*pValue)["f2"]->stringValue() == "foo"); +} + + +void JSONParserTest::testObject3() +{ + std::string json( + "{" + "\"f1\":42," + "\"f2\":\"foo\"," + "\"f3\":null" + "}" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 3); + assert ((*pValue)["f1"]->asInt32() == 42); + assert ((*pValue)["f2"]->stringValue() == "foo"); + assert ((*pValue)["f3"].isNull()); +} + + +void JSONParserTest::testEmptyArray() +{ + std::string json("[]"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_ARRAY); + assert (pValue->size() == 0); +} + + +void JSONParserTest::testEmptyArrayWithWhitespace() +{ + std::string json(" [ \r\n ] "); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_ARRAY); + assert (pValue->size() == 0); +} + + +void JSONParserTest::testArray1() +{ + std::string json( + "[\n" + "\t42\n" + "]" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_ARRAY); + assert (pValue->size() == 1); + assert ((*pValue)[0]->asInt32() == 42); +} + + +void JSONParserTest::testArray2() +{ + std::string json( + "[\n" + "\t42,\n" + "\t2112\n" + "]" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_ARRAY); + assert (pValue->size() == 2); + assert ((*pValue)[0]->asInt32() == 42); + assert ((*pValue)[1]->asInt32() == 2112); +} + + +void JSONParserTest::testArray3() +{ + std::string json( + "[" + "42," + "2112," + "90125" + "]" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_ARRAY); + assert (pValue->size() == 3); + assert ((*pValue)[0]->asInt32() == 42); + assert ((*pValue)[1]->asInt32() == 2112); + assert ((*pValue)[2]->asInt32() == 90125); +} + + +void JSONParserTest::testComplexObject() +{ + std::string json( + "{" + "\"f1\":42," + "\"f2\":\"foo\"," + "\"f3\":[1,2,3]," + "\"f4\":{\"f41\":1,\"f42\":2}," + "\"f5\":[{\"f51\":1,\"f52\":2}]" + "}" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 5); + assert ((*pValue)["f1"]->asInt32() == 42); + assert ((*pValue)["f2"]->stringValue() == "foo"); + assert ((*pValue)["f3"]->type() == JSValue::JS_ARRAY); + assert ((*pValue)["f3"]->size() == 3); + assert ((*(*pValue)["f3"])[0]->asInt32() == 1); + assert ((*(*pValue)["f3"])[1]->asInt32() == 2); + assert ((*(*pValue)["f3"])[2]->asInt32() == 3); + assert ((*pValue)["f4"]->type() == JSValue::JS_OBJECT); + assert ((*pValue)["f4"]->size() == 2); + assert ((*(*pValue)["f4"])["f41"]->asInt32() == 1); + assert ((*(*pValue)["f4"])["f42"]->asInt32() == 2); + assert ((*pValue)["f5"]->type() == JSValue::JS_ARRAY); + assert ((*pValue)["f5"]->size() == 1); + assert ((*(*(*pValue)["f5"])[0])["f51"]->asInt32() == 1); + assert ((*(*(*pValue)["f5"])[0])["f52"]->asInt32() == 2); +} + + +void JSONParserTest::setUp() +{ +} + + +void JSONParserTest::tearDown() +{ +} + + +CppUnit::Test* JSONParserTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("JSONParserTest"); + + CppUnit_addTest(pSuite, JSONParserTest, testNull); + CppUnit_addTest(pSuite, JSONParserTest, testNullWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testInt); + CppUnit_addTest(pSuite, JSONParserTest, testIntWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testBool); + CppUnit_addTest(pSuite, JSONParserTest, testBoolWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testDouble); + CppUnit_addTest(pSuite, JSONParserTest, testDoubleWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testString); + CppUnit_addTest(pSuite, JSONParserTest, testStringWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testEmptyObject); + CppUnit_addTest(pSuite, JSONParserTest, testEmptyObjectWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testObject1); + CppUnit_addTest(pSuite, JSONParserTest, testObject2); + CppUnit_addTest(pSuite, JSONParserTest, testObject3); + CppUnit_addTest(pSuite, JSONParserTest, testEmptyArray); + CppUnit_addTest(pSuite, JSONParserTest, testEmptyArrayWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testArray1); + CppUnit_addTest(pSuite, JSONParserTest, testArray2); + CppUnit_addTest(pSuite, JSONParserTest, testArray3); + CppUnit_addTest(pSuite, JSONParserTest, testComplexObject); + + return pSuite; +} diff --git a/RemotingNG/JSONRPC/testsuite/src/JSONParserTest.h b/RemotingNG/JSONRPC/testsuite/src/JSONParserTest.h new file mode 100644 index 0000000000..a12c403d6b --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/JSONParserTest.h @@ -0,0 +1,60 @@ +// +// JSONParserTest.h +// +// Definition of the JSONParserTest class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef JSONParserTest_INCLUDED +#define JSONParserTest_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "CppUnit/TestCase.h" + + +class JSONParserTest: public CppUnit::TestCase +{ +public: + JSONParserTest(const std::string& name); + ~JSONParserTest(); + + void testNull(); + void testNullWithWhitespace(); + void testInt(); + void testIntWithWhitespace(); + void testBool(); + void testBoolWithWhitespace(); + void testDouble(); + void testDoubleWithWhitespace(); + void testString(); + void testStringWithWhitespace(); + void testEmptyObject(); + void testEmptyObjectWithWhitespace(); + void testObject1(); + void testObject2(); + void testObject3(); + void testEmptyArray(); + void testEmptyArrayWithWhitespace(); + void testArray1(); + void testArray2(); + void testArray3(); + void testComplexObject(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // JSONParserTest_INCLUDED diff --git a/RemotingNG/JSONRPC/testsuite/src/JSONRPCTestSuite.cpp b/RemotingNG/JSONRPC/testsuite/src/JSONRPCTestSuite.cpp new file mode 100644 index 0000000000..231303c668 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/JSONRPCTestSuite.cpp @@ -0,0 +1,34 @@ +// +// JSONRPCTestSuite.cpp +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "JSONRPCTestSuite.h" +#include "SerializerTest.h" +#include "DeserializerTest.h" +#include "JSONParserTest.h" +#include "RemotingTest.h" + + +CppUnit::Test* JSONRPCTestSuite::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("JSONRPCTestSuite"); + + pSuite->addTest(SerializerTest::suite()); + pSuite->addTest(DeserializerTest::suite()); + pSuite->addTest(JSONParserTest::suite()); + pSuite->addTest(RemotingTestJSONRPC::suite()); + pSuite->addTest(RemotingTestJSONRPCCompressed::suite()); + pSuite->addTest(RemotingTestJSONRPCNonChunked::suite()); + pSuite->addTest(RemotingTestJSONRPCAuth::suite()); + pSuite->addTest(RemotingTestJSONRPCAuthChunked::suite()); + + return pSuite; +} diff --git a/RemotingNG/JSONRPC/testsuite/src/JSONRPCTestSuite.h b/RemotingNG/JSONRPC/testsuite/src/JSONRPCTestSuite.h new file mode 100644 index 0000000000..09d89bc0d5 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/JSONRPCTestSuite.h @@ -0,0 +1,29 @@ +// +// JSONRPCTestSuite.h +// +// Definition of the JSONRPCTestSuite class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef JSONRPCTestSuite_INCLUDED +#define JSONRPCTestSuite_INCLUDED + + +#include "CppUnit/TestSuite.h" + + +class JSONRPCTestSuite +{ +public: + static CppUnit::Test* suite(); +}; + + +#endif // JSONRPCTestSuite_INCLUDED diff --git a/RemotingNG/JSONRPC/testsuite/src/RemotingTest.cpp b/RemotingNG/JSONRPC/testsuite/src/RemotingTest.cpp new file mode 100644 index 0000000000..0dd89bf705 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/RemotingTest.cpp @@ -0,0 +1,1068 @@ +// +// RemotingTest.cpp +// +// Copyright (c) 2006-2012, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "RemotingTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/Transport.h" +#include "Poco/RemotingNG/TransportFactory.h" +#include "Poco/RemotingNG/TransportFactoryManager.h" +#include "Poco/RemotingNG/Skeleton.h" +#include "Poco/RemotingNG/ORB.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/RemotingNG/Credentials.h" +#include "Poco/RemotingNG/Context.h" +#include "Poco/RemotingNG/JSONRPC/Transport.h" +#include "Poco/RemotingNG/JSONRPC/TransportFactory.h" +#include "Poco/RemotingNG/JSONRPC/Listener.h" +#include "Poco/RemotingNG/JSONRPC/JSONRPCRequestHandler.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Net/HTTPServerResponse.h" +#include "Poco/Net/HTTPRequestHandlerFactory.h" +#include "Poco/Net/HTTPBasicCredentials.h" +#include "Poco/NumberFormatter.h" +#include "Poco/DateTimeFormatter.h" +#include "Poco/NullStream.h" +#include "Poco/StreamCopier.h" +#include "Tester.h" +#include "TesterServerHelper.h" +#include "TesterClientHelper.h" +#include "TesterRemoteObject.h" +#include "TesterProxy.h" +#include + + +namespace +{ + class NoAuthRequestHandler: public Poco::Net::HTTPRequestHandler + { + public: + void handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) + { + Poco::NullOutputStream nullStream; + Poco::StreamCopier::copyStream(request.stream(), nullStream); + response.requireAuthentication("JSON-RPC"); + response.setContentLength(0); + response.send(); + } + }; + + + class JSONRPCAuthRequestHandlerFactory: public Poco::Net::HTTPRequestHandlerFactory + { + public: + JSONRPCAuthRequestHandlerFactory(Poco::RemotingNG::JSONRPC::Listener& listener): + _listener(listener) + { + } + + Poco::Net::HTTPRequestHandler* createRequestHandler(const Poco::Net::HTTPServerRequest& request) + { + if (request.hasCredentials()) + { + Poco::Net::HTTPBasicCredentials creds(request); + if (creds.getUsername() == "user" && creds.getPassword() == "s3cr3t") + { + return new Poco::RemotingNG::JSONRPC::JSONRPCRequestHandler(_listener); + } + } + return new NoAuthRequestHandler; + } + + private: + Poco::RemotingNG::JSONRPC::Listener& _listener; + }; + + + class MockAuthenticator: public Poco::RemotingNG::Authenticator + { + public: + typedef Poco::AutoPtr Ptr; + + Poco::RemotingNG::AuthenticateResult authenticate(const Poco::RemotingNG::Credentials& creds, Poco::UInt32) + { + std::string username = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, ""); + std::string password = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, ""); + + _lastUsername = username; + + if ((username == "user" && password == "pass") || (username == "admin" && password == "s3cr3t")) + return Poco::RemotingNG::AuthenticateResult(Poco::RemotingNG::AuthenticateResult::AUTH_DONE, creds); + else + return Poco::RemotingNG::AuthenticateResult(Poco::RemotingNG::AuthenticateResult::AUTH_FAILED); + } + + const std::string& lastUsername() const + { + return _lastUsername; + } + + private: + std::string _lastUsername; + }; + + + class MockAuthorizer: public Poco::RemotingNG::Authorizer + { + public: + bool authorize(const std::string& method, const std::string& permission) + { + Poco::RemotingNG::Context::Ptr pContext = Poco::RemotingNG::Context::get(); + + const Poco::RemotingNG::Credentials& creds = pContext->getCredentials(); + + std::string username = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, ""); + std::string password = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, ""); + + return username == "admin"; + } + }; +} + + +bool operator == (const Struct1& s1, const Struct1& s2) +{ + return s1.aString == s2.aString + && s1.anInt == s2.anInt + && s1.aDouble == s2.aDouble + && s1.anEnum == s2.anEnum + && s1.anEnum2 == s2.anEnum2; +} + + +bool operator == (const Struct1::Ptr s1, const Struct1::Ptr s2) +{ + return *s1 == *s2; +} + + +bool operator == (const Struct2& s1, const Struct2& s2) +{ + bool equal = s1.anURI == s2.anURI + && s1.aDateTime == s2.aDateTime + && s1.aLocalDateTime == s2.aLocalDateTime + && s1.aTimestamp == s2.aTimestamp + && s1.anUUID == s2.anUUID; + + if (!equal) return false; + if (s1.aVector.size() != s2.aVector.size()) return false; + for (int i = 0; i < s1.aVector.size(); i++) + { + if (!(s1.aVector[i] == s2.aVector[i])) return false; + } + if (s1.anotherVector.size() != s2.anotherVector.size()) return false; + for (int i = 0; i < s1.anotherVector.size(); i++) + { + if (!s1.anotherVector[i].isNull() && !s2.anotherVector[i].isNull()) + { + if (!(*s1.anotherVector[i] == *s2.anotherVector[i])) return false; + } + } + return true; +} + + +bool operator == (const Struct3& s1, const Struct3& s2) +{ + bool equal = s1.aCharVector == s2.aCharVector + && s1.aSet == s2.aSet + && s1.aMultiSet == s2.aMultiSet; + if (!equal) return false; + if (s1.aComplexVector.size() != s2.aComplexVector.size()) return false; + for (int i = 0; i < s1.aComplexVector.size(); i++) + { + if (!(s1.aComplexVector[i] == s2.aComplexVector[i])) return false; + } + return true; +} + + +bool operator == (const Struct4& s1, const Struct4& s2) +{ + bool equal = s1.value == s2.value; + if (!equal) return false; + if (s1.vec.size() != s2.vec.size()) return false; + for (int i = 0; i < s1.vec.size(); i++) + { + if (!(s1.vec[i] == s2.vec[i])) return false; + } + if (s1.ptr.isNull() != s2.ptr.isNull()) return false; + if (s1.ptr && s2.ptr && !(*s1.ptr == *s2.ptr)) return false; + return true; +} + + +RemotingTest::RemotingTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +RemotingTest::~RemotingTest() +{ +} + + +void RemotingTest::setUp() +{ + _pListener = new Poco::RemotingNG::JSONRPC::Listener("127.0.0.1:2280"); + _listener = Poco::RemotingNG::ORB::instance().registerListener(_pListener); + Poco::RemotingNG::JSONRPC::TransportFactory::registerFactory(); + _objectURI = TesterServerHelper::registerObject(new Tester, "TheTester", _listener); +} + + +void RemotingTest::tearDown() +{ + TesterServerHelper::unregisterObject(_objectURI); + Poco::RemotingNG::JSONRPC::TransportFactory::unregisterFactory(); + Poco::RemotingNG::ORB::instance().unregisterListener(_listener); + _pListener = 0; +} + + +void RemotingTest::testRegistration() +{ + assert (_objectURI == "http://127.0.0.1:2280/jsonrpc/Tester/TheTester"); +} + + +void RemotingTest::testInt() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testInt(pTester); +} + + +void RemotingTest::testEnum1() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testEnum1(pTester); +} + + +void RemotingTest::testEnum2() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testEnum2(pTester); +} + + +void RemotingTest::testNested() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testNested(pTester); +} + + +void RemotingTest::testStruct1() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct1(pTester); +} + + +void RemotingTest::testStruct2() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct2(pTester); +} + + +void RemotingTest::testStruct3() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct3(pTester); +} + + +void RemotingTest::testStruct4() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct4(pTester); +} + + +void RemotingTest::testStruct5() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct4(pTester); +} + + +void RemotingTest::testClass1() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testClass1(pTester); +} + + +void RemotingTest::testPtr() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testPtr(pTester); +} + + +void RemotingTest::testStruct1Vec() +{ + ITester::Ptr pTester = createProxy(_objectURI); + testStruct1Vec(pTester); +} + + +void RemotingTest::testOneWay() +{ + ITester::Ptr pTester = createProxy(_objectURI); + pTester->testOneWay("s3cr3t"); + + std::string result = pTester->testOneWayResult(); + assert (result == "s3cr3t"); +} + + +void RemotingTest::testFault() +{ + ITester::Ptr pTester = createProxy(_objectURI); + try + { + pTester->testFault(); + fail("must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "Application exception: Something went wrong"); + } +} + + +void RemotingTest::testCookie() +{ + ITester::Ptr pTester = createProxy(_objectURI); + pTester->setCookie(); + assert (pTester->verifyCookie()); + + Poco::Thread::sleep(6000); + assert (!pTester->verifyCookie()); +} + + +void RemotingTest::testAuthenticatedGoodCredentials() +{ + ITester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::JSONRPC::Transport& trans = static_cast(pProxy->remoting__transport()); + + trans.setUsername("user"); + trans.setPassword("pass"); + trans.setAuthentication(Poco::RemotingNG::JSONRPC::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + + pTester->testAuthenticated(); +} + + +void RemotingTest::testAuthenticatedBadCredentials() +{ + ITester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::JSONRPC::Transport& trans = static_cast(pProxy->remoting__transport()); + + trans.setUsername("user"); + trans.setPassword("bad!"); + trans.setAuthentication(Poco::RemotingNG::JSONRPC::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + + try + { + pTester->testAuthenticated(); + fail("bad credentials - must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "Authentication failed"); + } +} + + +void RemotingTest::testAuthenticatedNoCredentials() +{ + ITester::Ptr pTester = createProxy(_objectURI); + + _pListener->setAuthenticator(new MockAuthenticator); + + try + { + pTester->testAuthenticated(); + fail("no credentials - must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "Authentication failed"); + } +} + + +void RemotingTest::testPermission() +{ + ITester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::JSONRPC::Transport& trans = static_cast(pProxy->remoting__transport()); + + trans.setUsername("admin"); + trans.setPassword("s3cr3t"); + trans.setAuthentication(Poco::RemotingNG::JSONRPC::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + _pListener->setAuthorizer(new MockAuthorizer); + + pTester->testPermission(); +} + + +void RemotingTest::testNoPermission() +{ + ITester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::JSONRPC::Transport& trans = static_cast(pProxy->remoting__transport()); + + trans.setUsername("user"); + trans.setPassword("pass"); + trans.setAuthentication(Poco::RemotingNG::JSONRPC::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + _pListener->setAuthorizer(new MockAuthorizer); + + try + { + pTester->testPermission(); + fail("no permission - must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "No permission: perm1"); + } +} + + +void RemotingTest::testInt(ITester::Ptr pTester) +{ + int i = pTester->testInt1(42); + assert (i == 42); + + pTester->testInt2(i); + assert (i == 2112); + + int i2(0); + pTester->testInt3(55, i2); + assert (i2 == 55); +} + + +void RemotingTest::testEnum1(ITester::Ptr pTester) +{ + Enum1 e = pTester->testEnum11(VALUE_1); + assert (e == VALUE_1); + + pTester->testEnum12(e); + assert (e == VALUE_2); + + pTester->testEnum13(VALUE_3, e); + assert (e == VALUE_3); +} + + +void RemotingTest::testEnum2(ITester::Ptr pTester) +{ + Struct1::Enum2 e = pTester->testEnum21(Struct1::VALUE_1); + assert (e == Struct1::VALUE_1); + + pTester->testEnum22(e); + assert (e == Struct1::VALUE_2); + + pTester->testEnum23(Struct1::VALUE_3, e); + assert (e == Struct1::VALUE_3); +} + + +void RemotingTest::testNested(ITester::Ptr pTester) +{ + Poco::Timestamp::TimeVal tv1 = 12345678; + Poco::Timestamp::TimeVal tv2 = pTester->testNestedType(tv1); + assert (tv1 == tv2); +} + + +void RemotingTest::testStruct1(ITester::Ptr pTester) +{ + Struct1 s1; + s1.aString = "foobar"; + s1.anInt = 2112; + s1.aDouble = 0.5; + s1.anEnum = VALUE_1; + s1.anEnum2 = Struct1::VALUE_2; + + Struct1 s2 = pTester->testStruct11(s1); + assert (s2 == s1); + + pTester->testStruct12(s2); + assert (s2 == s1); + + Struct1 s3; + pTester->testStruct13(s1, s3); + assert (s3 == s1); +} + + +void RemotingTest::testStruct2(ITester::Ptr pTester) +{ + Struct2 s21; + for (int i = 0; i < 10; i++) + { + Struct1 s1; + s1.aString = "foobar" + Poco::NumberFormatter::format(i); + s1.anInt = i; + s1.aDouble = i + 0.5; + s1.anEnum = VALUE_1; + s1.anEnum2 = Struct1::VALUE_2; + s21.aVector.push_back(s1); + } + + for (int i = 0; i < 9; i++) + { + Struct1::Ptr p1 = new Struct1; + p1->aString = "foobar" + Poco::NumberFormatter::format(i); + p1->anInt = i; + p1->aDouble = i + 0.5; + p1->anEnum = VALUE_1; + p1->anEnum2 = Struct1::VALUE_2; + s21.anotherVector.push_back(p1); + } + + s21.anotherVector.push_back(Struct1::Ptr()); + s21.anURI = "http://www.appinf.com"; + s21.anUUID.parse("01234567-ABCD-EF00-1234-0123456789AB"); + s21.aDateTime.assign(2009, 11, 9, 13, 23, 23, 200); + s21.aLocalDateTime.assign(7200, 2009, 11, 9, 13, 23, 23, 200, 0); + s21.aTimestamp = s21.aDateTime.timestamp(); + + Struct2 s22 = pTester->testStruct21(s21); + assert (s22 == s21); + + pTester->testStruct22(s22); + assert (s22 == s21); + + Struct2 s23; + assert (!(s23 == s21)); + pTester->testStruct23(s21, s23); + assert (s23 == s21); +} + + +void RemotingTest::testStruct3(ITester::Ptr pTester) +{ + Struct3 s31; + Struct2 s21; + for (int i = 0; i < 10; i++) + { + Struct1 s1; + s1.aString = "foobar" + Poco::NumberFormatter::format(i); + s1.anInt = i; + s1.aDouble = i + 0.5; + s1.anEnum = VALUE_1; + s1.anEnum2 = Struct1::VALUE_2; + s21.aVector.push_back(s1); + } + + for (int i = 0; i < 9; i++) + { + Struct1::Ptr p1 = new Struct1; + p1->aString = "foobar" + Poco::NumberFormatter::format(i); + p1->anInt = i; + p1->aDouble = i + 0.5; + p1->anEnum = VALUE_1; + p1->anEnum2 = Struct1::VALUE_2; + s21.anotherVector.push_back(p1); + } + + s21.anotherVector.push_back(Struct1::Ptr()); + s21.anURI = "http://www.appinf.com"; + s21.anUUID.parse("01234567-ABCD-EF00-1234-0123456789AB"); + s21.aDateTime.assign(2009, 11, 9, 13, 23, 23, 200); + s21.aLocalDateTime.assign(7200, 2009, 11, 9, 13, 23, 23, 200, 0); + s21.aTimestamp = s21.aDateTime.timestamp(); + + for (int i = 0; i < 10; i++) + { + for (char c = 'A'; c <= 'Z'; c++) + s31.aCharVector.push_back(c); + } + s31.aComplexVector.push_back(s21); + s31.aComplexVector.push_back(s21); + s31.aSet.insert(1); + s31.aSet.insert(2); + s31.aSet.insert(3); + s31.aMultiSet.insert(1); + s31.aMultiSet.insert(2); + s31.aMultiSet.insert(3); + + Struct3 s32 = pTester->testStruct31(s31); + assert (s32 == s31); + + pTester->testStruct32(s32); + assert (s32 == s31); + + Struct3 s33; + assert (!(s33 == s31)); + pTester->testStruct33(s31, s33); + assert (s33 == s31); +} + + +void RemotingTest::testStruct4(ITester::Ptr pTester) +{ + Struct4 s41; + s41.value = "baz"; + Struct4 s42; + s42.value = "foo"; + Struct4 s43; + s43.value = "bar"; + s41.vec.push_back(s42); + s41.vec.push_back(s43); + + Struct4 s44 = pTester->testStruct41(s41); + assert (s44 == s41); + + pTester->testStruct42(s44); + assert (s44 == s41); + + Struct4 s45; + assert (!(s45 == s41)); + pTester->testStruct43(s41, s45); + assert (s41 == s45); + + s41.ptr = new Struct4; + + s44 = pTester->testStruct41(s41); + assert (s44 == s41); + + pTester->testStruct42(s44); + assert (s44 == s41); + + Struct4 s46; + assert (!(s46 == s41)); + pTester->testStruct43(s41, s46); + assert (s41 == s46); +} + + +void RemotingTest::testStruct5(ITester::Ptr pTester) +{ + Struct5 s51; + s51.tv = 12345678; + + Struct5 s52 = pTester->testStruct51(s51); + assert (s52.tv == s51.tv); + + pTester->testStruct52(s52); + assert (s52.tv == s51.tv); + + Struct5 s53; + pTester->testStruct53(s51, s53); + assert (s51.tv == s53.tv); +} + + +void RemotingTest::testClass1(ITester::Ptr pTester) +{ + Class1 c1; + c1.setAString("foobar"); + c1.setAnInt(42); + c1.setAnEnum(VALUE_2); + + Class1 c2 = pTester->testClass11(c1); + assert (c2 == c1); + + pTester->testClass12(c2); + assert (c2 == c1); + + Class1 c3; + pTester->testClass13(c1, c3); + assert (c3 == c1); +} + + +void RemotingTest::testPtr(ITester::Ptr pTester) +{ + Struct1::Ptr p1 = new Struct1; + p1->aString = "foobar"; + p1->anInt = 2112; + p1->aDouble = 0.5; + p1->anEnum = VALUE_1; + p1->anEnum2 = Struct1::VALUE_2; + + Struct1::Ptr p2 = pTester->testPtr(p1); + assert (*p2 == *p1); +} + + +void RemotingTest::testStruct1Vec(ITester::Ptr pTester) +{ + Struct1Vec vec1; + for (int i = 0; i < 10; i++) + { + Struct1 s1; + s1.aString = "foobar" + Poco::NumberFormatter::format(i); + s1.anInt = i; + s1.aDouble = i + 0.5; + s1.anEnum = VALUE_1; + s1.anEnum2 = Struct1::VALUE_2; + vec1.push_back(s1); + } + + Struct1Vec vec2 = pTester->testStruct1Vec1(vec1); + assert (vec2.size() == vec1.size()); + for (int i = 0; i < vec1.size(); i++) + { + assert (vec2[i] == vec1[i]); + } + + pTester->testStruct1Vec2(vec2); + assert (vec2.size() == vec1.size()); + for (int i = 0; i < vec1.size(); i++) + { + assert (vec2[i] == vec1[i]); + } + + Struct1Vec vec3; + pTester->testStruct1Vec3(vec1, vec3); + assert (vec2.size() == vec1.size()); + for (int i = 0; i < vec1.size(); i++) + { + assert (vec2[i] == vec1[i]); + } +} + + +ITester::Ptr RemotingTest::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("jsonrpc", uri); + static_cast(pProxy->remoting__transport()).enableCompression(false); + return pProxy; +} + + +RemotingTestJSONRPC::RemotingTestJSONRPC(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestJSONRPC::~RemotingTestJSONRPC() +{ +} + + +void RemotingTestJSONRPC::setUp() +{ + RemotingTest::setUp(); + _pListener->enableCompression(false); +} + + +CppUnit::Test* RemotingTestJSONRPC::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestJSONRPC"); + + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testRegistration); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testInt); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testEnum1); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testEnum2); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testNested); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testStruct1); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testStruct2); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testStruct3); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testStruct4); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testStruct5); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testClass1); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testPtr); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testStruct1Vec); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testOneWay); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testFault); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testCookie); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testAuthenticatedGoodCredentials); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testAuthenticatedBadCredentials); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testAuthenticatedNoCredentials); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testPermission); + CppUnit_addTest(pSuite, RemotingTestJSONRPC, testNoPermission); + + return pSuite; +} + + +RemotingTestJSONRPCCompressed::RemotingTestJSONRPCCompressed(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestJSONRPCCompressed::~RemotingTestJSONRPCCompressed() +{ +} + + +void RemotingTestJSONRPCCompressed::setUp() +{ + RemotingTest::setUp(); + _pListener->enableCompression(true); +} + + +ITester::Ptr RemotingTestJSONRPCCompressed::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("jsonrpc", uri); + static_cast(pProxy->remoting__transport()).enableCompression(true); + return pProxy; +} + + +CppUnit::Test* RemotingTestJSONRPCCompressed::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestJSONRPCCompressed"); + + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testRegistration); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testInt); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testEnum1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testEnum2); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testNested); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testStruct1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testStruct2); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testStruct3); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testStruct4); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testStruct5); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testClass1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testPtr); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testStruct1Vec); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testOneWay); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testFault); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testCookie); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testAuthenticatedGoodCredentials); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testAuthenticatedBadCredentials); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testAuthenticatedNoCredentials); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testPermission); + CppUnit_addTest(pSuite, RemotingTestJSONRPCCompressed, testNoPermission); + + return pSuite; +} + + +RemotingTestJSONRPCNonChunked::RemotingTestJSONRPCNonChunked(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestJSONRPCNonChunked::~RemotingTestJSONRPCNonChunked() +{ +} + + +ITester::Ptr RemotingTestJSONRPCNonChunked::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("jsonrpc", uri); + static_cast(pProxy->remoting__transport()).enableChunkedTransferEncoding(false); + return pProxy; +} + + +void RemotingTestJSONRPCNonChunked::setUp() +{ + RemotingTest::setUp(); + _pListener->enableCompression(false); + _pListener->enableChunkedTransferEncoding(false); +} + + +CppUnit::Test* RemotingTestJSONRPCNonChunked::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestJSONRPCNonChunked"); + + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testRegistration); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testInt); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testEnum1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testEnum2); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testNested); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testStruct1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testStruct2); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testStruct3); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testStruct4); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testStruct5); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testClass1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testPtr); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testStruct1Vec); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testOneWay); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testFault); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testCookie); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testAuthenticatedGoodCredentials); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testAuthenticatedBadCredentials); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testAuthenticatedNoCredentials); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testPermission); + CppUnit_addTest(pSuite, RemotingTestJSONRPCNonChunked, testNoPermission); + + return pSuite; +} + + +RemotingTestJSONRPCAuth::RemotingTestJSONRPCAuth(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestJSONRPCAuth::~RemotingTestJSONRPCAuth() +{ +} + + +void RemotingTestJSONRPCAuth::setUp() +{ + _pListener = new Poco::RemotingNG::JSONRPC::Listener("127.0.0.1:2280", Poco::RemotingNG::JSONRPC::Listener::PROTO_HTTP); + _listener = Poco::RemotingNG::ORB::instance().registerListener(_pListener); + Poco::RemotingNG::JSONRPC::TransportFactory::registerFactory(); + _objectURI = TesterServerHelper::registerObject(new Tester, "TheTester", _listener); + + Poco::Net::ServerSocket ss(2280); + _pHTTPServer = new Poco::Net::HTTPServer(new JSONRPCAuthRequestHandlerFactory(*_pListener), ss, new Poco::Net::HTTPServerParams); + _pHTTPServer->start(); +} + + +void RemotingTestJSONRPCAuth::tearDown() +{ + RemotingTest::tearDown(); + _pHTTPServer->stop(); + _pHTTPServer = 0; +} + + +void RemotingTestJSONRPCAuth::testUnauthorized() +{ + ITester::Ptr pTester = createUnauthorizedProxy(_objectURI); + + try + { + testInt(pTester); + fail("Unauthorized - must throw"); + } + catch (Poco::Exception& exc) + { + assert (exc.message() == "HTTP Error: Unauthorized"); + } +} + + +ITester::Ptr RemotingTestJSONRPCAuth::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("jsonrpc", uri); + static_cast(pProxy->remoting__transport()).enableChunkedTransferEncoding(false); + static_cast(pProxy->remoting__transport()).setAuthentication(Poco::RemotingNG::JSONRPC::Transport::AUTH_ANY); + static_cast(pProxy->remoting__transport()).setUsername("user"); + static_cast(pProxy->remoting__transport()).setPassword("s3cr3t"); + return pProxy; +} + + +ITester::Ptr RemotingTestJSONRPCAuth::createUnauthorizedProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("jsonrpc", uri); + static_cast(pProxy->remoting__transport()).enableChunkedTransferEncoding(false); + + return pProxy; +} + + +CppUnit::Test* RemotingTestJSONRPCAuth::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestJSONRPCAuth"); + + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testRegistration); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testInt); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testEnum1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testEnum2); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testNested); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testStruct1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testStruct2); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testStruct3); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testStruct4); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testStruct5); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testClass1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testPtr); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testStruct1Vec); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testFault); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testCookie); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuth, testUnauthorized); + + return pSuite; +} + + +RemotingTestJSONRPCAuthChunked::RemotingTestJSONRPCAuthChunked(const std::string& name): RemotingTestJSONRPCAuth(name) +{ +} + + +RemotingTestJSONRPCAuthChunked::~RemotingTestJSONRPCAuthChunked() +{ +} + + +ITester::Ptr RemotingTestJSONRPCAuthChunked::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("jsonrpc", uri); + static_cast(pProxy->remoting__transport()).enableChunkedTransferEncoding(true); + static_cast(pProxy->remoting__transport()).setAuthentication(Poco::RemotingNG::JSONRPC::Transport::AUTH_BASIC); + static_cast(pProxy->remoting__transport()).setUsername("user"); + static_cast(pProxy->remoting__transport()).setPassword("s3cr3t"); + return pProxy; +} + + +CppUnit::Test* RemotingTestJSONRPCAuthChunked::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestJSONRPCAuthChunked"); + + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testRegistration); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testInt); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testEnum1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testEnum2); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testNested); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testStruct1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testStruct2); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testStruct3); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testStruct4); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testStruct5); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testClass1); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testPtr); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testStruct1Vec); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testFault); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testCookie); + CppUnit_addTest(pSuite, RemotingTestJSONRPCAuthChunked, testUnauthorized); + + return pSuite; +} diff --git a/RemotingNG/JSONRPC/testsuite/src/RemotingTest.h b/RemotingNG/JSONRPC/testsuite/src/RemotingTest.h new file mode 100644 index 0000000000..6f4a0d51bb --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/RemotingTest.h @@ -0,0 +1,157 @@ +// +// RemotingTest.h +// +// Definition of the RemotingTest class. +// +// Copyright (c) 2006-2012, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingTest_INCLUDED +#define RemotingTest_INCLUDED + + +#include "Poco/RemotingNG/RemotingNG.h" +#include "CppUnit/TestCase.h" +#include "ITester.h" +#include "Poco/RemotingNG/JSONRPC/Listener.h" +#include "Poco/Net/HTTPServer.h" +#include "Poco/SharedPtr.h" + + +class RemotingTest: public CppUnit::TestCase +{ +public: + RemotingTest(const std::string& name); + ~RemotingTest(); + + void testRegistration(); + void testInt(); + void testEnum1(); + void testEnum2(); + void testNested(); + void testStruct1(); + void testStruct2(); + void testStruct3(); + void testStruct4(); + void testStruct5(); + void testClass1(); + void testPtr(); + void testStruct1Vec(); + void testOneWay(); + void testFault(); + void testCookie(); + void testAuthenticatedGoodCredentials(); + void testAuthenticatedNoCredentials(); + void testAuthenticatedBadCredentials(); + void testPermission(); + void testNoPermission(); + + void setUp(); + void tearDown(); + +protected: + void testInt(ITester::Ptr pTester); + void testEnum1(ITester::Ptr pTester); + void testEnum2(ITester::Ptr pTester); + void testNested(ITester::Ptr pTester); + void testStruct1(ITester::Ptr pTester); + void testStruct2(ITester::Ptr pTester); + void testStruct3(ITester::Ptr pTester); + void testStruct4(ITester::Ptr pTester); + void testStruct5(ITester::Ptr pTester); + void testClass1(ITester::Ptr pTester); + void testPtr(ITester::Ptr pTester); + void testStruct1Vec(ITester::Ptr pTester); + virtual ITester::Ptr createProxy(const std::string& uri); + +protected: + std::string _listener; + std::string _objectURI; + Poco::RemotingNG::JSONRPC::Listener::Ptr _pListener; +}; + + +class RemotingTestJSONRPC: public RemotingTest +{ +public: + RemotingTestJSONRPC(const std::string& name); + ~RemotingTestJSONRPC(); + + void setUp(); + + static CppUnit::Test* suite(); +}; + + +class RemotingTestJSONRPCCompressed: public RemotingTest +{ +public: + RemotingTestJSONRPCCompressed(const std::string& name); + ~RemotingTestJSONRPCCompressed(); + + void setUp(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); +}; + + +class RemotingTestJSONRPCNonChunked: public RemotingTest +{ +public: + RemotingTestJSONRPCNonChunked(const std::string& name); + ~RemotingTestJSONRPCNonChunked(); + + void setUp(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); +}; + + +class RemotingTestJSONRPCAuth: public RemotingTest +{ +public: + RemotingTestJSONRPCAuth(const std::string& name); + ~RemotingTestJSONRPCAuth(); + + void setUp(); + void tearDown(); + + void testUnauthorized(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); + ITester::Ptr createUnauthorizedProxy(const std::string& uri); + +private: + Poco::SharedPtr _pHTTPServer; +}; + + +class RemotingTestJSONRPCAuthChunked: public RemotingTestJSONRPCAuth +{ +public: + RemotingTestJSONRPCAuthChunked(const std::string& name); + ~RemotingTestJSONRPCAuthChunked(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); +}; + + +#endif // RemotingTest_INCLUDED diff --git a/RemotingNG/JSONRPC/testsuite/src/SerializerTest.cpp b/RemotingNG/JSONRPC/testsuite/src/SerializerTest.cpp new file mode 100644 index 0000000000..d65ce2a5e6 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/SerializerTest.cpp @@ -0,0 +1,380 @@ +// +// SerializerTest.cpp +// +// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "SerializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/JSONRPC/Serializer.h" +#include "Poco/RemotingNG/TypeSerializer.h" +#include + + +using namespace Poco::RemotingNG::JSONRPC; +using namespace std::string_literals; + + +SerializerTest::SerializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +SerializerTest::~SerializerTest() +{ +} + + +void SerializerTest::testEmptyRequest() +{ + std::string expectedResult( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"method\": \"test\",\n" + "\t\"params\":\n" + "\t{\n" + "\t}\n" + "}\n" + ); + + Serializer ser; + std::ostringstream ostr; + ser.setup(ostr); + ser.serializeMessageBegin("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.serializeMessageEnd("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::testOneParamRequest() +{ + std::string expectedResult( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"method\": \"test\",\n" + "\t\"params\":\n" + "\t{\n" + "\t\t\"p1\": 42\n" + "\t}\n" + "}\n" + ); + + Serializer ser; + std::ostringstream ostr; + ser.setup(ostr); + ser.serializeMessageBegin("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.serialize("p1", 42); + ser.serializeMessageEnd("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::testTwoParamRequest() +{ + std::string expectedResult( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"method\": \"test\",\n" + "\t\"params\":\n" + "\t{\n" + "\t\t\"p1\": 42,\n" + "\t\t\"p2\": \"foo\"\n" + "\t}\n" + "}\n" + ); + + Serializer ser; + std::ostringstream ostr; + ser.setup(ostr); + ser.serializeMessageBegin("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.serialize("p1", 42); + ser.serialize("p2", "foo"s); + ser.serializeMessageEnd("test", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::testEmptyReply() +{ + std::string expectedResult( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"result\":\n" + "\t{\n" + "\t}\n" + "}\n" + ); + + Serializer ser; + std::ostringstream ostr; + ser.setup(ostr); + ser.serializeMessageBegin("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + ser.serializeMessageEnd("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::testOneParamReply() +{ + std::string expectedResult( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"result\":\n" + "\t{\n" + "\t\t\"return\": 42\n" + "\t}\n" + "}\n" + ); + + Serializer ser; + std::ostringstream ostr; + ser.setup(ostr); + ser.serializeMessageBegin("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + ser.serialize("return"s, 42); + ser.serializeMessageEnd("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::testTwoParamReply() +{ + std::string expectedResult( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"result\":\n" + "\t{\n" + "\t\t\"return\": 42,\n" + "\t\t\"p1\": \"bar\"\n" + "\t}\n" + "}\n" + ); + + Serializer ser; + std::ostringstream ostr; + ser.setup(ostr); + ser.serializeMessageBegin("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + ser.serialize("return"s, 42); + ser.serialize("p1"s, "bar"s); + ser.serializeMessageEnd("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::testComplexRequest() +{ + std::string expectedResult( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"id\": 0,\n" + "\t\"method\": \"test\",\n" + "\t\"params\":\n" + "\t{\n" + "\t\t\"p1\":\n" + "\t\t[\n" + "\t\t\t1,\n" + "\t\t\t2\n" + "\t\t],\n" + "\t\t\"p2\":\n" + "\t\t{\n" + "\t\t\t\"p21\": 1,\n" + "\t\t\t\"p22\": 2\n" + "\t\t}\n" + "\t}\n" + "}\n" + ); + + Serializer ser; + std::ostringstream ostr; + ser.setup(ostr); + ser.serializeMessageBegin("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.serializeSequenceBegin("p1"s, 2); + ser.serialize("v1"s, 1); + ser.serialize("v2"s, 2); + ser.serializeSequenceEnd("p1"s); + ser.serializeStructBegin("p2"s); + ser.serialize("p21"s, 1); + ser.serialize("p22"s, 2); + ser.serializeStructEnd("p2"s); + ser.serializeMessageEnd("test"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::testError() +{ + std::string expectedResult( + "{\n" + "\t\"jsonrpc\": \"2.0\",\n" + "\t\"error\":\n" + "\t{\n" + "\t\t\"code\": 32000,\n" + "\t\t\"message\": \"Syntax error\"\n" + "\t}\n" + "}\n" + ); + + Serializer ser; + std::ostringstream ostr; + Poco::SyntaxException exc; + ser.setup(ostr); + ser.serializeFaultMessage(""s, exc); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::testObject() +{ + std::string expectedResult( + "{\n" + "\t\"value\": \"foo\"\n" + "}" + ); + + Serializer ser; + std::ostringstream ostr; + ser.setup(ostr); + ser.serializeStructBegin(""); + ser.serialize("value"s, "foo"s); + ser.serializeStructEnd(""); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::testArray() +{ + std::string expectedResult( + "[\n" + "\t\"foo\",\n" + "\t\"bar\"\n" + "]" + ); + + Serializer ser; + std::ostringstream ostr; + ser.setup(ostr); + ser.serializeSequenceBegin("", 0); + ser.serialize("value"s, "foo"s); + ser.serialize("value"s, "bar"s); + ser.serializeSequenceEnd(""s); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::testComplexObject() +{ + std::string expectedResult( + "{\n" + "\t\"object\":\n" + "\t{\n" + "\t\t\"value\": \"foo\"\n" + "\t},\n" + "\t\"array\":\n" + "\t[\n" + "\t\t\"foo\",\n" + "\t\t\"bar\"\n" + "\t]\n" + "}" + ); + + Serializer ser; + std::ostringstream ostr; + ser.setup(ostr); + ser.serializeStructBegin(""); + ser.serializeStructBegin("object"s); + ser.serialize("value"s, "foo"s); + ser.serializeStructEnd("object"); + ser.serializeSequenceBegin("array"s, 0); + ser.serialize("value"s, "foo"s); + ser.serialize("value"s, "bar"s); + ser.serializeSequenceEnd("array"s); + ser.serializeStructEnd(""s); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::testComplexArray() +{ + std::string expectedResult( + "[\n" + "\t[\n" + "\t\t\"foo\",\n" + "\t\t\"bar\"\n" + "\t],\n" + "\t[\n" + "\t\t\"f00\",\n" + "\t\t\"baz\"\n" + "\t]\n" + "]" + ); + + Serializer ser; + std::ostringstream ostr; + ser.setup(ostr); + ser.serializeSequenceBegin(""s, 0); + ser.serializeSequenceBegin("array"s, 0); + ser.serialize("value"s, "foo"s); + ser.serialize("value"s, "bar"s); + ser.serializeSequenceEnd("array"s); + ser.serializeSequenceBegin("array"s, 0); + ser.serialize("value"s, "f00"s); + ser.serialize("value"s, "baz"s); + ser.serializeSequenceEnd("array"s); + ser.serializeSequenceEnd(""s); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void SerializerTest::setUp() +{ +} + + +void SerializerTest::tearDown() +{ +} + + +CppUnit::Test* SerializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SerializerTest"); + + CppUnit_addTest(pSuite, SerializerTest, testEmptyRequest); + CppUnit_addTest(pSuite, SerializerTest, testOneParamRequest); + CppUnit_addTest(pSuite, SerializerTest, testTwoParamRequest); + CppUnit_addTest(pSuite, SerializerTest, testEmptyReply); + CppUnit_addTest(pSuite, SerializerTest, testOneParamReply); + CppUnit_addTest(pSuite, SerializerTest, testTwoParamReply); + CppUnit_addTest(pSuite, SerializerTest, testComplexRequest); + CppUnit_addTest(pSuite, SerializerTest, testError); + CppUnit_addTest(pSuite, SerializerTest, testObject); + CppUnit_addTest(pSuite, SerializerTest, testArray); + CppUnit_addTest(pSuite, SerializerTest, testComplexObject); + CppUnit_addTest(pSuite, SerializerTest, testComplexArray); + + return pSuite; +} diff --git a/RemotingNG/JSONRPC/testsuite/src/SerializerTest.h b/RemotingNG/JSONRPC/testsuite/src/SerializerTest.h new file mode 100644 index 0000000000..63e72cdaf0 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/SerializerTest.h @@ -0,0 +1,51 @@ +// +// SerializerTest.h +// +// Definition of the SerializerTest class. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef SerializerTest_INCLUDED +#define SerializerTest_INCLUDED + + +#include "Poco/RemotingNG/JSONRPC/JSONRPC.h" +#include "CppUnit/TestCase.h" + + +class SerializerTest: public CppUnit::TestCase +{ +public: + SerializerTest(const std::string& name); + ~SerializerTest(); + + void testEmptyRequest(); + void testOneParamRequest(); + void testTwoParamRequest(); + void testEmptyReply(); + void testOneParamReply(); + void testTwoParamReply(); + void testComplexRequest(); + void testError(); + void testObject(); + void testArray(); + void testComplexObject(); + void testComplexArray(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // SerializerTest_INCLUDED diff --git a/RemotingNG/JSONRPC/testsuite/src/Struct1Deserializer.h b/RemotingNG/JSONRPC/testsuite/src/Struct1Deserializer.h new file mode 100644 index 0000000000..0d01503b67 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Struct1Deserializer.h @@ -0,0 +1,66 @@ +// +// Struct1Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Struct1_INCLUDED +#define TypeDeserializer_Struct1_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Struct1& value) + { + using namespace std::string_literals; + + bool ret = deser.deserializeStructBegin(name, isMandatory); + if (ret) + { + deserializeImpl(deser, value); + deser.deserializeStructEnd(name); + } + return ret; + } + + static void deserializeImpl(Deserializer& deser, Struct1& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aString"s,"anInt"s,"aDouble"s,"anEnum"s,"anEnum2"s}; + bool ret = false; + TypeDeserializer::deserialize(REMOTING__NAMES[0], true, deser, value.aString); + TypeDeserializer::deserialize(REMOTING__NAMES[1], true, deser, value.anInt); + TypeDeserializer::deserialize(REMOTING__NAMES[2], true, deser, value.aDouble); + int genanEnum; + ret = TypeDeserializer::deserialize(REMOTING__NAMES[3], true, deser, genanEnum); + if (ret) value.anEnum = static_cast(genanEnum); + int genanEnum2; + ret = TypeDeserializer::deserialize(REMOTING__NAMES[4], true, deser, genanEnum2); + if (ret) value.anEnum2 = static_cast(genanEnum2); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Struct1_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/Struct1Serializer.h b/RemotingNG/JSONRPC/testsuite/src/Struct1Serializer.h new file mode 100644 index 0000000000..45cd1324f6 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Struct1Serializer.h @@ -0,0 +1,57 @@ +// +// Struct1Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Struct1_INCLUDED +#define TypeSerializer_Struct1_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Struct1& value, Serializer& ser) + { + using namespace std::string_literals; + + ser.serializeStructBegin(name); + serializeImpl(value, ser); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Struct1& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aString"s,"anInt"s,"aDouble"s,"anEnum"s,"anEnum2"s,""s}; + TypeSerializer::serialize(REMOTING__NAMES[0], value.aString, ser); + TypeSerializer::serialize(REMOTING__NAMES[1], value.anInt, ser); + TypeSerializer::serialize(REMOTING__NAMES[2], value.aDouble, ser); + TypeSerializer::serialize(REMOTING__NAMES[3], static_cast(value.anEnum), ser); + TypeSerializer::serialize(REMOTING__NAMES[4], static_cast(value.anEnum2), ser); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Struct1_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/Struct2Deserializer.h b/RemotingNG/JSONRPC/testsuite/src/Struct2Deserializer.h new file mode 100644 index 0000000000..66f847564a --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Struct2Deserializer.h @@ -0,0 +1,65 @@ +// +// Struct2Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Struct2_INCLUDED +#define TypeDeserializer_Struct2_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Struct1Deserializer.h" +#include "Struct1Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Struct2& value) + { + using namespace std::string_literals; + + bool ret = deser.deserializeStructBegin(name, isMandatory); + if (ret) + { + deserializeImpl(deser, value); + deser.deserializeStructEnd(name); + } + return ret; + } + + static void deserializeImpl(Deserializer& deser, Struct2& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aVector"s,"anotherVector"s,"anURI"s,"anUUID"s,"aDateTime"s,"aLocalDateTime"s,"aTimestamp"s}; + TypeDeserializer>::deserialize(REMOTING__NAMES[0], true, deser, value.aVector); + TypeDeserializer>>::deserialize(REMOTING__NAMES[1], true, deser, value.anotherVector); + TypeDeserializer::deserialize(REMOTING__NAMES[2], true, deser, value.anURI); + TypeDeserializer::deserialize(REMOTING__NAMES[3], true, deser, value.anUUID); + TypeDeserializer::deserialize(REMOTING__NAMES[4], true, deser, value.aDateTime); + TypeDeserializer::deserialize(REMOTING__NAMES[5], true, deser, value.aLocalDateTime); + TypeDeserializer::deserialize(REMOTING__NAMES[6], true, deser, value.aTimestamp); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Struct2_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/Struct2Serializer.h b/RemotingNG/JSONRPC/testsuite/src/Struct2Serializer.h new file mode 100644 index 0000000000..3f59d81f6e --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Struct2Serializer.h @@ -0,0 +1,61 @@ +// +// Struct2Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Struct2_INCLUDED +#define TypeSerializer_Struct2_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Struct1Deserializer.h" +#include "Struct1Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Struct2& value, Serializer& ser) + { + using namespace std::string_literals; + + ser.serializeStructBegin(name); + serializeImpl(value, ser); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Struct2& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aVector"s,"anotherVector"s,"anURI"s,"anUUID"s,"aDateTime"s,"aLocalDateTime"s,"aTimestamp"s,""s}; + TypeSerializer>::serialize(REMOTING__NAMES[0], value.aVector, ser); + TypeSerializer>>::serialize(REMOTING__NAMES[1], value.anotherVector, ser); + TypeSerializer::serialize(REMOTING__NAMES[2], value.anURI, ser); + TypeSerializer::serialize(REMOTING__NAMES[3], value.anUUID, ser); + TypeSerializer::serialize(REMOTING__NAMES[4], value.aDateTime, ser); + TypeSerializer::serialize(REMOTING__NAMES[5], value.aLocalDateTime, ser); + TypeSerializer::serialize(REMOTING__NAMES[6], value.aTimestamp, ser); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Struct2_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/Struct3Deserializer.h b/RemotingNG/JSONRPC/testsuite/src/Struct3Deserializer.h new file mode 100644 index 0000000000..7dc2c4c15f --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Struct3Deserializer.h @@ -0,0 +1,68 @@ +// +// Struct3Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Struct3_INCLUDED +#define TypeDeserializer_Struct3_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Struct2Deserializer.h" +#include "Struct2Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Struct3& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMESPACE("http://www.appinf.com/types"s); + bool ret = deser.deserializeStructBegin(name, isMandatory); + deser.pushProperty(SerializerBase::PROP_NAMESPACE, REMOTING__NAMESPACE); + if (ret) + { + deserializeImpl(deser, value); + deser.popProperty(SerializerBase::PROP_NAMESPACE); + deser.deserializeStructEnd(name); + } + else deser.popProperty(SerializerBase::PROP_NAMESPACE); + return ret; + } + + static void deserializeImpl(Deserializer& deser, Struct3& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aCharVector"s,"aComplexVector"s,"aList"s,"aSet"s,"aMultiSet"s,"aNullable"s}; + TypeDeserializer>::deserialize(REMOTING__NAMES[0], true, deser, value.aCharVector); + TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, deser, value.aComplexVector); + TypeDeserializer>::deserialize(REMOTING__NAMES[2], true, deser, value.aList); + TypeDeserializer>::deserialize(REMOTING__NAMES[3], true, deser, value.aSet); + TypeDeserializer>::deserialize(REMOTING__NAMES[4], true, deser, value.aMultiSet); + TypeDeserializer>::deserialize(REMOTING__NAMES[5], true, deser, value.aNullable); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Struct3_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/Struct3Serializer.h b/RemotingNG/JSONRPC/testsuite/src/Struct3Serializer.h new file mode 100644 index 0000000000..642dbf6fb2 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Struct3Serializer.h @@ -0,0 +1,64 @@ +// +// Struct3Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Struct3_INCLUDED +#define TypeSerializer_Struct3_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Struct2Deserializer.h" +#include "Struct2Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Struct3& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMESPACE("http://www.appinf.com/types"s); + ser.registerNamespace(REMOTING__NAMESPACE); + ser.serializeStructBegin(name); + ser.pushProperty(SerializerBase::PROP_NAMESPACE, REMOTING__NAMESPACE); + serializeImpl(value, ser); + ser.popProperty(SerializerBase::PROP_NAMESPACE); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Struct3& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"aCharVector"s,"aComplexVector"s,"aList"s,"aSet"s,"aMultiSet"s,"aNullable"s,""s}; + TypeSerializer>::serialize(REMOTING__NAMES[0], value.aCharVector, ser); + TypeSerializer>::serialize(REMOTING__NAMES[1], value.aComplexVector, ser); + TypeSerializer>::serialize(REMOTING__NAMES[2], value.aList, ser); + TypeSerializer>::serialize(REMOTING__NAMES[3], value.aSet, ser); + TypeSerializer>::serialize(REMOTING__NAMES[4], value.aMultiSet, ser); + TypeSerializer>::serialize(REMOTING__NAMES[5], value.aNullable, ser); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Struct3_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/Struct4Deserializer.h b/RemotingNG/JSONRPC/testsuite/src/Struct4Deserializer.h new file mode 100644 index 0000000000..bbb944f024 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Struct4Deserializer.h @@ -0,0 +1,61 @@ +// +// Struct4Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Struct4_INCLUDED +#define TypeDeserializer_Struct4_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Struct4Deserializer.h" +#include "Struct4Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Struct4& value) + { + using namespace std::string_literals; + + bool ret = deser.deserializeStructBegin(name, isMandatory); + if (ret) + { + deserializeImpl(deser, value); + deser.deserializeStructEnd(name); + } + return ret; + } + + static void deserializeImpl(Deserializer& deser, Struct4& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"value"s,"vec"s,"ptr"s}; + TypeDeserializer::deserialize(REMOTING__NAMES[0], true, deser, value.value); + TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, deser, value.vec); + TypeDeserializer>::deserialize(REMOTING__NAMES[2], true, deser, value.ptr); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Struct4_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/Struct4Serializer.h b/RemotingNG/JSONRPC/testsuite/src/Struct4Serializer.h new file mode 100644 index 0000000000..c00248f010 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Struct4Serializer.h @@ -0,0 +1,59 @@ +// +// Struct4Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Struct4_INCLUDED +#define TypeSerializer_Struct4_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Struct4Deserializer.h" +#include "Struct4Serializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Struct4& value, Serializer& ser) + { + using namespace std::string_literals; + + ser.serializeStructBegin(name); + serializeImpl(value, ser); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Struct4& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"value"s,"vec"s,"ptr"s,""s,"http://www.appinf.com/types"s}; + TypeSerializer::serialize(REMOTING__NAMES[0], value.value, ser); + TypeSerializer>::serialize(REMOTING__NAMES[1], value.vec, ser); + ser.pushProperty(SerializerBase::PROP_NAMESPACE, REMOTING__NAMES[4]); + TypeSerializer>::serialize(REMOTING__NAMES[2], value.ptr, ser); + ser.popProperty(SerializerBase::PROP_NAMESPACE); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Struct4_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/Struct5Deserializer.h b/RemotingNG/JSONRPC/testsuite/src/Struct5Deserializer.h new file mode 100644 index 0000000000..51973448cb --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Struct5Deserializer.h @@ -0,0 +1,57 @@ +// +// Struct5Deserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Struct5_INCLUDED +#define TypeDeserializer_Struct5_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Struct5& value) + { + using namespace std::string_literals; + + bool ret = deser.deserializeStructBegin(name, isMandatory); + if (ret) + { + deserializeImpl(deser, value); + deser.deserializeStructEnd(name); + } + return ret; + } + + static void deserializeImpl(Deserializer& deser, Struct5& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"tv"s}; + TypeDeserializer::deserialize(REMOTING__NAMES[0], true, deser, value.tv); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Struct5_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/Struct5Serializer.h b/RemotingNG/JSONRPC/testsuite/src/Struct5Serializer.h new file mode 100644 index 0000000000..6114aa69e1 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Struct5Serializer.h @@ -0,0 +1,53 @@ +// +// Struct5Serializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Struct5_INCLUDED +#define TypeSerializer_Struct5_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Struct5& value, Serializer& ser) + { + using namespace std::string_literals; + + ser.serializeStructBegin(name); + serializeImpl(value, ser); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Struct5& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"tv"s,""s}; + TypeSerializer::serialize(REMOTING__NAMES[0], value.tv, ser); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Struct5_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/Tester.cpp b/RemotingNG/JSONRPC/testsuite/src/Tester.cpp new file mode 100644 index 0000000000..8ad1f71f5e --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Tester.cpp @@ -0,0 +1,269 @@ +// +// Tester.cpp +// +// Copyright (c) 2009-2011, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Tester.h" +#include "Poco/Exception.h" +#include "Poco/RemotingNG/Context.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Net/HTTPServerResponse.h" +#include "Poco/Net/HTTPCookie.h" + + +const int Class1::A_CONSTANT(1); + + +int Tester::testInt1(int i) +{ + return i; +} + + +void Tester::testInt2(int& i) +{ + i = 2112; +} + + +void Tester::testInt3(int i1, int& i2) +{ + i2 = i1; +} + + +Enum1 Tester::testEnum11(Enum1 e1) +{ + return e1; +} + + +void Tester::testEnum12(Enum1& e1) +{ + e1 = VALUE_2; +} + + +void Tester::testEnum13(Enum1 e1, Enum1& e2) +{ + e2 = e1; +} + + +Struct1::Enum2 Tester::testEnum21(Struct1::Enum2 e1) +{ + return e1; +} + + +void Tester::testEnum22(Struct1::Enum2& e1) +{ + e1 = Struct1::VALUE_2; +} + + +void Tester::testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2) +{ + e2 = e1; +} + + +Struct1 Tester::testStruct11(const Struct1& s1) +{ + return s1; +} + + +void Tester::testStruct12(Struct1& s1) +{ +} + + +void Tester::testStruct13(const Struct1& s1, Struct1& s2) +{ + s2 = s1; +} + + +Struct2 Tester::testStruct21(const Struct2& s1) +{ + return s1; +} + + +void Tester::testStruct22(Struct2& s1) +{ +} + + +void Tester::testStruct23(const Struct2& s1, Struct2& s2) +{ + s2 = s1; +} + + +Struct3 Tester::testStruct31(const Struct3& s1) +{ + return s1; +} + + +void Tester::testStruct32(Struct3& s1) +{ +} + + +void Tester::testStruct33(const Struct3& s1, Struct3& s2) +{ + s2 = s1; +} + + +Struct4 Tester::testStruct41(const Struct4& s1) +{ + return s1; +} + + +void Tester::testStruct42(Struct4& s1) +{ +} + + +void Tester::testStruct43(const Struct4& s1, Struct4& s2) +{ + s2 = s1; +} + + +Struct5 Tester::testStruct51(const Struct5& s1) +{ + return s1; +} + + +void Tester::testStruct52(Struct5& s1) +{ +} + + +void Tester::testStruct53(const Struct5& s1, Struct5& s2) +{ + s2 = s1; +} + + +Class1 Tester::testClass11(const Class1& c1) +{ + return c1; +} + + +void Tester::testClass12(Class1& c1) +{ +} + + +void Tester::testClass13(const Class1& c1, Class1& c2) +{ + c2 = c1; +} + + +Struct1::Ptr Tester::testPtr(Struct1::Ptr p1) +{ + return p1; +} + + +Struct1Vec Tester::testStruct1Vec1(const Struct1Vec& vec) +{ + return vec; +} + + +void Tester::testStruct1Vec2(Struct1Vec& vec) +{ +} + + +void Tester::testStruct1Vec3(const Struct1Vec& vec1, Struct1Vec& vec2) +{ + vec2 = vec1; +} + + +void Tester::testOneWay(const std::string& arg) +{ + _oneWayResult = arg; +} + + +std::string Tester::testOneWayResult() +{ + return _oneWayResult; +} + + +Poco::Timestamp::TimeVal Tester::testNestedType(Poco::Timestamp::TimeVal arg) +{ + return arg; +} + + +void Tester::testSynchronized() +{ +} + + +void Tester::testSynchronizedProxy() +{ +} + + +void Tester::testSynchronizedRemote() +{ +} + + +void Tester::testFault() +{ + throw Poco::ApplicationException("Something went wrong"); +} + + +void Tester::setCookie() +{ + Poco::RemotingNG::Context::Ptr pContext = Poco::RemotingNG::Context::get(); + Poco::Net::HTTPServerResponse* pResponse = pContext->getValue("httpResponse"); + Poco::Net::HTTPCookie cookie("testcookie", "testvalue"); + cookie.setMaxAge(5); + pResponse->addCookie(cookie); +} + + +bool Tester::verifyCookie() +{ + Poco::RemotingNG::Context::Ptr pContext = Poco::RemotingNG::Context::get(); + Poco::Net::HTTPServerRequest* pRequest = pContext->getValue("httpRequest"); + Poco::Net::NameValueCollection cookies; + pRequest->getCookies(cookies); + return cookies.get("testcookie", "") == "testvalue"; +} + + +void Tester::testAuthenticated() +{ +} + + +void Tester::testPermission() +{ +} diff --git a/RemotingNG/JSONRPC/testsuite/src/Tester.h b/RemotingNG/JSONRPC/testsuite/src/Tester.h new file mode 100644 index 0000000000..c55b3a212c --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/Tester.h @@ -0,0 +1,292 @@ +// +// Tester.h +// +// Definition of the Tester class. +// +// Copyright (c) 2009-2012, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef Tester_INCLUDED +#define Tester_INCLUDED + + +#include "Poco/Poco.h" +#include "Poco/SharedPtr.h" +#include "Poco/BinaryWriter.h" +#include "Poco/BinaryReader.h" +#include "Poco/BasicEvent.h" +#include "Poco/Nullable.h" +#include "Poco/URI.h" +#include "Poco/UUID.h" +#include "Poco/DateTime.h" +#include "Poco/LocalDateTime.h" +#include "Poco/Timestamp.h" +#include +#include +#include + + +enum Enum1 +{ + VALUE_1, + VALUE_2, + VALUE_3 +}; + + +//@ serialize +struct Struct1 +{ + typedef Poco::SharedPtr Ptr; + + enum Enum2 + { + VALUE_1 = 1, + VALUE_2 = 2, + VALUE_3 = 4 + }; + + std::string aString; + int anInt; + double aDouble; + Enum1 anEnum; + Enum2 anEnum2; +}; + + +typedef Struct1 AnotherStruct1; +typedef std::vector Struct1Vec; + + +//@ serialize +struct Struct2 +{ + Struct1Vec aVector; + std::vector anotherVector; + Poco::URI anURI; + Poco::UUID anUUID; + Poco::DateTime aDateTime; + Poco::LocalDateTime aLocalDateTime; + Poco::Timestamp aTimestamp; +}; + + +//@ serialize +//@ namespace="http://www.appinf.com/types" +struct Struct3 +{ + std::vector aCharVector; + std::vector aComplexVector; + std::list aList; + std::set aSet; + std::multiset aMultiSet; + Poco::Nullable aNullable; +}; + + +//@ serialize +struct Struct4 +{ + std::string value; + std::vector vec; + //@ namespace="http://www.appinf.com/types" + Poco::SharedPtr ptr; +}; + + +//@ serialize +struct Struct5 +{ + Poco::Timestamp::TimeVal tv; +}; + + +//@ serialize +class Class1 +{ +public: + Class1(): + _anEnum(VALUE_1), + _anInt(0) + { + } + + void setAnEnum(Enum1 anEnum) + { + _anEnum = anEnum; + } + + Enum1 getAnEnum() const + { + return _anEnum; + } + + void setAnInt(int anInt) + { + _anInt = anInt; + } + + int getAnInt() const + { + return _anInt; + } + + void setAString(const std::string& str) + { + _aString = str; + } + + const std::string& getAString() const + { + return _aString; + } + + void write(Poco::BinaryWriter& writer) + { + } + + void read(Poco::BinaryReader& reader) + { + } + + bool operator == (const Class1& cl) const + { + return _anEnum == cl._anEnum + && _anInt == cl._anInt; + } + + static const int A_CONSTANT; + +private: + Enum1 _anEnum; + int _anInt; + std::string _aString; +}; + + +//@ namespace="urn:appinf.com:service:Tester:1" +//@ remote +class Tester +{ +public: + //@ name=TestInt1 + //@ replyName=TestInt1Response + //@ $i={name="Value", direction=in} + int testInt1(int i); + + //@ name=TestInt2 + //@ replyName=TestInt2Response + //@ $i={name="Value", direction=inout} + void testInt2(int& i); + + //@ name=TestInt3 + //@ replyName=TestInt3Response + //@ $i1={name="Value1", direction=in} + //@ $i2={name="Value2", direction=out} + void testInt3(int i1, int& i2); + + Enum1 testEnum11(Enum1 e1); + + void testEnum12(Enum1& e1); + + //@ $e2={direction=out} + void testEnum13(Enum1 e1, Enum1& e2); + + Struct1::Enum2 testEnum21(Struct1::Enum2 e1); + + void testEnum22(Struct1::Enum2& e1); + + //@ $e2={direction=out} + void testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2); + + Struct1 testStruct11(const Struct1& s1); + + void testStruct12(Struct1& s1); + + //@ $s2={direction=out} + void testStruct13(const Struct1& s1, Struct1& s2); + + Struct2 testStruct21(const Struct2& s1); + + void testStruct22(Struct2& s1); + + //@ $s2={direction=out} + void testStruct23(const Struct2& s1, Struct2& s2); + + Struct3 testStruct31(const Struct3& s1); + + void testStruct32(Struct3& s1); + + //@ $s2={direction=out} + void testStruct33(const Struct3& s1, Struct3& s2); + + Struct4 testStruct41(const Struct4& s1); + + void testStruct42(Struct4& s1); + + //@ $s2={direction=out} + void testStruct43(const Struct4& s1, Struct4& s2); + + Struct5 testStruct51(const Struct5& s1); + + void testStruct52(Struct5& s1); + + //@ s2={direction=out} + void testStruct53(const Struct5& s1, Struct5& s2); + + Class1 testClass11(const Class1& c1); + + void testClass12(Class1& c1); + + //@ $c2={direction=out} + void testClass13(const Class1& c1, Class1& c2); + + Struct1::Ptr testPtr(Struct1::Ptr p1); + + Struct1Vec testStruct1Vec1(const Struct1Vec& vec); + + void testStruct1Vec2(Struct1Vec& vec); + + //@ $vec2={direction=out} + void testStruct1Vec3(const Struct1Vec& vec1, Struct1Vec& vec2); + + //@ oneway + void testOneWay(const std::string& arg); + + std::string testOneWayResult(); + + Poco::Timestamp::TimeVal testNestedType(Poco::Timestamp::TimeVal arg); + + //@ synchronized + void testSynchronized(); + + //@ synchronized=proxy + void testSynchronizedProxy(); + + //@ synchronized=remote + void testSynchronizedRemote(); + + void testFault(); + + void setCookie(); + + bool verifyCookie(); + + //@ authenticated + void testAuthenticated(); + + //@ permission="perm1" + void testPermission(); + +private: + std::string _oneWayResult; +}; + + +#endif // Tester_INCLUDED diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterClientHelper.cpp b/RemotingNG/JSONRPC/testsuite/src/TesterClientHelper.cpp new file mode 100644 index 0000000000..3a7ddd7169 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterClientHelper.cpp @@ -0,0 +1,55 @@ +// +// TesterClientHelper.cpp +// +// Package: Generated +// Module: TesterClientHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterClientHelper.h" +#include "Poco/SingletonHolder.h" +#include "TesterProxyFactory.h" + + +namespace +{ + Poco::SingletonHolder shTesterClientHelper; +} + + +TesterClientHelper::TesterClientHelper(): + _pORB(0) +{ + _pORB = &Poco::RemotingNG::ORB::instance(); + _pORB->registerProxyFactory("Tester", new TesterProxyFactory); +} + + +TesterClientHelper::~TesterClientHelper() +{ +} + + +ITester::Ptr TesterClientHelper::findImpl(const std::string& uri) +{ + Poco::RemotingNG::Identifiable::Ptr pInterface = _pORB->findObject(uri); + return pInterface.cast(); +} + + +ITester::Ptr TesterClientHelper::findImpl(const std::string& uri, const std::string& protocol) +{ + Poco::RemotingNG::Identifiable::Ptr pInterface = _pORB->findObject(uri, ITester::remoting__typeId(), protocol); + return pInterface.cast(); +} + + +TesterClientHelper& TesterClientHelper::instance() +{ + return *shTesterClientHelper.get(); +} + + diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterClientHelper.h b/RemotingNG/JSONRPC/testsuite/src/TesterClientHelper.h new file mode 100644 index 0000000000..2c1614728c --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterClientHelper.h @@ -0,0 +1,72 @@ +// +// TesterClientHelper.h +// +// Package: Generated +// Module: TesterClientHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterClientHelper_INCLUDED +#define TesterClientHelper_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/ORB.h" + + +class TesterClientHelper +{ +public: + TesterClientHelper(); + /// Creates a TesterClientHelper. + + ~TesterClientHelper(); + /// Destroys the TesterClientHelper. + + static ITester::Ptr find(const std::string& uri); + /// Return an interface for the service object identified by the given URI. + /// + /// Depending on whether the service object has been registered on the same ORB, or not, + /// the ORB will either return a RemoteObject (with forwards calls locally, without the + /// need for serialization/deserialization), or a Proxy. + /// + /// The URI must have the following format: :///// + + static ITester::Ptr find(const std::string& uri, const std::string& protocol); + /// Return a Proxy for the service object identified by the given URI. + /// + /// The given protocol name is used to determine the Transport used by + /// the Proxy. This is used for objects identified by URIs that do not + /// follow the standard Remoting URI structure. + +private: + ITester::Ptr findImpl(const std::string& uri); + + ITester::Ptr findImpl(const std::string& uri, const std::string& protocol); + + static TesterClientHelper& instance(); + + Poco::RemotingNG::ORB* _pORB; +}; + + +inline ITester::Ptr TesterClientHelper::find(const std::string& uri) +{ + return TesterClientHelper::instance().findImpl(uri); +} + + +inline ITester::Ptr TesterClientHelper::find(const std::string& uri, const std::string& protocol) +{ + return TesterClientHelper::instance().findImpl(uri, protocol); +} + + + + +#endif // TesterClientHelper_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterProxy.cpp b/RemotingNG/JSONRPC/testsuite/src/TesterProxy.cpp new file mode 100644 index 0000000000..bfdcb6061c --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterProxy.cpp @@ -0,0 +1,1115 @@ +// +// TesterProxy.cpp +// +// Package: Generated +// Module: TesterProxy +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterProxy.h" +#include "Class1Deserializer.h" +#include "Class1Serializer.h" +#include "Poco/RemotingNG/Deserializer.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Poco/RemotingNG/URIUtility.h" +#include "Struct1Deserializer.h" +#include "Struct1Serializer.h" +#include "Struct2Deserializer.h" +#include "Struct2Serializer.h" +#include "Struct3Deserializer.h" +#include "Struct3Serializer.h" +#include "Struct4Deserializer.h" +#include "Struct4Serializer.h" +#include "Struct5Deserializer.h" +#include "Struct5Serializer.h" + + +TesterProxy::TesterProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid): + ITester(), + Poco::RemotingNG::Proxy(oid), + _testClass11Ret(), + _testEnum11Ret(), + _testEnum21Ret(), + _testInt1Ret(), + _testNestedTypeRet(), + _testOneWayResultRet(), + _testPtrRet(), + _testStruct11Ret(), + _testStruct1Vec1Ret(), + _testStruct21Ret(), + _testStruct31Ret(), + _testStruct41Ret(), + _testStruct51Ret(), + _verifyCookieRet() +{ +} + + +TesterProxy::~TesterProxy() +{ +} + + +void TesterProxy::setCookie() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"setCookie"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("setCookieReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testAuthenticated() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testAuthenticated"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testAuthenticatedReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Class1 TesterProxy::testClass11(const Class1& c1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass11"s,"c1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], c1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass11Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testClass11Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testClass11Ret; +} + + +void TesterProxy::testClass12(Class1& c1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass12"s,"c1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], c1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass12Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, c1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testClass13(const Class1& c1, Class1& c2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass13"s,"c1"s,"c2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], c1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass13Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, c2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Enum1 TesterProxy::testEnum11(Enum1 e1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum11"s,"e1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum11Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__tmpReturn; + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, remoting__tmpReturn); + _testEnum11Ret = static_cast(remoting__tmpReturn); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testEnum11Ret; +} + + +void TesterProxy::testEnum12(Enum1& e1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum12"s,"e1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum12Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testEnum13(Enum1 e1, Enum1& e2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum13"s,"e1"s,"e2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum13Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__e2Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, remoting__e2Tmp); + e2 = static_cast(remoting__e2Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Struct1::Enum2 TesterProxy::testEnum21(Struct1::Enum2 e1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum21"s,"e1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum21Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__tmpReturn; + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, remoting__tmpReturn); + _testEnum21Ret = static_cast(remoting__tmpReturn); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testEnum21Ret; +} + + +void TesterProxy::testEnum22(Struct1::Enum2& e1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum22"s,"e1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum22Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum23"s,"e1"s,"e2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], static_cast(e1), remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum23Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + int remoting__e2Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, remoting__e2Tmp); + e2 = static_cast(remoting__e2Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testFault() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testFault"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testFaultReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +int TesterProxy::testInt1(int i) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt1"s,"Value"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], i, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt1Response"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testInt1Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testInt1Ret; +} + + +void TesterProxy::testInt2(int& i) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt2"s,"Value"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], i, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt2Response"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, i); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testInt3(int i1, int& i2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt3"s,"Value1"s,"Value2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], i1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt3Response"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, i2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Poco::Int64 TesterProxy::testNestedType(Poco::Int64 arg) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testNestedType"s,"arg"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], arg, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testNestedTypeReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testNestedTypeRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testNestedTypeRet; +} + + +void TesterProxy::testOneWay(const std::string& arg) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testOneWay"s,"arg"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginMessage(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], arg, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.sendMessage(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); +} + + +std::string TesterProxy::testOneWayResult() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testOneWayResult"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testOneWayResultReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testOneWayResultRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testOneWayResultRet; +} + + +void TesterProxy::testPermission() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testPermission"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testPermissionReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Poco::SharedPtr TesterProxy::testPtr(Poco::SharedPtr p1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testPtr"s,"p1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[1], p1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testPtrReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer>::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testPtrRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testPtrRet; +} + + +Struct1 TesterProxy::testStruct11(const Struct1& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct11"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct11Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct11Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct11Ret; +} + + +void TesterProxy::testStruct12(Struct1& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct12"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct12Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct13(const Struct1& s1, Struct1& s2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct13"s,"s1"s,"s2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct13Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +std::vector TesterProxy::testStruct1Vec1(const std::vector& vec) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec1"s,"vec"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[1], vec, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec1Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + _testStruct1Vec1Ret.clear(); + Poco::RemotingNG::TypeDeserializer>::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct1Vec1Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct1Vec1Ret; +} + + +void TesterProxy::testStruct1Vec2(std::vector& vec) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec2"s,"vec"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[1], vec, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec2Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, remoting__deser, vec); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct1Vec3(const std::vector& vec1, std::vector& vec2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec3"s,"vec1"s,"vec2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[1], vec1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec3Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[2], true, remoting__deser, vec2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Struct2 TesterProxy::testStruct21(const Struct2& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct21"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct21Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct21Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct21Ret; +} + + +void TesterProxy::testStruct22(Struct2& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct22"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct22Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct23(const Struct2& s1, Struct2& s2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct23"s,"s1"s,"s2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct23Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Struct3 TesterProxy::testStruct31(const Struct3& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct31"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct31Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct31Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct31Ret; +} + + +void TesterProxy::testStruct32(Struct3& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct32"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct32Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct33(const Struct3& s1, Struct3& s2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct33"s,"s1"s,"s2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct33Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Struct4 TesterProxy::testStruct41(const Struct4& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct41"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct41Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct41Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct41Ret; +} + + +void TesterProxy::testStruct42(Struct4& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct42"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct42Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct43(const Struct4& s1, Struct4& s2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct43"s,"s1"s,"s2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct43Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +Struct5 TesterProxy::testStruct51(const Struct5& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct51"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct51Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _testStruct51Ret); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _testStruct51Ret; +} + + +void TesterProxy::testStruct52(Struct5& s1) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct52"s,"s1"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct52Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testStruct53(const Struct5& s1, Struct5& s2) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct53"s,"s1"s,"s2"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct53Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testSynchronized() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronized"s}; + Poco::FastMutex::ScopedLock remoting__lock(remoting__mutex()); + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testSynchronizedProxy() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronizedProxy"s}; + Poco::FastMutex::ScopedLock remoting__lock(remoting__mutex()); + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedProxyReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +void TesterProxy::testSynchronizedRemote() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronizedRemote"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedRemoteReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); +} + + +bool TesterProxy::verifyCookie() +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"verifyCookie"s}; + const std::string& remoting__namespace(DEFAULT_NS); + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("verifyCookieReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _verifyCookieRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + remoting__trans.endRequest(); + return _verifyCookieRet; +} + + +const std::string TesterProxy::DEFAULT_NS("urn:appinf.com:service:Tester:1"); diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterProxy.h b/RemotingNG/JSONRPC/testsuite/src/TesterProxy.h new file mode 100644 index 0000000000..5c981b4131 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterProxy.h @@ -0,0 +1,145 @@ +// +// TesterProxy.h +// +// Package: Generated +// Module: TesterProxy +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterProxy_INCLUDED +#define TesterProxy_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Proxy.h" + + +class TesterProxy: public ITester, public Poco::RemotingNG::Proxy +{ +public: + using Ptr = Poco::AutoPtr; + + TesterProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid); + /// Creates a TesterProxy. + + virtual ~TesterProxy(); + /// Destroys the TesterProxy. + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + + void setCookie(); + + void testAuthenticated(); + + Class1 testClass11(const Class1& c1); + + void testClass12(Class1& c1); + + void testClass13(const Class1& c1, Class1& c2); + + Enum1 testEnum11(Enum1 e1); + + void testEnum12(Enum1& e1); + + void testEnum13(Enum1 e1, Enum1& e2); + + Struct1::Enum2 testEnum21(Struct1::Enum2 e1); + + void testEnum22(Struct1::Enum2& e1); + + void testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2); + + void testFault(); + + int testInt1(int i); + + void testInt2(int& i); + + void testInt3(int i1, int& i2); + + Poco::Int64 testNestedType(Poco::Int64 arg); + + void testOneWay(const std::string& arg); + + std::string testOneWayResult(); + + void testPermission(); + + Poco::SharedPtr testPtr(Poco::SharedPtr p1); + + Struct1 testStruct11(const Struct1& s1); + + void testStruct12(Struct1& s1); + + void testStruct13(const Struct1& s1, Struct1& s2); + + std::vector testStruct1Vec1(const std::vector& vec); + + void testStruct1Vec2(std::vector& vec); + + void testStruct1Vec3(const std::vector& vec1, std::vector& vec2); + + Struct2 testStruct21(const Struct2& s1); + + void testStruct22(Struct2& s1); + + void testStruct23(const Struct2& s1, Struct2& s2); + + Struct3 testStruct31(const Struct3& s1); + + void testStruct32(Struct3& s1); + + void testStruct33(const Struct3& s1, Struct3& s2); + + Struct4 testStruct41(const Struct4& s1); + + void testStruct42(Struct4& s1); + + void testStruct43(const Struct4& s1, Struct4& s2); + + Struct5 testStruct51(const Struct5& s1); + + void testStruct52(Struct5& s1); + + void testStruct53(const Struct5& s1, Struct5& s2); + + void testSynchronized(); + + void testSynchronizedProxy(); + + void testSynchronizedRemote(); + + bool verifyCookie(); + +private: + static const std::string DEFAULT_NS; + mutable Class1 _testClass11Ret; + mutable Enum1 _testEnum11Ret; + mutable Struct1::Enum2 _testEnum21Ret; + mutable int _testInt1Ret; + mutable Poco::Int64 _testNestedTypeRet; + mutable std::string _testOneWayResultRet; + mutable Poco::SharedPtr _testPtrRet; + mutable Struct1 _testStruct11Ret; + mutable std::vector _testStruct1Vec1Ret; + mutable Struct2 _testStruct21Ret; + mutable Struct3 _testStruct31Ret; + mutable Struct4 _testStruct41Ret; + mutable Struct5 _testStruct51Ret; + mutable bool _verifyCookieRet; +}; + + +inline const Poco::RemotingNG::Identifiable::TypeId& TesterProxy::remoting__typeId() const +{ + return ITester::remoting__typeId(); +} + + + + +#endif // TesterProxy_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterProxyFactory.cpp b/RemotingNG/JSONRPC/testsuite/src/TesterProxyFactory.cpp new file mode 100644 index 0000000000..17b514427d --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterProxyFactory.cpp @@ -0,0 +1,32 @@ +// +// TesterProxyFactory.cpp +// +// Package: Generated +// Module: TesterProxyFactory +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterProxyFactory.h" + + +TesterProxyFactory::TesterProxyFactory(): + Poco::RemotingNG::ProxyFactory() + +{ +} + + +TesterProxyFactory::~TesterProxyFactory() +{ +} + + +Poco::RemotingNG::Proxy* TesterProxyFactory::createProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid) const +{ + return new TesterProxy(oid); +} + + diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterProxyFactory.h b/RemotingNG/JSONRPC/testsuite/src/TesterProxyFactory.h new file mode 100644 index 0000000000..0f84b4e4ca --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterProxyFactory.h @@ -0,0 +1,38 @@ +// +// TesterProxyFactory.h +// +// Package: Generated +// Module: TesterProxyFactory +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterProxyFactory_INCLUDED +#define TesterProxyFactory_INCLUDED + + +#include "Poco/RemotingNG/ProxyFactory.h" +#include "TesterProxy.h" + + +class TesterProxyFactory: public Poco::RemotingNG::ProxyFactory +{ +public: + TesterProxyFactory(); + /// Creates a TesterProxyFactory. + + ~TesterProxyFactory(); + /// Destroys the TesterProxyFactory. + + Poco::RemotingNG::Proxy* createProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid) const; + /// Creates and returns a new Proxy object. + +}; + + + + +#endif // TesterProxyFactory_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterRemoteObject.cpp b/RemotingNG/JSONRPC/testsuite/src/TesterRemoteObject.cpp new file mode 100644 index 0000000000..3bf1fb48d8 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterRemoteObject.cpp @@ -0,0 +1,34 @@ +// +// TesterRemoteObject.cpp +// +// Package: Generated +// Module: TesterRemoteObject +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterRemoteObject.h" + + +TesterRemoteObject::TesterRemoteObject(const Poco::RemotingNG::Identifiable::ObjectId& oid, Poco::SharedPtr pServiceObject): + ITester(), + Poco::RemotingNG::RemoteObject(oid), + _pServiceObject(pServiceObject) +{ +} + + +TesterRemoteObject::~TesterRemoteObject() +{ + try + { + } + catch (...) + { + poco_unexpected(); + } +} + + diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterRemoteObject.h b/RemotingNG/JSONRPC/testsuite/src/TesterRemoteObject.h new file mode 100644 index 0000000000..1fc29aea34 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterRemoteObject.h @@ -0,0 +1,387 @@ +// +// TesterRemoteObject.h +// +// Package: Generated +// Module: TesterRemoteObject +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterRemoteObject_INCLUDED +#define TesterRemoteObject_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/RemoteObject.h" +#include "Poco/SharedPtr.h" + + +class TesterRemoteObject: public ITester, public Poco::RemotingNG::RemoteObject +{ +public: + using Ptr = Poco::AutoPtr; + + TesterRemoteObject(const Poco::RemotingNG::Identifiable::ObjectId& oid, Poco::SharedPtr pServiceObject); + /// Creates a TesterRemoteObject. + + virtual ~TesterRemoteObject(); + /// Destroys the TesterRemoteObject. + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + + void setCookie(); + + void testAuthenticated(); + + Class1 testClass11(const Class1& c1); + + void testClass12(Class1& c1); + + void testClass13(const Class1& c1, Class1& c2); + + Enum1 testEnum11(Enum1 e1); + + void testEnum12(Enum1& e1); + + void testEnum13(Enum1 e1, Enum1& e2); + + Struct1::Enum2 testEnum21(Struct1::Enum2 e1); + + void testEnum22(Struct1::Enum2& e1); + + void testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2); + + void testFault(); + + int testInt1(int i); + + void testInt2(int& i); + + void testInt3(int i1, int& i2); + + Poco::Int64 testNestedType(Poco::Int64 arg); + + void testOneWay(const std::string& arg); + + std::string testOneWayResult(); + + void testPermission(); + + Poco::SharedPtr testPtr(Poco::SharedPtr p1); + + Struct1 testStruct11(const Struct1& s1); + + void testStruct12(Struct1& s1); + + void testStruct13(const Struct1& s1, Struct1& s2); + + std::vector testStruct1Vec1(const std::vector& vec); + + void testStruct1Vec2(std::vector& vec); + + void testStruct1Vec3(const std::vector& vec1, std::vector& vec2); + + Struct2 testStruct21(const Struct2& s1); + + void testStruct22(Struct2& s1); + + void testStruct23(const Struct2& s1, Struct2& s2); + + Struct3 testStruct31(const Struct3& s1); + + void testStruct32(Struct3& s1); + + void testStruct33(const Struct3& s1, Struct3& s2); + + Struct4 testStruct41(const Struct4& s1); + + void testStruct42(Struct4& s1); + + void testStruct43(const Struct4& s1, Struct4& s2); + + Struct5 testStruct51(const Struct5& s1); + + void testStruct52(Struct5& s1); + + void testStruct53(const Struct5& s1, Struct5& s2); + + void testSynchronized(); + + void testSynchronizedProxy(); + + void testSynchronizedRemote(); + + bool verifyCookie(); + +private: + Poco::SharedPtr _pServiceObject; +}; + + +inline const Poco::RemotingNG::Identifiable::TypeId& TesterRemoteObject::remoting__typeId() const +{ + return ITester::remoting__typeId(); +} + + +inline void TesterRemoteObject::setCookie() +{ + _pServiceObject->setCookie(); +} + + +inline void TesterRemoteObject::testAuthenticated() +{ + _pServiceObject->testAuthenticated(); +} + + +inline Class1 TesterRemoteObject::testClass11(const Class1& c1) +{ + return _pServiceObject->testClass11(c1); +} + + +inline void TesterRemoteObject::testClass12(Class1& c1) +{ + _pServiceObject->testClass12(c1); +} + + +inline void TesterRemoteObject::testClass13(const Class1& c1, Class1& c2) +{ + _pServiceObject->testClass13(c1, c2); +} + + +inline Enum1 TesterRemoteObject::testEnum11(Enum1 e1) +{ + return _pServiceObject->testEnum11(e1); +} + + +inline void TesterRemoteObject::testEnum12(Enum1& e1) +{ + _pServiceObject->testEnum12(e1); +} + + +inline void TesterRemoteObject::testEnum13(Enum1 e1, Enum1& e2) +{ + _pServiceObject->testEnum13(e1, e2); +} + + +inline Struct1::Enum2 TesterRemoteObject::testEnum21(Struct1::Enum2 e1) +{ + return _pServiceObject->testEnum21(e1); +} + + +inline void TesterRemoteObject::testEnum22(Struct1::Enum2& e1) +{ + _pServiceObject->testEnum22(e1); +} + + +inline void TesterRemoteObject::testEnum23(Struct1::Enum2 e1, Struct1::Enum2& e2) +{ + _pServiceObject->testEnum23(e1, e2); +} + + +inline void TesterRemoteObject::testFault() +{ + _pServiceObject->testFault(); +} + + +inline int TesterRemoteObject::testInt1(int i) +{ + return _pServiceObject->testInt1(i); +} + + +inline void TesterRemoteObject::testInt2(int& i) +{ + _pServiceObject->testInt2(i); +} + + +inline void TesterRemoteObject::testInt3(int i1, int& i2) +{ + _pServiceObject->testInt3(i1, i2); +} + + +inline Poco::Int64 TesterRemoteObject::testNestedType(Poco::Int64 arg) +{ + return _pServiceObject->testNestedType(arg); +} + + +inline void TesterRemoteObject::testOneWay(const std::string& arg) +{ + _pServiceObject->testOneWay(arg); +} + + +inline std::string TesterRemoteObject::testOneWayResult() +{ + return _pServiceObject->testOneWayResult(); +} + + +inline void TesterRemoteObject::testPermission() +{ + _pServiceObject->testPermission(); +} + + +inline Poco::SharedPtr TesterRemoteObject::testPtr(Poco::SharedPtr p1) +{ + return _pServiceObject->testPtr(p1); +} + + +inline Struct1 TesterRemoteObject::testStruct11(const Struct1& s1) +{ + return _pServiceObject->testStruct11(s1); +} + + +inline void TesterRemoteObject::testStruct12(Struct1& s1) +{ + _pServiceObject->testStruct12(s1); +} + + +inline void TesterRemoteObject::testStruct13(const Struct1& s1, Struct1& s2) +{ + _pServiceObject->testStruct13(s1, s2); +} + + +inline std::vector TesterRemoteObject::testStruct1Vec1(const std::vector& vec) +{ + return _pServiceObject->testStruct1Vec1(vec); +} + + +inline void TesterRemoteObject::testStruct1Vec2(std::vector& vec) +{ + _pServiceObject->testStruct1Vec2(vec); +} + + +inline void TesterRemoteObject::testStruct1Vec3(const std::vector& vec1, std::vector& vec2) +{ + _pServiceObject->testStruct1Vec3(vec1, vec2); +} + + +inline Struct2 TesterRemoteObject::testStruct21(const Struct2& s1) +{ + return _pServiceObject->testStruct21(s1); +} + + +inline void TesterRemoteObject::testStruct22(Struct2& s1) +{ + _pServiceObject->testStruct22(s1); +} + + +inline void TesterRemoteObject::testStruct23(const Struct2& s1, Struct2& s2) +{ + _pServiceObject->testStruct23(s1, s2); +} + + +inline Struct3 TesterRemoteObject::testStruct31(const Struct3& s1) +{ + return _pServiceObject->testStruct31(s1); +} + + +inline void TesterRemoteObject::testStruct32(Struct3& s1) +{ + _pServiceObject->testStruct32(s1); +} + + +inline void TesterRemoteObject::testStruct33(const Struct3& s1, Struct3& s2) +{ + _pServiceObject->testStruct33(s1, s2); +} + + +inline Struct4 TesterRemoteObject::testStruct41(const Struct4& s1) +{ + return _pServiceObject->testStruct41(s1); +} + + +inline void TesterRemoteObject::testStruct42(Struct4& s1) +{ + _pServiceObject->testStruct42(s1); +} + + +inline void TesterRemoteObject::testStruct43(const Struct4& s1, Struct4& s2) +{ + _pServiceObject->testStruct43(s1, s2); +} + + +inline Struct5 TesterRemoteObject::testStruct51(const Struct5& s1) +{ + return _pServiceObject->testStruct51(s1); +} + + +inline void TesterRemoteObject::testStruct52(Struct5& s1) +{ + _pServiceObject->testStruct52(s1); +} + + +inline void TesterRemoteObject::testStruct53(const Struct5& s1, Struct5& s2) +{ + _pServiceObject->testStruct53(s1, s2); +} + + +inline void TesterRemoteObject::testSynchronized() +{ + Poco::FastMutex::ScopedLock lock(mutex()); + _pServiceObject->testSynchronized(); +} + + +inline void TesterRemoteObject::testSynchronizedProxy() +{ + _pServiceObject->testSynchronizedProxy(); +} + + +inline void TesterRemoteObject::testSynchronizedRemote() +{ + Poco::FastMutex::ScopedLock lock(mutex()); + _pServiceObject->testSynchronizedRemote(); +} + + +inline bool TesterRemoteObject::verifyCookie() +{ + return _pServiceObject->verifyCookie(); +} + + + + +#endif // TesterRemoteObject_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterServerHelper.cpp b/RemotingNG/JSONRPC/testsuite/src/TesterServerHelper.cpp new file mode 100644 index 0000000000..64692b3112 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterServerHelper.cpp @@ -0,0 +1,79 @@ +// +// TesterServerHelper.cpp +// +// Package: Generated +// Module: TesterServerHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterServerHelper.h" +#include "Poco/RemotingNG/URIUtility.h" +#include "Poco/SingletonHolder.h" +#include "TesterSkeleton.h" + + +namespace +{ + Poco::SingletonHolder shTesterServerHelper; +} + + +TesterServerHelper::TesterServerHelper(): + _pORB(0) +{ + _pORB = &Poco::RemotingNG::ORB::instance(); + registerSkeleton(); +} + + +TesterServerHelper::~TesterServerHelper() +{ +} + + +void TesterServerHelper::shutdown() +{ + TesterServerHelper::instance().unregisterSkeleton(); + shTesterServerHelper.reset(); +} + + +Poco::AutoPtr TesterServerHelper::createRemoteObjectImpl(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid) +{ + return new TesterRemoteObject(oid, pServiceObject); +} + + +TesterServerHelper& TesterServerHelper::instance() +{ + return *shTesterServerHelper.get(); +} + + +std::string TesterServerHelper::registerObjectImpl(Poco::AutoPtr pRemoteObject, const std::string& listenerId) +{ + return _pORB->registerObject(pRemoteObject, listenerId); +} + + +void TesterServerHelper::registerSkeleton() +{ + _pORB->registerSkeleton("Tester", new TesterSkeleton); +} + + +void TesterServerHelper::unregisterObjectImpl(const std::string& uri) +{ + _pORB->unregisterObject(uri); +} + + +void TesterServerHelper::unregisterSkeleton() +{ + _pORB->unregisterSkeleton("Tester", true); +} + + diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterServerHelper.h b/RemotingNG/JSONRPC/testsuite/src/TesterServerHelper.h new file mode 100644 index 0000000000..797468b939 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterServerHelper.h @@ -0,0 +1,105 @@ +// +// TesterServerHelper.h +// +// Package: Generated +// Module: TesterServerHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterServerHelper_INCLUDED +#define TesterServerHelper_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/ORB.h" +#include "Poco/RemotingNG/ServerHelper.h" +#include "Tester.h" +#include "TesterRemoteObject.h" + + +class TesterServerHelper +{ +public: + using Service = Tester; + + TesterServerHelper(); + /// Creates a TesterServerHelper. + + ~TesterServerHelper(); + /// Destroys the TesterServerHelper. + + static Poco::AutoPtr createRemoteObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid); + /// Creates and returns a RemoteObject wrapper for the given Tester instance. + + static std::string registerObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid, const std::string& listenerId); + /// Creates a RemoteObject wrapper for the given Tester instance + /// and registers it with the ORB and the Listener instance + /// uniquely identified by the Listener's ID. + /// + /// Returns the URI created for the object. + + static std::string registerRemoteObject(Poco::AutoPtr pRemoteObject, const std::string& listenerId); + /// Registers the given RemoteObject with the ORB and the Listener instance + /// uniquely identified by the Listener's ID. + /// + /// Returns the URI created for the object. + + static void shutdown(); + /// Removes the Skeleton for Tester from the ORB. + + static void unregisterObject(const std::string& uri); + /// Unregisters a service object identified by URI from the ORB. + +private: + static Poco::AutoPtr createRemoteObjectImpl(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid); + + static TesterServerHelper& instance(); + /// Returns a static instance of the helper class. + + std::string registerObjectImpl(Poco::AutoPtr pRemoteObject, const std::string& listenerId); + + void registerSkeleton(); + + void unregisterObjectImpl(const std::string& uri); + + void unregisterSkeleton(); + + Poco::RemotingNG::ORB* _pORB; +}; + + +inline Poco::AutoPtr TesterServerHelper::createRemoteObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid) +{ + return TesterServerHelper::instance().createRemoteObjectImpl(pServiceObject, oid); +} + + +inline std::string TesterServerHelper::registerObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid, const std::string& listenerId) +{ + return TesterServerHelper::instance().registerObjectImpl(createRemoteObject(pServiceObject, oid), listenerId); +} + + +inline std::string TesterServerHelper::registerRemoteObject(Poco::AutoPtr pRemoteObject, const std::string& listenerId) +{ + return TesterServerHelper::instance().registerObjectImpl(pRemoteObject, listenerId); +} + + +inline void TesterServerHelper::unregisterObject(const std::string& uri) +{ + TesterServerHelper::instance().unregisterObjectImpl(uri); +} + + + + +REMOTING_SPECIALIZE_SERVER_HELPER(, Tester) + + +#endif // TesterServerHelper_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterSkeleton.cpp b/RemotingNG/JSONRPC/testsuite/src/TesterSkeleton.cpp new file mode 100644 index 0000000000..bb74ad798c --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterSkeleton.cpp @@ -0,0 +1,2665 @@ +// +// TesterSkeleton.cpp +// +// Package: Generated +// Module: TesterSkeleton +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterSkeleton.h" +#include "Class1Deserializer.h" +#include "Class1Serializer.h" +#include "Poco/RemotingNG/Deserializer.h" +#include "Poco/RemotingNG/MethodHandler.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/RemotingNG/ServerTransport.h" +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Poco/SharedPtr.h" +#include "Struct1Deserializer.h" +#include "Struct1Serializer.h" +#include "Struct2Deserializer.h" +#include "Struct2Serializer.h" +#include "Struct3Deserializer.h" +#include "Struct3Serializer.h" +#include "Struct4Deserializer.h" +#include "Struct4Serializer.h" +#include "Struct5Deserializer.h" +#include "Struct5Serializer.h" + + +class TesterSetCookieMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"setCookie"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->setCookie(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("setCookieReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::setCookie"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::setCookie"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::setCookie"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestAuthenticatedMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testAuthenticated"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + if (!remoting__trans.authenticate(REMOTING__NAMES[0])) + throw Poco::RemotingNG::AuthenticationFailedException(); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testAuthenticated(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testAuthenticatedReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testAuthenticated"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testAuthenticated"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testAuthenticated"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestClass11MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass11"s,"c1"s}; + bool remoting__requestSucceeded = false; + try + { + Class1 c1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, c1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Class1 remoting__return = remoting__pCastedRO->testClass11(c1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass11Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testClass11"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testClass11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testClass11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestClass12MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass12"s,"c1"s}; + bool remoting__requestSucceeded = false; + try + { + Class1 c1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, c1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testClass12(c1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass12Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], c1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testClass12"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testClass12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testClass12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestClass13MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testClass13"s,"c1"s,"c2"s}; + bool remoting__requestSucceeded = false; + try + { + Class1 c1; + Class1 c2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, c1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testClass13(c1, c2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testClass13Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], c2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testClass13"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testClass13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testClass13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum11MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum11"s,"e1"s}; + bool remoting__requestSucceeded = false; + try + { + Enum1 e1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Enum1 remoting__return = remoting__pCastedRO->testEnum11(e1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum11Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum11"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum12MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum12"s,"e1"s}; + bool remoting__requestSucceeded = false; + try + { + Enum1 e1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testEnum12(e1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum12Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], e1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum12"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum13MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum13"s,"e1"s,"e2"s}; + bool remoting__requestSucceeded = false; + try + { + Enum1 e1; + Enum1 e2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testEnum13(e1, e2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum13Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], e2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum13"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum21MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum21"s,"e1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1::Enum2 e1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct1::Enum2 remoting__return = remoting__pCastedRO->testEnum21(e1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum21Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum21"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum21"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum21"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum22MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum22"s,"e1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1::Enum2 e1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testEnum22(e1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum22Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], e1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum22"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum22"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum22"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestEnum23MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testEnum23"s,"e1"s,"e2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1::Enum2 e1; + Struct1::Enum2 e2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + int remoting__e1Tmp; + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, remoting__e1Tmp); + e1 = static_cast(remoting__e1Tmp); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testEnum23(e1, e2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testEnum23Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], e2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testEnum23"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testEnum23"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testEnum23"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestFaultMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testFault"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testFault(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testFaultReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testFault"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testFault"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testFault"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestInt1MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt1"s,"Value"s}; + bool remoting__requestSucceeded = false; + try + { + int i; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, i); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + int remoting__return = remoting__pCastedRO->testInt1(i); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt1Response"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testInt1"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testInt1"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testInt1"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestInt2MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt2"s,"Value"s}; + bool remoting__requestSucceeded = false; + try + { + int i; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, i); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testInt2(i); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt2Response"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], i, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testInt2"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testInt2"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testInt2"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestInt3MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"TestInt3"s,"Value1"s,"Value2"s}; + bool remoting__requestSucceeded = false; + try + { + int i1; + int i2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, i1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testInt3(i1, i2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("TestInt3Response"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], i2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testInt3"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testInt3"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testInt3"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestNestedTypeMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testNestedType"s,"arg"s}; + bool remoting__requestSucceeded = false; + try + { + Poco::Int64 arg; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, arg); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Poco::Int64 remoting__return = remoting__pCastedRO->testNestedType(arg); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testNestedTypeReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testNestedType"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testNestedType"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testNestedType"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestOneWayMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testOneWay"s,"arg"s}; + std::string arg; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, arg); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + try + { + remoting__pCastedRO->testOneWay(arg); + } + catch (...) + { + } + } + +}; + + +class TesterTestOneWayResultMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testOneWayResult"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + std::string remoting__return = remoting__pCastedRO->testOneWayResult(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testOneWayResultReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testOneWayResult"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testOneWayResult"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testOneWayResult"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestPermissionMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testPermission"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + if (!remoting__trans.authenticate(REMOTING__NAMES[0])) + throw Poco::RemotingNG::AuthenticationFailedException(); + static const std::string REMOTING__PERMISSION("perm1"); + if (!remoting__trans.authorize(REMOTING__NAMES[0], REMOTING__PERMISSION)) + throw Poco::RemotingNG::NoPermissionException(REMOTING__PERMISSION); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testPermission(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testPermissionReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testPermission"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testPermission"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testPermission"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestPtrMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testPtr"s,"p1"s}; + bool remoting__requestSucceeded = false; + try + { + Poco::SharedPtr p1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, remoting__deser, p1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Poco::SharedPtr remoting__return = remoting__pCastedRO->testPtr(p1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testPtrReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer>::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testPtr"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testPtr"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testPtr"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct11MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct11"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct1 remoting__return = remoting__pCastedRO->testStruct11(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct11Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct11"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct11"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct12MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct12"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct12(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct12Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct12"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct12"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct13MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct13"s,"s1"s,"s2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct1 s1; + Struct1 s2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct13(s1, s2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct13Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct13"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct13"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct1Vec1MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec1"s,"vec"s}; + bool remoting__requestSucceeded = false; + try + { + std::vector vec; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, remoting__deser, vec); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + std::vector remoting__return = remoting__pCastedRO->testStruct1Vec1(vec); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec1Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer>::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct1Vec1"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct1Vec1"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct1Vec1"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct1Vec2MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec2"s,"vec"s}; + bool remoting__requestSucceeded = false; + try + { + std::vector vec; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, remoting__deser, vec); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct1Vec2(vec); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec2Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[1], vec, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct1Vec2"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct1Vec2"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct1Vec2"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct1Vec3MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct1Vec3"s,"vec1"s,"vec2"s}; + bool remoting__requestSucceeded = false; + try + { + std::vector vec1; + std::vector vec2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer>::deserialize(REMOTING__NAMES[1], true, remoting__deser, vec1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct1Vec3(vec1, vec2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct1Vec3Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer>::serialize(REMOTING__NAMES[2], vec2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct1Vec3"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct1Vec3"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct1Vec3"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct21MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct21"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct2 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct2 remoting__return = remoting__pCastedRO->testStruct21(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct21Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct21"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct21"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct21"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct22MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct22"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct2 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct22(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct22Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct22"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct22"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct22"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct23MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct23"s,"s1"s,"s2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct2 s1; + Struct2 s2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct23(s1, s2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct23Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct23"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct23"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct23"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct31MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct31"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct3 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct3 remoting__return = remoting__pCastedRO->testStruct31(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct31Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct31"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct31"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct31"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct32MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct32"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct3 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct32(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct32Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct32"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct32"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct32"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct33MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct33"s,"s1"s,"s2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct3 s1; + Struct3 s2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct33(s1, s2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct33Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct33"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct33"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct33"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct41MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct41"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct4 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct4 remoting__return = remoting__pCastedRO->testStruct41(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct41Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct41"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct41"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct41"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct42MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct42"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct4 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct42(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct42Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct42"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct42"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct42"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct43MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct43"s,"s1"s,"s2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct4 s1; + Struct4 s2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct43(s1, s2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct43Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct43"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct43"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct43"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct51MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct51"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct5 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Struct5 remoting__return = remoting__pCastedRO->testStruct51(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct51Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct51"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct51"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct51"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct52MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct52"s,"s1"s}; + bool remoting__requestSucceeded = false; + try + { + Struct5 s1; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct52(s1); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct52Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], s1, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct52"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct52"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct52"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestStruct53MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testStruct53"s,"s1"s,"s2"s}; + bool remoting__requestSucceeded = false; + try + { + Struct5 s1; + Struct5 s2; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, s1); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, s2); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testStruct53(s1, s2); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testStruct53Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], s2, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testStruct53"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testStruct53"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testStruct53"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestSynchronizedMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronized"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testSynchronized(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testSynchronized"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testSynchronized"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testSynchronized"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestSynchronizedProxyMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronizedProxy"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testSynchronizedProxy(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedProxyReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testSynchronizedProxy"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testSynchronizedProxy"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testSynchronizedProxy"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterTestSynchronizedRemoteMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"testSynchronizedRemote"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->testSynchronizedRemote(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("testSynchronizedRemoteReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::testSynchronizedRemote"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::testSynchronizedRemote"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::testSynchronizedRemote"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterVerifyCookieMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"verifyCookie"s}; + bool remoting__requestSucceeded = false; + try + { + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + bool remoting__return = remoting__pCastedRO->verifyCookie(); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, TesterSkeleton::DEFAULT_NS); + static const std::string REMOTING__REPLY_NAME("verifyCookieReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::verifyCookie"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::verifyCookie"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::verifyCookie"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +TesterSkeleton::TesterSkeleton(): + Poco::RemotingNG::Skeleton() + +{ + using namespace std::string_literals; + + addMethodHandler("TestInt1"s, new TesterTestInt1MethodHandler); + addMethodHandler("TestInt2"s, new TesterTestInt2MethodHandler); + addMethodHandler("TestInt3"s, new TesterTestInt3MethodHandler); + addMethodHandler("setCookie"s, new TesterSetCookieMethodHandler); + addMethodHandler("testAuthenticated"s, new TesterTestAuthenticatedMethodHandler); + addMethodHandler("testClass11"s, new TesterTestClass11MethodHandler); + addMethodHandler("testClass12"s, new TesterTestClass12MethodHandler); + addMethodHandler("testClass13"s, new TesterTestClass13MethodHandler); + addMethodHandler("testEnum11"s, new TesterTestEnum11MethodHandler); + addMethodHandler("testEnum12"s, new TesterTestEnum12MethodHandler); + addMethodHandler("testEnum13"s, new TesterTestEnum13MethodHandler); + addMethodHandler("testEnum21"s, new TesterTestEnum21MethodHandler); + addMethodHandler("testEnum22"s, new TesterTestEnum22MethodHandler); + addMethodHandler("testEnum23"s, new TesterTestEnum23MethodHandler); + addMethodHandler("testFault"s, new TesterTestFaultMethodHandler); + addMethodHandler("testNestedType"s, new TesterTestNestedTypeMethodHandler); + addMethodHandler("testOneWay"s, new TesterTestOneWayMethodHandler); + addMethodHandler("testOneWayResult"s, new TesterTestOneWayResultMethodHandler); + addMethodHandler("testPermission"s, new TesterTestPermissionMethodHandler); + addMethodHandler("testPtr"s, new TesterTestPtrMethodHandler); + addMethodHandler("testStruct11"s, new TesterTestStruct11MethodHandler); + addMethodHandler("testStruct12"s, new TesterTestStruct12MethodHandler); + addMethodHandler("testStruct13"s, new TesterTestStruct13MethodHandler); + addMethodHandler("testStruct1Vec1"s, new TesterTestStruct1Vec1MethodHandler); + addMethodHandler("testStruct1Vec2"s, new TesterTestStruct1Vec2MethodHandler); + addMethodHandler("testStruct1Vec3"s, new TesterTestStruct1Vec3MethodHandler); + addMethodHandler("testStruct21"s, new TesterTestStruct21MethodHandler); + addMethodHandler("testStruct22"s, new TesterTestStruct22MethodHandler); + addMethodHandler("testStruct23"s, new TesterTestStruct23MethodHandler); + addMethodHandler("testStruct31"s, new TesterTestStruct31MethodHandler); + addMethodHandler("testStruct32"s, new TesterTestStruct32MethodHandler); + addMethodHandler("testStruct33"s, new TesterTestStruct33MethodHandler); + addMethodHandler("testStruct41"s, new TesterTestStruct41MethodHandler); + addMethodHandler("testStruct42"s, new TesterTestStruct42MethodHandler); + addMethodHandler("testStruct43"s, new TesterTestStruct43MethodHandler); + addMethodHandler("testStruct51"s, new TesterTestStruct51MethodHandler); + addMethodHandler("testStruct52"s, new TesterTestStruct52MethodHandler); + addMethodHandler("testStruct53"s, new TesterTestStruct53MethodHandler); + addMethodHandler("testSynchronized"s, new TesterTestSynchronizedMethodHandler); + addMethodHandler("testSynchronizedProxy"s, new TesterTestSynchronizedProxyMethodHandler); + addMethodHandler("testSynchronizedRemote"s, new TesterTestSynchronizedRemoteMethodHandler); + addMethodHandler("verifyCookie"s, new TesterVerifyCookieMethodHandler); +} + + +TesterSkeleton::~TesterSkeleton() +{ +} + + +const std::string TesterSkeleton::DEFAULT_NS("urn:appinf.com:service:Tester:1"); diff --git a/RemotingNG/JSONRPC/testsuite/src/TesterSkeleton.h b/RemotingNG/JSONRPC/testsuite/src/TesterSkeleton.h new file mode 100644 index 0000000000..5f5f5fecf0 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/TesterSkeleton.h @@ -0,0 +1,44 @@ +// +// TesterSkeleton.h +// +// Package: Generated +// Module: TesterSkeleton +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterSkeleton_INCLUDED +#define TesterSkeleton_INCLUDED + + +#include "Poco/RemotingNG/Skeleton.h" +#include "TesterRemoteObject.h" + + +class TesterSkeleton: public Poco::RemotingNG::Skeleton +{ +public: + TesterSkeleton(); + /// Creates a TesterSkeleton. + + virtual ~TesterSkeleton(); + /// Destroys a TesterSkeleton. + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + + static const std::string DEFAULT_NS; +}; + + +inline const Poco::RemotingNG::Identifiable::TypeId& TesterSkeleton::remoting__typeId() const +{ + return ITester::remoting__typeId(); +} + + + + +#endif // TesterSkeleton_INCLUDED + diff --git a/RemotingNG/JSONRPC/testsuite/src/WinDriver.cpp b/RemotingNG/JSONRPC/testsuite/src/WinDriver.cpp new file mode 100644 index 0000000000..5d9a4cd808 --- /dev/null +++ b/RemotingNG/JSONRPC/testsuite/src/WinDriver.cpp @@ -0,0 +1,30 @@ +// +// WinDriver.cpp +// +// Windows test driver for Poco RemotingNG JSONRPC. +// +// Copyright (c) 2010-2013, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "WinTestRunner/WinTestRunner.h" +#include "JSONRPCTestSuite.h" + + +class TestDriver: public CppUnit::WinTestRunnerApp +{ + void TestMain() + { + CppUnit::WinTestRunner runner; + runner.addTest(JSONRPCTestSuite::suite()); + runner.run(); + } +}; + + +TestDriver theDriver; diff --git a/RemotingNG/Makefile b/RemotingNG/Makefile new file mode 100644 index 0000000000..879bee987f --- /dev/null +++ b/RemotingNG/Makefile @@ -0,0 +1,26 @@ +# +# Makefile +# +# Makefile for Poco Remoting NG +# + +include $(POCO_BASE)/build/rules/global + +SHAREDOPT_CXX += -DRemotingNG_EXPORTS + +objects = SerializerBase Serializer Deserializer \ + BinarySerializer BinaryDeserializer \ + Transport TransportFactory TransportFactoryManager \ + ServerTransport Listener Context \ + Authorizer Authenticator Credentials \ + Proxy ProxyFactory ProxyFactoryManager \ + Identifiable RemoteObject Skeleton MethodHandler \ + EventDispatcher EventListener EventSubscriber \ + ORB \ + AttributedObject RemotingException URIUtility + +target = PocoRemotingNG +target_version = $(LIBVERSION) +target_libs = PocoFoundation $(POCO_LICENSING) + +include $(POCO_BASE)/build/rules/lib diff --git a/RemotingNG/REST/CMakeLists.txt b/RemotingNG/REST/CMakeLists.txt new file mode 100644 index 0000000000..a1955a2ae7 --- /dev/null +++ b/RemotingNG/REST/CMakeLists.txt @@ -0,0 +1,41 @@ +# Sources +file(GLOB SRCS_REST_G "src/*.cpp") +POCO_SOURCES_AUTO(SRCS_REST ${SRCS_REST_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "include/*.h") +POCO_HEADERS_AUTO(SRCS_REST ${HDRS_G}) + +# Version Resource +if(MSVC AND BUILD_SHARED_LIBS) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) + list(APPEND SRCS_REST ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) +endif() + +add_library(RemotingNGREST ${SRCS_REST}) +add_library(Poco::RemotingNGREST ALIAS RemotingNGREST) +set_target_properties(RemotingNGREST + PROPERTIES + VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} + OUTPUT_NAME PocoRemotingNGREST + DEFINE_SYMBOL RemotingNGREST_EXPORTS +) + +target_link_libraries(RemotingNGREST + PUBLIC + Poco::Foundation Poco::Net Poco::RemotingNG Poco::Net +) + +target_include_directories(RemotingNGREST + PUBLIC + $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src +) + +POCO_INSTALL(RemotingNGREST) +POCO_GENERATE_PACKAGE(RemotingNGREST) + +if(ENABLE_TESTS) + add_subdirectory(testsuite) +endif() diff --git a/RemotingNG/REST/Makefile b/RemotingNG/REST/Makefile new file mode 100644 index 0000000000..9fd8598907 --- /dev/null +++ b/RemotingNG/REST/Makefile @@ -0,0 +1,25 @@ +# +# Makefile +# +# Makefile for Poco RemotingNG REST Transport +# + +include $(POCO_BASE)/build/rules/global + +objects = Listener Transport TransportFactory CookieStore \ + RESTRequestHandler RESTRequestHandlerFactory \ + JSValue JSScalar JSObject JSArray JSONParser \ + Serializer Deserializer \ + JSONSerializer JSONDeserializer \ + ScalarSerializer ScalarDeserializer \ + PathSerializer PathDeserializer \ + FormSerializer FormDeserializer \ + HeaderSerializer HeaderDeserializer \ + RawSerializer RawDeserializer \ + RESTServerException + +target = PocoRemotingNGREST +target_version = $(LIBVERSION) +target_libs = PocoRemotingNG PocoNet PocoFoundation $(POCO_LICENSING) + +include $(POCO_BASE)/build/rules/lib diff --git a/RemotingNG/REST/cmake/PocoRemotingNGRESTConfig.cmake b/RemotingNG/REST/cmake/PocoRemotingNGRESTConfig.cmake new file mode 100644 index 0000000000..d1e45bf135 --- /dev/null +++ b/RemotingNG/REST/cmake/PocoRemotingNGRESTConfig.cmake @@ -0,0 +1,5 @@ +include(CMakeFindDependencyMacro) +find_dependency(PocoFoundation) +find_dependency(PocoNet) +find_dependency(PocoRemotingNG) +include("${CMAKE_CURRENT_LIST_DIR}/PocoRemotingNGRESTTargets.cmake") diff --git a/RemotingNG/REST/dependencies b/RemotingNG/REST/dependencies new file mode 100644 index 0000000000..1a0d5344ca --- /dev/null +++ b/RemotingNG/REST/dependencies @@ -0,0 +1,3 @@ +RemotingNG +Net +Foundation diff --git a/RemotingNG/REST/doc/00240-RemotingNGRESTTransportUserGuide.page b/RemotingNG/REST/doc/00240-RemotingNGRESTTransportUserGuide.page new file mode 100644 index 0000000000..266ee28662 --- /dev/null +++ b/RemotingNG/REST/doc/00240-RemotingNGRESTTransportUserGuide.page @@ -0,0 +1,571 @@ +Remoting NG REST Transport User Guide +Remoting NG + +!!!Introduction + +The REST Transport is a HTTP-based Transport implementation, +enabling RESTful web services. + +The REST transport supports the following features: + + - HTTP compression (GZIP content transfer encoding) for requests and responses. + - HTTP authentication (basic or digest; digest is supported on client only) + - CORS ([[http://www.w3.org/TR/cors/ Cross-Origin Resource Sharing]]) + - HTTPS + - Passing parameters in request/response body (JSON and raw), query, form, resource path and + HTTP request/response headers. + + +!!!Defining RESTful Interfaces + +Defining RESTful interfaces with C++ classes is different from defining interfaces +for other transports such as SOAP, JSON-RPC or TCP. The main difference is that +method names are directly mapped to HTTP request method names (GET, POST, PATCH, PUT, +DELETE). Therefore, only the following method names may be used: + + - `get` + - `post` + - `patch` + - `put` + - `delete_` (note the trailing underscore) + +When defining RESTful interfaces, it's best to think in terms of <*collections*> and +<*resources*>, and to define <*endpoints*> for both. Typically, a collection will be +used to create new resources, and to obtain a list of existing resources of a given +type or class. For that purpose, <[post()]> and <[get()]> methods are used. +Resource endpoints are used to obtain details of a specific resource or object, make changes +to the resource, or delete it, using <[get()]>, <[patch()]> (or <[put()]>) and <[delete_()]> +methods. + + +!!Parameters + +Parameters can be passed in: + + - request/response body, using JSON or raw format + - query strings + - form data in request body + - request path + - HTTP request/response headers + +Non-scalar values (<[struct]> and objects, <[std::vector]> and other collection types) +can only be passed in request or response body, using JSON format. +There may at most be one parameter in the request and response body. +Scalar values can be passed in any part of the request or response. The location +and format of parameters is specified using REST-specific Remoting NG attributes. +Multiple parameters can be passed in query strings, form data, request path or +request/response headers. + + +!!REST-specific Remoting NG Attributes + +!consumes +Specifies the MIME content type (<[Content-Type]> HTTP header) of the request body. + * level: method + * type: string + * default: "application/json" or "application/x-www-form-urlencoded" + +!exclusiveMax +If `exclusiveMax` is `true`, the parameter or variable value must be strictly less than the value, +specified with `max`. Otherwise the value must be less than or equal to this value. +The attribute will be reflected in a generated OpenAPI document as `exclusiveMaximum` validation keyword. + * level: parameter/variable + * type: boolean + +!exclusiveMin +If `exclusiveMin` is `true`, the parameter or variable value must be strictly greater than the value, +specified with `min`. Otherwise the value must be greater than or equal to this value. +The attribute will be reflected in a generated OpenAPI document as `exclusiveMinimum` validation keyword. + * level: parameter/variable + * type: boolean + +!format +Describes the format of a parameter passed in the request or response body. + * level: parameter + * type: string + * default: "json" + +Valid values are: + * raw: The parameter is passed as a string or raw binary data. Can only be used + for simple types, e.g. std::string and std::vector. + This is useful for passing raw binary data as a std::string or std::vector in + the request or response body. If specified, an appropriate content type should + also be specified using the <[consumes]> or <[produces]> attribute. + * binary: same as "raw". + * json: The parameter is formatted as JSON. Can be used for simple and complex types. + +Example: + //@ $file={in=path} + //@ return={in=body, format=raw} + //@ produces="text/plain" + std::string get(const std::string& file); +---- + +!in +Defines the location of a parameter. + * level: parameter + * type: string + * default: "body" + +Valid values are: + * path: The parameter is passed as part of the URI path. A <[path]> attribute + must also be specified for the method or object, containing a corresponding + place holder for the parameter (<[{name}]>). + * query: The parameter is a passed as URI query parameter. + * form: The parameter is passed in the request body, using form encoding + (content type "application/x-www-form-urlencoded"). + * header: The parameters is passed as HTTP request or response header. + * body: The parameter is passed in the request or response body (raw string or JSON-formatted). + +Example: + //@ $file={in=path} + //@ return={in=body, format=raw} + //@ produces="text/plain" + std::string get(const std::string& file); +---- + +!max +Specifies the maximum allowed value for a numeric parameter or variable. +If `exclusiveMax` is `true`, the value must be strictly less than this value, +otherwise the value must be less than or equal to this value. +This attribute is only used for documentation purposes, no validation will +be performed by the generated code. The attribute will be reflected in a generated +OpenAPI document as `maximum` validation keyword. + * level: parameter/variable + * type: number + +Example: + //@ path="/api/1.0/orders/{orderNo}/items/{itemNo}" + //@ $orderNo={in=path, min=1} + //@ $itemNo={in=path, min=1, max=999} + Item get(int orderNo, int itemNo); +---- + +!maxItems +Specifies the maximum number of elements in a vector or set. +This attribute is only used for documentation purposes, no validation will +be performed by the generated code. The attribute will be reflected in a generated +OpenAPI document as `maxItems` validation keyword. + * level: parameter/variable + * type: integer + +!maxLength +Specifies the maximum allowed length for a string variable or parameter. +This attribute is only used for documentation purposes, no validation will +be performed by the generated code. The attribute will be reflected in a generated +OpenAPI document as `maxLength` validation keyword. + * level: parameter/variable + * type: integer + +!min +Specifies the minimum allowed value for a numeric parameter or variable. +If `exclusiveMin` is `true`, the value must be strictly greater than this value, +otherwise the value must be greater than or equal to this value. +This attribute is only used for documentation purposes, no validation will +be performed by the generated code. The attribute will be reflected in a generated +OpenAPI document as `minimum` validation keyword. + * level: parameter/variable + * type: number + +!minItems +Specifies the minimum number of elements in a vector or set. +This attribute is only used for documentation purposes, no validation will +be performed by the generated code. The attribute will be reflected in a generated +OpenAPI document as `minItems` validation keyword. + * level: parameter/variable + * type: integer + +!minLength +Specifies the minimum allowed length for a string variable or parameter. +This attribute is only used for documentation purposes, no validation will +be performed by the generated code. The attribute will be reflected in a generated +OpenAPI document as `minLength` validation keyword. + * level: parameter/variable + * type: integer + +!multipleOf +If specified, the variable or parameter value must be a multiple of the +specified value. +This attribute is only used for documentation purposes, no validation will +be performed by the generated code. The attribute will be reflected in a generated +OpenAPI document as `multipleOf` validation keyword. + * level: parameter/variable + * type: number + +!path +Specifies the path template used for extracting parameters +passed within the request URI. + * level: class/method + * type: string + +The location of parameters within the path is indicated by putting the parameter +name in curly brackets. + +Example: + //@ path="/api/1.0/orders/{orderNo}/items/{itemNo}" + //@ $orderNo={in=path} + //@ $itemNo={in=path} + Item get(int orderNo, int itemNo); +---- + +!pattern +Specifies a regular expression to validate a string parameter or variable. +This attribute is only used for documentation purposes, no validation will +be performed by the generated code. The attribute will be reflected in a generated +OpenAPI document as `pattern` validation keyword. + * level: parameter/variable + * type: string (regular expression) + +!produces +Specifies the MIME content type of the response body. + * level: method + * type: string + * default: "application/json" + + +!!Resource Paths + +The default Remoting NG resource path (/rest/<*class*>/<*object*>) is not really well +suited for RESTful web service endpoints. Therefore, every endpoint class should +specify a proper path with the <[path]> attribute. The path can contain parameter +placeholders in the form of a parameter name enclosed in curly brackets. +Resource paths specified on an endpoint object using the <[path]> attribute will +automatically be registered as alias paths with the ORB when the respective +RemoteObject is registered. + + +!!Error Responses + +REST methods can report errors and failures by throwing an exception. +An exception in a REST method will cause the HTTP response to have a +4xx or 5xx status code. Furthermore, the response content will be the +following JSON document: + + { + "error": "", + "detail": "", + "code": + } +---- + +A REST method can also set the HTTP status code explicitly, by throwing a +Poco::Net::HTTPException and specifying the HTTP status code in the +constructor of the Poco::Net::HTTPException. Example: + + throw Poco::Net::HTTPException("You are not authorized to access this resource", 403); +---- + +The following exceptions will cause the HTTP response status code to be set to a +special value. All other exceptions will result in a generic 500 "Internal Server Error". + + Exception HTTP Status + ------------------------------------------------------------------------ + Poco::Net::HTTPException (given exception code) + Poco::RemotingNG::MethodNotFoundException 405 Method Not Allowed + Poco::RemotingNG::AuthenticationFailedException 401 Unauthorized + Poco::RemotingNG::NoPermissionException 403 Forbidden + Poco::NoPermissionException 403 Forbidden + Poco::NotFoundException 404 Not Found + Poco::ExistsException 409 Conflict + Poco::InvalidArgumentException 400 Bad Request + Poco::NotImplementedException 501 Not Implemented +---- + +On the client side, errors resulting from a HTTP response with a status code >= 400 +are reported via Poco::RemotingNG::REST::RESTServerException, which is a subclass +of Poco::RemotingNG::RemoteException. If the error response contains JSON content, +the content is available via the `content()` member function as a Poco::RemotingNG::REST::JSValue. + +Furthermore, the value of root-level JSON properties named `error` and `detail`, if present, is +available via the convenience methods `error()` and `detail()` and the HTTP response +status code and reason is available via `status()` and `reason()`. + +!!!Basic REST Transport Usage + +!!Server Usage + +To use the REST Transport in a server, the following three steps must +be performed: + + 1. Register the Poco::RemotingNG::REST::TransportFactory with the ORB, + 2. Optionally configure the listener (e.g., to enable CORS), + 3. Register the Listener with the ORB, and finally, + 4. Register the individual objects with the ORB. + +Following is an example code fragment for setting up a REST Listener, +configuring it to enable CORS (from any origin), +and registering a service object for use with the listener. + + Poco::RemotingNG::REST::Listener::Ptr pListener = new Poco::RemotingNG::REST::Listener("localhost:8080"); + pListener->enableCORS(true); + std::string listener = Poco::RemotingNG::ORB::instance().registerListener(pListener); + + st::string uri = Sample::TimeEndpointServerHelper::registerObject( + new Sample::TimeEndpoint, + "TheTime", + listener + ); +---- + +Please see the Poco::RemotingNG::REST::Listener class documentation for detailed information +about how to setup and configure the listener. + + +!!Client Usage + +To use the REST Transport in a client, the following two steps +must be performed: + + 1. Register the Poco::RemotingNG::REST::TransportFactory with the ORB, and + 2. Retrieve the interface (proxy) object using the helper class. + +Following is an example code fragment for setting up a REST Transport, +and obtaining a Proxy object for invoking methods on the service object. + + Poco::RemotingNG::REST::TransportFactory::registerFactory(); + Sample::ITimeEndpoint::Ptr pTimeEndpoint = MyProject::MyClassHelper::find( + "http://localhost:8080/rest/TimeEndpoint/TheTime"); + ); +---- + + +!Configuring The Client Transport + +To configure the client transport (e.g., to , +enable HTTP compression, or HTTP authentication), the Transport object must +be obtained from the proxy. This is done in two steps. First, the interface +pointer obtained from the client helper must be casted to a proxy: + + Poco::RemotingNG::Proxy::Ptr pProxy = pTimeEndpoint.cast(); +---- + +Second, the Transport object can be obtained from the proxy: + + Poco::RemotingNG::REST::Transport& trans = static_cast(pProxy->remoting__transport()); +---- + +These two casts can also be put into a utility function <[transportFromInterface()]>: + + template + Poco::RemotingNG::REST::Transport& transportFromInterface(Poco::AutoPtr pInterface) + { + Poco::RemotingNG::Proxy::Ptr pProxy = pInterface.template cast(); + if (pProxy) + { + return static_cast(pProxy->remoting__transport()); + } + else throw Poco::BadCastException(); + } +---- + +Using the <[transportFromInterface()]> function, we can write: + + Poco::RemotingNG::REST::Transport& trans = transportFromInterface(pTimeEndpoint); +---- + + +Now that we have access to the Transport object, we can configure it: + + trans.enableCompression(true); +---- + +Configuration should be done before the first method is invoked over the proxy. + +Please see the Poco::RemotingNG::REST::Transport class documentation for other +configuration options, including timeouts and user-agent string. + + +!HTTP and OAuth 2 Authentication + +The REST Transport supports HTTP Basic and Digest authentication, as well as +OAuth 2.0 authentication using a bearer token. To enable authentication +for a proxy object, first obtain the Transport object as shown in the previous section. + +HTTP Basic Authentication can then be enabled with: + + trans.setAuthentication(Poco::RemotingNG::REST::Transport::AUTH_BASIC); + Poco::RemotingNG::Credentials creds; + creds.setAttribute("username", "user"); + creds.setAttribute("password", "s3cr3t"); + trans.setCredentials(creds); +---- + +To enable HTTP Digest Authentication: + + trans.setAuthentication(Poco::RemotingNG::REST::Transport::AUTH_DIGEST); + Poco::RemotingNG::Credentials creds; + creds.setAttribute("username", "user"); + creds.setAttribute("password", "s3cr3t"); + trans.setCredentials(creds); + trans.enableChunkedTransferEncoding(false); +---- + +Please note that chunked transfer encoding must be disabled in order to use HTTP Digest +Authentication. + +It is also possible to enable both Basic and Digest authentication and use whatever +the server requests: + + trans.setAuthentication(Poco::RemotingNG::REST::Transport::AUTH_ANY); + Poco::RemotingNG::Credentials creds; + creds.setAttribute("username", "user"); + creds.setAttribute("password", "s3cr3t"); + trans.setCredentials(creds); + trans.enableChunkedTransferEncoding(false); +---- + +To enable OAuth 2 authentication using a bearer token: + + trans.setAuthentication(Poco::RemotingNG::REST::Transport::AUTH_BEARER); + Poco::RemotingNG::Credentials creds; + creds.setAttribute("token", "bearertoken"); + trans.setCredentials(creds); +---- + +Note: Obtaining the bearer token is outside the scope of the Remoting REST framework. +This will usually be done by implementing the OAuth 2.0 authorization flow in a web +application. + + +!Cookies + +The REST Transport supports HTTP cookies. Any cookies sent by the server through +a HTTP response will be sent back to the server with subsequent HTTP requests. +The lifetime (maximum age) of cookies, if set, will be honored, and expired cookies +will not be sent back to the server. + +Cookies are mostly useful for session-based authentication. The cookies stored +in a Transport object can be obtained and shared with a different Transport +object. This is useful if a REST server uses session cookies for authentication +and the same session needs to be used by multiple proxy instances. + +Cookies are stored in a Poco::RemotingNG::REST::CookieStore object. A pointer +(Poco::RemotingNG::REST::CookieStore::Ptr) to this object can be obtained +by calling Poco::RemotingNG::REST::Transport::getCookieStore(). The cookie +store can then be shared with a different Transport by calling +Poco::RemotingNG::REST::Transport::setCookieStore(). + + +!!Text Encoding Considerations + +All strings used in remote interfaces must be properly UTF-8 encoded +when using the REST transport. Encoding errors may lead to failures +when parsing REST request or response messages. + + +!!!Using The REST Transport With HTTPS + +The REST transport normally uses a plain, unencrypted HTTP +connection between the client and the server. To make the REST Transport use a secure +HTTPS connection, the following steps must be performed. + + +!!HTTPS On The Server Side + +On the server side, the listener must be created using a +Poco::Net::SecureServerSocket. + + Poco::Net::SecureServerSocket serverSocket(8443); + std::string listener = Poco::RemotingNG::ORB::instance().registerListener( + new Poco::RemotingNG::REST::Listener("localhost:8443", serverSocket) + ); + std::string uri = MyProject::MyClassHelper::registerObject( + new MyProject::MyClass, + "MyObject", + listener + ); +---- + + +!!HTTPS On The Client Side + +On the client side, the REST transport uses a private +Poco::Net::HTTPSessionFactory object to create +the Poco::Net::HTTPClientSession for talking to the server. +So, all that needs to be done to enable HTTPS on the +client is to register the Poco::Net::HTTPSSessionInstantiator +with the session factory. Then, a https URI can be used to +access the web service. + + Poco::RemotingNG::REST::Transport::httpSessionFactory().registerProtocol( + "https", + new Poco::Net::HTTPSSessionInstantiator + ); + + Poco::RemotingNG::REST::TransportFactory::registerFactory(); + + MyProject::IMyClass::Ptr pObj = MyProject::MyClassHelper::find( + "https://localhost:8443/rest/MyClass/TheObject" + ); +---- + + +!!!Generating OpenAPI (Swagger) Documents + +The <*RemoteGenNG*> tool supports the creation of [[https://www.openapis.org OpenAPI]] +specifications (also known as Swagger documents). +The OpenAPI specification is a broadly adopted industry standard +for describing RESTful APIs. Version 3.0 of the specification is supported. + +An OpenAPI specification document can be used to generate documentation +for an API, or to generate client and server code for implementing the API with +different programming languages and libraries. + +In order to enable generation of an OpenAPI document, a few elements must be +added to the <*RemoteGenNG*> configuration file. Most OpenAPI-related +elements are optional, but three elements must be provided: + + - <*output/openAPI/path*>: This setting specifies the path and file name of the OpenAPI + specification file. This setting will also enable generation of the OpenAPI + specification file. + - <*output/openAPI/info/title*>: This setting specifies the title of the API, + which is a required part of an OpenAPI document. + - <*output/openAPI/server/url*>: This setting specifies the URL of the + server providing the API. + +Please refer to the [[00200-RemotingNGUserGuide.html Remoting NG User Guide]] for a +list of all supported configuration elements. + +Here is an example <*openAPI*> fragment: + + + openapi/api.json + + Sample REST API + An example for a RESTful API. + 1.0.0 + + Applied Informatics Software Engineering GmbH + https://pocoproject.org/pro/ + + + + http://localhost:8080/ + + +---- + +OpenAPI documents can only be generated for services that follow the RESTful +style required by the RemotingNG REST Transport. + +Limited support for JSON schema validation keywords in the generated OpenAPI is +provided via RemotingNG attributes. Following table shows the supported attributes, +and the corresponding validation keyword: + + Attribute Validation Keyword Type + -------------------------------------------------------------- + max maximum number + min minimum number + exclusiveMax exclusiveMaximum boolean + exclusiveMin exclusiveMinimum boolean + multipleOf multipleOf number + maxItems maxItems integer + minItems minItems integer + maxLength maxLength integer + minLength minLength integer + pattern pattern regular expression +---- + +Note that no actual validation is performed by the generated code. +The attributes are only provided for documentation purposes, and +for generating the OpenAPI document. diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/CookieStore.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/CookieStore.h new file mode 100644 index 0000000000..3745f331f7 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/CookieStore.h @@ -0,0 +1,84 @@ +// +// CookieStore.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: CookieStore +// +// Definition of the CookieStore class. +// +// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_CookieStore_INCLUDED +#define RemotingNG_REST_CookieStore_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/Net/HTTPRequest.h" +#include "Poco/Net/HTTPResponse.h" +#include "Poco/Net/HTTPCookie.h" +#include "Poco/RefCountedObject.h" +#include "Poco/Timestamp.h" +#include "Poco/AutoPtr.h" +#include "Poco/Mutex.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API CookieStore: public Poco::RefCountedObject + /// A CookieStore object stores cookies set by a REST server. + /// + /// Normally, each Transport (and thus Proxy) instance has its own cookie + /// store instance. However, CookieStore objects can also be shared + /// among multiple Transport instances connected to the same server. + /// + /// A typical use case for this is sharing session cookies among all + /// Transport/Proxy instances connected to the same server. + /// + /// Note: The application must take care that CookieStore objects are + /// only shared among Transport instances connected to the same server. +{ +public: + using Ptr = Poco::AutoPtr; + + CookieStore(); + /// Creates an empty CookieStore. + + ~CookieStore(); + /// Destroys the CookieStore. + + void addCookies(Poco::Net::HTTPRequest& request); + /// Adds the stored cookies to the given request object. + + void updateCookies(const Poco::Net::HTTPResponse& response); + /// Updates the stored cookies with the cookies from + /// the given response object. + +private: + struct CookieInfo + { + Poco::Net::HTTPCookie cookie; + Poco::Timestamp expireTime; + }; + typedef std::map CookieMap; + + CookieMap _cookies; + Poco::FastMutex _mutex; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_CookieStore_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/Deserializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/Deserializer.h new file mode 100644 index 0000000000..f638458189 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/Deserializer.h @@ -0,0 +1,129 @@ +// +// Deserializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: Deserializer +// +// Definition of the Deserializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_Deserializer_INCLUDED +#define RemotingNG_REST_Deserializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/JSONDeserializer.h" +#include "Poco/RemotingNG/REST/FormDeserializer.h" +#include "Poco/RemotingNG/REST/HeaderDeserializer.h" +#include "Poco/RemotingNG/REST/PathDeserializer.h" +#include "Poco/RemotingNG/REST/RawDeserializer.h" +#include "Poco/RemotingNG/REST/Serializer.h" +#include "Poco/RemotingNG/Deserializer.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API Deserializer: public Poco::RemotingNG::Deserializer + /// The Deserializer implementation for the REST Transport. + /// + /// For more information, please see the Serializer documentation. +{ +public: + Deserializer(); + /// Creates the Deserializer. + + ~Deserializer(); + /// Destroys the Deserializer. + + void setRequest(Poco::Net::HTTPRequest& request); + /// Sets the HTTP request object. + + void setResponse(Poco::Net::HTTPResponse& response); + /// Sets the HTTP response object. + + // Poco::RemotingNG::Deserializer + Poco::RemotingNG::SerializerBase::MessageType findMessage(std::string& name); + void deserializeMessageBegin(const std::string& name, SerializerBase::MessageType type); + void deserializeMessageEnd(const std::string& name, SerializerBase::MessageType type); + bool deserializeStructBegin(const std::string& name, bool isMandatory); + void deserializeStructEnd(const std::string& name); + bool deserializeSequenceBegin(const std::string& name, bool isMandatory, Poco::UInt32& lengthHint); + void deserializeSequenceEnd(const std::string& name); + bool deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull); + void deserializeNullableEnd(const std::string& name); + bool deserializeOptionalBegin(const std::string& name, bool isMandatory, bool& isSpecified); + void deserializeOptionalEnd(const std::string& name); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int8& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt8& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int16& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt16& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int32& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt32& val); + bool deserialize(const std::string& name, bool isMandatory, long& val); + bool deserialize(const std::string& name, bool isMandatory, unsigned long& val); +#ifndef POCO_INT64_IS_LONG + bool deserialize(const std::string& name, bool isMandatory, Poco::Int64& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt64& val); +#endif + bool deserialize(const std::string& name, bool isMandatory, float& val); + bool deserialize(const std::string& name, bool isMandatory, double& val); + bool deserialize(const std::string& name, bool isMandatory, bool& val); + bool deserialize(const std::string& name, bool isMandatory, char& val); + bool deserialize(const std::string& name, bool isMandatory, std::string& val); + bool deserialize(const std::string& name, bool isMandatory, std::vector& val); + void associateSerializer(Serializer& ser); + +protected: + void resetImpl(); + void setupImpl(std::istream& inStream); + Poco::SharedPtr subDeserializer(); + +private: + Deserializer(const Deserializer&); + Deserializer& operator = (const Deserializer&); + +private: + std::istream* _pStream; + Poco::Net::HTTPRequest* _pRequest; + Poco::Net::HTTPResponse* _pResponse; + Poco::SharedPtr _pPathDeserializer; + Poco::SharedPtr _pQueryDeserializer; + Poco::SharedPtr _pHeaderDeserializer; + Poco::SharedPtr _pJSONDeserializer; + Poco::SharedPtr _pRawDeserializer; + Poco::SharedPtr _pFormDeserializer; +}; + + +// +// inlines +// +inline void Deserializer::setRequest(Poco::Net::HTTPRequest& request) +{ + _pRequest = &request; +} + + +inline void Deserializer::setResponse(Poco::Net::HTTPResponse& response) +{ + _pResponse = &response; +} + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_Deserializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/FormDeserializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/FormDeserializer.h new file mode 100644 index 0000000000..d1cc2e0d45 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/FormDeserializer.h @@ -0,0 +1,80 @@ +// +// FormDeserializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: FormDeserializer +// +// Definition of the FormDeserializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_FormDeserializer_INCLUDED +#define RemotingNG_REST_FormDeserializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/ScalarDeserializer.h" +#include "Poco/RemotingNG/Deserializer.h" +#include "Poco/Net/HTTPRequest.h" +#include "Poco/Net/HTTPResponse.h" +#include "Poco/Net/HTMLForm.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API FormDeserializer: public ScalarDeserializer + /// The Form Deserializer implementation for the REST Transport. + /// + /// For more information, please see the Deserializer documentation. +{ +public: + FormDeserializer(Poco::Net::HTTPRequest& request); + /// Creates the FormDeserializer. + + FormDeserializer(Poco::Net::HTTPRequest& request, std::istream& stream); + /// Creates the FormDeserializer. + + FormDeserializer(Poco::Net::HTTPResponse& response, std::istream& stream); + /// Creates the FormDeserializer. + + ~FormDeserializer(); + /// Destroys the FormDeserializer. + + // Poco::RemotingNG::Deserializer + bool deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull); + +protected: + void handlePart(const std::string& name, std::istream& stream); + + // ScalarDeserializer + const std::string& deserializeData(const std::string& name, bool isMandatory, bool& found); + bool deserializeBuffer(const std::string& name, bool isMandatory, std::vector& val); + +private: + using PartMap = std::map>; + + Poco::Net::HTMLForm _form; + PartMap _parts; + + static const std::string EMPTY; + + friend class PartHandler; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_FormDeserializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/FormSerializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/FormSerializer.h new file mode 100644 index 0000000000..5661e271f5 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/FormSerializer.h @@ -0,0 +1,76 @@ +// +// FormSerializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: FormSerializer +// +// Definition of the FormSerializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_FormSerializer_INCLUDED +#define RemotingNG_REST_FormSerializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/ScalarSerializer.h" +#include "Poco/Net/HTTPRequest.h" +#include "Poco/Net/HTTPResponse.h" +#include "Poco/Net/HTMLForm.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API FormSerializer: public ScalarSerializer + /// The Form Serializer implementation for the REST + /// Transport. +{ +public: + FormSerializer(Poco::Net::HTTPRequest& request); + /// Creates the FormSerializer. + + FormSerializer(Poco::Net::HTTPRequest& request, std::ostream& stream); + /// Creates the FormSerializer. + + FormSerializer(Poco::Net::HTTPResponse& response, std::ostream& stream); + /// Creates the FormSerializer. + + ~FormSerializer(); + /// Destroys the FormSerializer. + + void close(); + /// Finalizes serialization. + +protected: + // ScalarSerializer + void serializeData(const std::string& name, const std::string& val); + void serializeBuffer(const std::string& name, const std::vector& val); + + static const std::string APPLICATION_OCTET_STREAM; + +private: + Poco::Net::HTTPRequest* _pRequest; + Poco::Net::HTTPResponse* _pResponse; + std::ostream* _pStream; + Poco::Net::HTMLForm _form; + + friend class FormDeserializer; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_FormSerializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/HeaderDeserializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/HeaderDeserializer.h new file mode 100644 index 0000000000..996c81d819 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/HeaderDeserializer.h @@ -0,0 +1,62 @@ +// +// HeaderDeserializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: HeaderDeserializer +// +// Definition of the HeaderDeserializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_HeaderDeserializer_INCLUDED +#define RemotingNG_REST_HeaderDeserializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/ScalarDeserializer.h" +#include "Poco/Net/HTTPMessage.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API HeaderDeserializer: public ScalarDeserializer + /// The Header Deserializer implementation for the REST Transport. + /// + /// For more information, please see the Deserializer documentation. +{ +public: + HeaderDeserializer(const Poco::Net::HTTPMessage& message); + /// Creates the HeaderDeserializer. + + ~HeaderDeserializer(); + /// Destroys the HeaderDeserializer. + + // Poco::RemotingNG::Deserializer + bool deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull); + +protected: + // ScalarDeserializer + const std::string& deserializeData(const std::string& name, bool isMandatory, bool& found); + +private: + const Poco::Net::HTTPMessage& _message; + + static const std::string EMPTY; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_HeaderDeserializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/HeaderSerializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/HeaderSerializer.h new file mode 100644 index 0000000000..70e8192fce --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/HeaderSerializer.h @@ -0,0 +1,56 @@ +// +// HeaderSerializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: HeaderSerializer +// +// Definition of the HeaderSerializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_HeaderSerializer_INCLUDED +#define RemotingNG_REST_HeaderSerializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/ScalarSerializer.h" +#include "Poco/Net/HTTPMessage.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API HeaderSerializer: public ScalarSerializer + /// The Header Serializer implementation for the REST + /// Transport. +{ +public: + HeaderSerializer(Poco::Net::HTTPMessage& message); + /// Creates the HeaderSerializer. + + ~HeaderSerializer(); + /// Destroys the HeaderSerializer. + +protected: + // ScalarSerializer + void serializeData(const std::string& name, const std::string& val); + +private: + Poco::Net::HTTPMessage* _pMessage; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_HeaderSerializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/JSArray.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSArray.h new file mode 100644 index 0000000000..34f92a7d86 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSArray.h @@ -0,0 +1,65 @@ +// +// JSArray.h +// +// Library: RemotingNG/REST +// Package: JSValue +// Module: JSArray +// +// Definition of the JSArray class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_JSArray_INCLUDED +#define RemotingNG_REST_JSArray_INCLUDED + + +#include "Poco/RemotingNG/REST/JSValue.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API JSArray: public JSValue + /// This class represents a JSON Array. + /// + /// Internal representation is a std::vector. + /// Element access is by numeric index (0 .. size - 1). + /// + /// The JSArray can be grown by accessing the size-th + /// element. +{ +public: + JSArray(); + /// Creates an empty JSArray. + + // JSValue + Type type() const; + std::size_t size() const; + const Ptr& operator [] (std::size_t index) const; + Ptr& operator [] (std::size_t index); + +protected: + ~JSArray(); + /// Destroys the JSArray. + +private: + using Vector = std::vector; + + Vector _vector; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_JSArray_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/JSONDeserializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSONDeserializer.h new file mode 100644 index 0000000000..596d77324d --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSONDeserializer.h @@ -0,0 +1,101 @@ +// +// JSONDeserializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: JSONDeserializer +// +// Definition of the JSONDeserializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_JSONDeserializer_INCLUDED +#define RemotingNG_REST_JSONDeserializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/Serializer.h" +#include "Poco/RemotingNG/REST/JSValue.h" +#include "Poco/RemotingNG/Deserializer.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API JSONDeserializer: public Poco::RemotingNG::Deserializer + /// The Deserializer implementation for the REST Transport. + /// + /// For more information, please see the Serializer documentation. +{ +public: + JSONDeserializer(std::istream& stream); + /// Creates the JSONDeserializer. + + ~JSONDeserializer(); + /// Destroys the JSONDeserializer. + + void deserializeError(const std::string& reason, int status); + + // Poco::RemotingNG::Deserializer + Poco::RemotingNG::SerializerBase::MessageType findMessage(std::string& name); + void deserializeMessageBegin(const std::string& name, SerializerBase::MessageType type); + void deserializeMessageEnd(const std::string& name, SerializerBase::MessageType type); + bool deserializeStructBegin(const std::string& name, bool isMandatory); + void deserializeStructEnd(const std::string& name); + bool deserializeSequenceBegin(const std::string& name, bool isMandatory, Poco::UInt32& lengthHint); + void deserializeSequenceEnd(const std::string& name); + bool deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull); + void deserializeNullableEnd(const std::string& name); + bool deserializeOptionalBegin(const std::string& name, bool isMandatory, bool& isSpecified); + void deserializeOptionalEnd(const std::string& name); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int8& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt8& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int16& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt16& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int32& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt32& val); + bool deserialize(const std::string& name, bool isMandatory, long& val); + bool deserialize(const std::string& name, bool isMandatory, unsigned long& val); +#ifndef POCO_INT64_IS_LONG + bool deserialize(const std::string& name, bool isMandatory, Poco::Int64& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt64& val); +#endif + bool deserialize(const std::string& name, bool isMandatory, float& val); + bool deserialize(const std::string& name, bool isMandatory, double& val); + bool deserialize(const std::string& name, bool isMandatory, bool& val); + bool deserialize(const std::string& name, bool isMandatory, char& val); + bool deserialize(const std::string& name, bool isMandatory, std::string& val); + bool deserialize(const std::string& name, bool isMandatory, std::vector& val); + void associateSerializer(Serializer& ser); + +protected: + void resetImpl(); + void setupImpl(std::istream& inStream); + +private: + JSONDeserializer(const JSONDeserializer&); + JSONDeserializer& operator = (const JSONDeserializer&); + + JSValue::Ptr findValue(const std::string& name, bool isMandatory, bool& found); + +private: + std::vector _objectStack; + std::vector _indexStack; + int _objectDepth; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_JSONDeserializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/JSONParser.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSONParser.h new file mode 100644 index 0000000000..423a633644 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSONParser.h @@ -0,0 +1,106 @@ +// +// JSONParser.h +// +// Library: RemotingNG/REST +// Package: JSONParser +// Module: JSONParser +// +// Definition of the JSONParser class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_JSONParser_INCLUDED +#define RemotingNG_REST_JSONParser_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/JSValue.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API JSONParser + /// A simple parser for JSON. +{ +public: + JSONParser(std::istream& istr); + /// Creates a JSONParser for parsing the given stream. + + ~JSONParser(); + /// Destroys the JSONParser. + + JSValue::Ptr parse(); + /// Reads a JSValue from the stream. + + void setMaxDepth(std::size_t maxDepth); + /// Sets the maximum allowed depth of the JSON document. + + std::size_t getMaxDepth() const; + /// Returns the maximum allowed depth of the JSON document. + + constexpr static std::size_t MAX_DEPTH = 50; + +protected: + int parseValue(int ch, JSValue::Ptr& pValue); + int parseObject(int ch, JSValue::Ptr& pObject); + int parseArray(int ch, JSValue::Ptr& pArray); + int parseScalar(int ch, JSValue::Ptr& pScalar); + int parseString(int ch, std::string& str); + int parseUnicode(int ch, std::string& str); + int skipWhitespace(int ch); + static bool isWhitespace(int ch); + static bool isEOF(int ch); + +private: + JSONParser(); + JSONParser(const JSONParser&); + JSONParser& operator = (const JSONParser&); + + std::streambuf& _streambuf; + std::size_t _depth = 0; + std::size_t _maxDepth = MAX_DEPTH; +}; + + +// +// inlines +// +inline void JSONParser::setMaxDepth(std::size_t maxDepth) +{ + _maxDepth = maxDepth; +} + + +inline std::size_t JSONParser::getMaxDepth() const +{ + return _maxDepth; +} + + +inline bool JSONParser::isWhitespace(int ch) +{ + return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n' || ch == '\f'; +} + + +inline bool JSONParser::isEOF(int ch) +{ + return ch == -1; +} + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_JSONParser_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/JSONSerializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSONSerializer.h new file mode 100644 index 0000000000..8f009c94e0 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSONSerializer.h @@ -0,0 +1,111 @@ +// +// JSONSerializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: JSONSerializer +// +// Definition of the JSONSerializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_JSONSerializer_INCLUDED +#define RemotingNG_REST_JSONSerializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/NumberFormatter.h" +#include "Poco/SharedPtr.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API JSONSerializer: public Poco::RemotingNG::Serializer + /// The JSON Serializer implementation for the REST + /// Transport. +{ +public: + static const std::string JSON_ERROR; + static const std::string JSON_CODE; + static const std::string JSON_DETAIL; + static const std::string JSON_TRUE; + static const std::string JSON_FALSE; + static const std::string JSON_NULL; + + enum State + { + ST_OBJECT, + ST_OBJECT_FIRST, + ST_ARRAY, + ST_ARRAY_FIRST + }; + + JSONSerializer(std::ostream& stream); + /// Creates the JSONSerializer. + + ~JSONSerializer(); + /// Destroys the JSONSerializer. + + // Poco::RemotingNG::Serializer + void serializeMessageBegin(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type); + void serializeMessageEnd(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type); + void serializeFaultMessage(const std::string& name, const Poco::Exception& exc); + void serializeStructBegin(const std::string& name); + void serializeStructEnd(const std::string& name); + void serializeSequenceBegin(const std::string& name, Poco::UInt32 numElems); + void serializeSequenceEnd(const std::string& name); + void serializeNullableBegin(const std::string& name, bool isNull); + void serializeNullableEnd(const std::string& name); + void serializeOptionalBegin(const std::string& name, bool isSpecified); + void serializeOptionalEnd(const std::string& name); + void serialize(const std::string& name, Poco::Int8 val); + void serialize(const std::string& name, Poco::UInt8 val); + void serialize(const std::string& name, Poco::Int16 val); + void serialize(const std::string& name, Poco::UInt16 val); + void serialize(const std::string& name, Poco::Int32 val); + void serialize(const std::string& name, Poco::UInt32 val); + void serialize(const std::string& name, long val); + void serialize(const std::string& name, unsigned long val); +#ifndef POCO_INT64_IS_LONG + void serialize(const std::string& name, Poco::Int64 val); + void serialize(const std::string& name, Poco::UInt64 val); +#endif + void serialize(const std::string& name, float val); + void serialize(const std::string& name, double val); + void serialize(const std::string& name, bool val); + void serialize(const std::string& name, char val); + void serialize(const std::string& name, const std::string& val); + void serialize(const std::string& name, const std::vector& val); + +protected: + void resetImpl(); + void setupImpl(std::ostream& stream); + +private: + void serializeData(const std::string& name, const std::string& val); + void writeSeparator(); + std::string escapeString(const std::string& val); + +private: + std::ostream* _pStream; + int _indent; + std::vector _state; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_JSONSerializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/JSObject.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSObject.h new file mode 100644 index 0000000000..b56f33295f --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSObject.h @@ -0,0 +1,64 @@ +// +// JSObject.h +// +// Library: RemotingNG/REST +// Package: JSValue +// Module: JSObject +// +// Definition of the JSObject class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_JSObject_INCLUDED +#define RemotingNG_REST_JSObject_INCLUDED + + +#include "Poco/RemotingNG/REST/JSValue.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API JSObject: public JSValue + /// This class represents a JSON Object. + /// + /// Internal representation is a std::map + /// from std::string to JSValue::Ptr. + /// Element access is by name. +{ +public: + JSObject(); + /// Creates an empty JSObject. + + // JSValue + Type type() const; + std::size_t size() const; + const Ptr& operator [] (const std::string& name) const; + Ptr& operator [] (const std::string& name); + bool has(const std::string& name) const; + +protected: + ~JSObject(); + /// Destroys the JSObject. + +private: + using Map = std::map; + + Map _map; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_JSObject_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/JSScalar.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSScalar.h new file mode 100644 index 0000000000..1b1a375f70 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSScalar.h @@ -0,0 +1,61 @@ +// +// JSScalar.h +// +// Library: RemotingNG/REST +// Package: JSValue +// Module: JSScalar +// +// Definition of the JSScalar class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_JSScalar_INCLUDED +#define RemotingNG_REST_JSScalar_INCLUDED + + +#include "Poco/RemotingNG/REST/JSValue.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API JSScalar: public JSValue + /// This class represents a scalar JSON value. + /// + /// Internal storage is always as std::string. +{ +public: + JSScalar(Type type = JS_STRING); + /// Creates an empty JSScalar with the given type. + + JSScalar(const std::string& value, Type type = JS_STRING); + /// Creates a JSScalar with the given value and type. + + // JSValue + Type type() const; + + const std::string& stringValue() const; + +protected: + ~JSScalar(); + /// Destroys the JSScalar. + +private: + std::string _value; + Type _type; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_JSScalar_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/JSValue.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSValue.h new file mode 100644 index 0000000000..54c5270d32 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/JSValue.h @@ -0,0 +1,136 @@ +// +// JSValue.h +// +// Library: RemotingNG/REST +// Package: JSValue +// Module: JSValue +// +// Definition of the JSValue class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_JSValue_INCLUDED +#define RemotingNG_REST_JSValue_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RefCountedObject.h" +#include "Poco/NumberParser.h" +#include "Poco/AutoPtr.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API JSValue: public Poco::RefCountedObject + /// This class represents a generic JavaScript object. + /// + /// Subclasses implement scalar values, arrays and objects. +{ +public: + using Ptr = Poco::AutoPtr; + + enum Type + { + JS_OBJECT, + JS_ARRAY, + JS_STRING, + JS_NUMBER, + JS_BOOL + }; + + virtual Type type() const = 0; + /// Returns the type of the object. + + virtual std::size_t size() const; + /// Returns the size of the object. + + virtual const std::string& stringValue() const; + /// Returns the object's value as string. + + Poco::Int32 asInt32() const; + /// Returns the object's value as Int32. + + Poco::Int64 asInt64() const; + /// Returns the object's value as Int64. + + Poco::UInt32 asUInt32() const; + /// Returns the object's value as UInt32. + + Poco::UInt64 asUInt64() const; + /// Returns the object's value as UInt64. + + double asDouble() const; + /// Returns the object's value as double. + + bool asBool() const; + /// Returns the object's value as boolean. + + virtual const Ptr& operator [] (const std::string& name) const; + virtual Ptr& operator [] (const std::string& name); + + virtual const Ptr& operator [] (std::size_t index) const; + virtual Ptr& operator [] (std::size_t index); + + virtual bool has(const std::string& name) const; +}; + + +// +// inlines +// +inline Poco::Int32 JSValue::asInt32() const +{ + return Poco::NumberParser::parse(stringValue()); +} + + +inline Poco::Int64 JSValue::asInt64() const +{ + return Poco::NumberParser::parse64(stringValue()); +} + + +inline Poco::UInt32 JSValue::asUInt32() const +{ + return Poco::NumberParser::parseUnsigned(stringValue()); +} + + +inline Poco::UInt64 JSValue::asUInt64() const +{ + return Poco::NumberParser::parseUnsigned64(stringValue()); +} + + +inline double JSValue::asDouble() const +{ + return Poco::NumberParser::parseFloat(stringValue()); +} + + +inline bool JSValue::asBool() const +{ + const std::string& value = stringValue(); + if (value == "true") + return true; + else if (value == "false") + return false; + else throw Poco::SyntaxException("not a boolean value"); +} + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_JSValue_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/Listener.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/Listener.h new file mode 100644 index 0000000000..b086b64b32 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/Listener.h @@ -0,0 +1,217 @@ +// +// Listener.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: Listener +// +// Definition of the Listener class. +// +// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_Listener_INCLUDED +#define RemotingNG_REST_Listener_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/Listener.h" +#include "Poco/Net/HTTPServerParams.h" +#include "Poco/Net/HTTPServer.h" +#include "Poco/Net/ServerSocket.h" +#include "Poco/SharedPtr.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API Listener: public Poco::RemotingNG::Listener + /// The RemotingNG Listener implementation for the REST transport. + /// + /// For more information, please see the Transport class. +{ +public: + using Ptr = Poco::AutoPtr; + + enum Protocol + { + PROTO_HTTP, + PROTO_HTTPS + }; + + Listener(const std::string& endPoint, Protocol proto); + /// Creates a Listener for the given endpoint, + /// which must be in : format. + /// + /// The value specified for proto determines the URI + /// scheme used by createURI(). + /// + /// Note that the Listener instance created by this constructor + /// does not actually accept requests itself. It merely registers an + /// endpoint in the ORB. A Poco::Net::HTTPServer must be created + /// for accepting REST requests using a RESTRequestHandler. + + Listener(const std::string& endPoint, Poco::Net::HTTPServerParams::Ptr pParams = new Poco::Net::HTTPServerParams); + /// Creates a Listener for the given endpoint, + /// which must be in : format. + /// + /// This constructor will create a Poco::Net::HTTPServer + /// instance for handling incoming REST requests, using + /// a Poco::Net::ServerSocket bound to endPoint. + + Listener(const std::string& endPoint, const Poco::Net::ServerSocket& socket, Poco::Net::HTTPServerParams::Ptr pParams = new Poco::Net::HTTPServerParams); + /// Creates a Listener for the given endpoint, + /// which must be in : format. + /// + /// This constructor will create a Poco::Net::HTTPServer + /// instance using the given server socket for handling + /// incoming REST requests. The given server socket can + /// be a Poco::Net::ServerSocket or a Poco::Net::SecureServerSocket + /// which must be bound to a socket address corresponding to + /// the given endPoint. + + ~Listener(); + /// Destroys the Listener. + + void enableChunkedTransferEncoding(bool enable = true); + /// Enables or disables chunked transfer encoding for responses. + /// Default is enabled. + + bool isChunkedTransferEncodingEnabled() const; + /// Returns true iff chunked transfer encoding is enabled for responses. + + void enableCompression(bool enable = true); + /// Enables or disables GZIP compression for responses. + /// Default is enabled. + /// + /// Note that chunked transfer encoding must also be enabled + /// in order to allow compression. + + bool isCompressionEnabled() const; + /// Returns true iff GZIP compression is enabled for responses. + + void enableCORS(bool enable = true); + /// Enables or disables CORS (Cross Origin Resource Sharing). + /// Default is disabled. + + bool isCORSEnabled() const; + /// Returns true iff CORS is enabled. + + void setCORSAllowedOrigin(const std::string& origin); + /// Sets the CORS allowed origin. + /// + /// Can be empty (default), an asterisk ("*"), or a specific origin + /// in the form of a complete http(s) URL ("http://domain.com"). + /// + /// In case of an empty origin specified here, all origins will + /// be accepted and the origin specified by the client will simply + /// be echoed back. If an asterisk is specified, again, all origins + /// will be accepted, but the asterisk will be sent back to the client + /// in the "Access-Control-Allow-Origin" header. + /// If any other origin is given, the origin presented by the client + /// must exactly match the specified origin for the request to be accepted. + + const std::string& getCORSAllowedOrigin() const; + /// Retuns the CORS allowed origin. + /// + /// See setCORSAllowedOrigin() for more information. + + void setCORSAllowedHeaders(const std::string& headers); + /// Sets the CORS allowed headers. + /// + /// Must be a list of comma-separated header names. + /// The default is "Accept, Content-Type". + /// + /// Note that "Content-Type" should always be included in the list. + /// Any custom headers used for passing parameters in REST methods must + /// be included in this list. + + const std::string& getCORSAllowedHeaders() const; + /// Returns the CORS allowed headers. + /// + /// See setCORSAllowedHeaders() for more information. + + void logServiceExceptions(bool enable = true); + /// Enable or disable logging of exceptions thrown by service methods. + /// + /// If enabled, exceptions thrown by service methods are logged with + /// the "RemotingNG.REST.RESTRequestHandler" logger. + + bool areServiceExceptionsLogged() const; + /// Returns true iff exceptions thrown by service methods are logged, + /// otherwise false. + + // Poco::RemotingNG::Listener + void start(); + void stop(); + const std::string& protocol() const; + std::string createURI(const Poco::RemotingNG::Identifiable::TypeId& typeId, const Poco::RemotingNG::Identifiable::ObjectId& objectId); + bool handlesURI(const std::string& uri); + void registerObject(Poco::RemotingNG::RemoteObject::Ptr pRemoteObject, Poco::RemotingNG::Skeleton::Ptr pSkeleton); + void unregisterObject(Poco::RemotingNG::RemoteObject::Ptr pRemoteObject); + + static const std::string CORS_ALLOWED_HEADERS; + +private: + bool _secure; + Poco::SharedPtr _pHTTPServer; + bool _logServiceExceptions; + bool _enableChunkedTransferEncoding; + bool _enableCompression; + bool _enableCORS; + std::string _corsAllowedOrigin; + std::string _corsAllowedHeaders; +}; + + +// +// inlines +// +inline bool Listener::isChunkedTransferEncodingEnabled() const +{ + return _enableChunkedTransferEncoding; +} + + +inline bool Listener::isCompressionEnabled() const +{ + return _enableCompression; +} + + +inline bool Listener::isCORSEnabled() const +{ + return _enableCORS; +} + + +inline const std::string& Listener::getCORSAllowedOrigin() const +{ + return _corsAllowedOrigin; +} + + +inline const std::string& Listener::getCORSAllowedHeaders() const +{ + return _corsAllowedHeaders; +} + + +inline bool Listener::areServiceExceptionsLogged() const +{ + return _logServiceExceptions; +} + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_Listener_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/PathDeserializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/PathDeserializer.h new file mode 100644 index 0000000000..be71db836c --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/PathDeserializer.h @@ -0,0 +1,73 @@ +// +// PathDeserializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: PathDeserializer +// +// Definition of the PathDeserializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_PathDeserializer_INCLUDED +#define RemotingNG_REST_PathDeserializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/ScalarDeserializer.h" +#include "Poco/Net/HTTPRequest.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API PathDeserializer: public ScalarDeserializer + /// The Path Deserializer implementation for the REST Transport. + /// + /// Extracts parameter values from URI path segments based on a path template. + /// The path template can contain placeholders in two formats: + /// - Simple placeholder: {name} - matches any path segment + /// - Alternation placeholder: {name:(option1|option2|...)} - matches only specified options + /// + /// Examples: + /// - Template "/api/user/{id}" matches "/api/user/123" and extracts id="123" + /// - Template "/api/{endpoint:(query|config)}" matches "/api/query" and extracts endpoint="query" + /// + /// For more information, please see the Deserializer documentation. +{ +public: + PathDeserializer(const std::string& pathTemplate, const Poco::Net::HTTPRequest& request); + /// Creates the PathDeserializer using the given path template and HTTP request. + /// The path template defines which segments contain parameters to extract. + + ~PathDeserializer(); + /// Destroys the PathDeserializer. + + // Poco::RemotingNG::Deserializer + bool deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull); + +protected: + void parsePath(const std::string& pathTemplate, const Poco::Net::HTTPRequest& request); + + // ScalarDeserializer + const std::string& deserializeData(const std::string& name, bool isMandatory, bool& found); + +private: + std::map _values; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_PathDeserializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/PathSerializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/PathSerializer.h new file mode 100644 index 0000000000..aaf2e83804 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/PathSerializer.h @@ -0,0 +1,69 @@ +// +// PathSerializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: PathSerializer +// +// Definition of the PathSerializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_PathSerializer_INCLUDED +#define RemotingNG_REST_PathSerializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/ScalarSerializer.h" +#include "Poco/Net/HTTPRequest.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API PathSerializer: public ScalarSerializer + /// The Path Serializer implementation for the REST + /// Transport. +{ +public: + PathSerializer(const std::string& pathTemplate, Poco::Net::HTTPRequest& request); + /// Creates the PathSerializer. + + ~PathSerializer(); + /// Destroys the PathSerializer. + + void close(); + /// Writes the complete path to the request. + +protected: + const std::string& replaceItem(const std::string& item); + /// Replaces the path item with a parameter if it's a placeholder. + + // ScalarSerializer + void serializeData(const std::string& name, const std::string& val); + +private: + std::string _pathTemplate; + Poco::Net::HTTPRequest& _request; + std::map _values; + + static const std::string EMPTY; + + friend class PathDeserializer; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_PathSerializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/REST.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/REST.h new file mode 100644 index 0000000000..dbe6dc7764 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/REST.h @@ -0,0 +1,62 @@ +// +// REST.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: REST +// +// Basic definitions for the Poco RemotingNG REST library. +// This file must be the first file included by every other REST +// header file. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_REST_INCLUDED +#define RemotingNG_REST_REST_INCLUDED + + +#ifndef Foundation_Foundation_INCLUDED +#include "Poco/Foundation.h" +#endif + + +// +// The following block is the standard way of creating macros which make exporting +// from a DLL simpler. All files within this DLL are compiled with the RemotingNGREST_EXPORTS +// symbol defined on the command line. This symbol should not be defined on any project +// that uses this DLL. This way any other project whose source files include this file sees +// RemotingNGREST_API functions as being imported from a DLL, whereas this DLL sees symbols +// defined with this macro as being exported. +// +#if defined(_WIN32) && defined(POCO_DLL) + #if defined(RemotingNGREST_EXPORTS) + #define RemotingNGREST_API __declspec(dllexport) + #else + #define RemotingNGREST_API __declspec(dllimport) + #endif +#endif + + +#if !defined(RemotingNGREST_API) + #define RemotingNGREST_API +#endif + + +// +// Automatically link JSON library. +// +#if defined(_MSC_VER) + #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(RemotingNGREST_EXPORTS) + #pragma comment(lib, "PocoRemotingNGREST" POCO_LIB_SUFFIX) + #endif +#endif + + +#endif // RemotingNG_REST_REST_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/RESTRequestHandler.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/RESTRequestHandler.h new file mode 100644 index 0000000000..432b2dce73 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/RESTRequestHandler.h @@ -0,0 +1,61 @@ +// +// RESTRequestHandler.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: RESTRequestHandler +// +// Definition of the RESTRequestHandler class. +// +// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_RESTRequestHandler_INCLUDED +#define RemotingNG_REST_RESTRequestHandler_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/Listener.h" +#include "Poco/Net/HTTPRequestHandler.h" +#include "Poco/Logger.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API RESTRequestHandler: public Poco::Net::HTTPRequestHandler + /// The HTTPRequestHandler implementation for RemotingNG REST. +{ +public: + RESTRequestHandler(Listener& listener); + /// Creates a RESTRequestHandler, using the given Listener. + + ~RESTRequestHandler(); + /// Destroys the RESTRequestHandler. + + // Poco::Net::HTTPRequestHandler + void handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response); + +protected: + bool handleCORS(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response); + +private: + RESTRequestHandler(); + + Listener& _listener; + Poco::Logger& _logger; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_RESTRequestHandler_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/RESTRequestHandlerFactory.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/RESTRequestHandlerFactory.h new file mode 100644 index 0000000000..98973d8280 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/RESTRequestHandlerFactory.h @@ -0,0 +1,57 @@ +// +// RESTRequestHandlerFactory.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: RESTRequestHandlerFactory +// +// Definition of the RESTRequestHandlerFactory class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_RESTRequestHandlerFactory_INCLUDED +#define RemotingNG_REST_RESTRequestHandlerFactory_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/Net/HTTPRequestHandlerFactory.h" +#include "Poco/Net/HTTPRequestHandler.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class Listener; + + +class RemotingNGREST_API RESTRequestHandlerFactory: public Poco::Net::HTTPRequestHandlerFactory + /// A factory for RESTRequestHandler objects. +{ +public: + RESTRequestHandlerFactory(Listener& listener); + /// Creates the RESTRequestHandlerFactory. + + ~RESTRequestHandlerFactory(); + /// Destroys the RESTRequestHandlerFactory. + + // Poco::Net::HTTPRequestHandlerFactory + Poco::Net::HTTPRequestHandler* createRequestHandler(const Poco::Net::HTTPServerRequest& request); + +private: + Listener& _listener; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_RESTRequestHandlerFactory_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/RESTServerException.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/RESTServerException.h new file mode 100644 index 0000000000..f41078a2bd --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/RESTServerException.h @@ -0,0 +1,113 @@ +// +// RESTServerException.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: RESTServerException +// +// Definition of the RESTServerException class. +// +// Copyright (c) 2024, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_RESTServerException_INCLUDED +#define RemotingNG_REST_RESTServerException_INCLUDED + + +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/RemotingNG/REST/JSValue.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API RESTServerException: public Poco::RemotingNG::RemoteException + /// This exception class contains detailed information from a REST + /// error received from the server. +{ +public: + RESTServerException(const std::string& reason, const std::string& message, int status, JSValue::Ptr pContent); + /// Creates a RESTServerException with the given reason, message, HTTP status code and detail. + + RESTServerException(const std::string& reason, int status, JSValue::Ptr pDetail); + /// Creates a RESTServerException with the given reason, HTTP status code and detail. + + RESTServerException(const RESTServerException& exc); + /// Creates a new RESTServerException from another one. + + ~RESTServerException() noexcept; + /// Destroy the exception. + + RESTServerException& operator = (const RESTServerException& exc); + /// Assignment operator. + + const char* name() const noexcept; + /// Returns a static string describing the exception. + + const char* className() const noexcept; + /// Returns the name of the exception class. + + Poco::Exception* clone() const; + /// Creates an exact copy of the exception. + + void rethrow() const; + /// (Re)Throws the exception. + + const std::string& reason() const; + /// Returns the HTTP reason text of the server response. + + int status() const; + /// Returns the HTTP status code of the server response. + + JSValue::Ptr content() const; + /// Returns the JSON content of the server response. + + std::string error() const; + /// Returns the value of the content's "error" property + /// if it exists, otherwise an empty string. + + std::string detail() const; + /// Returns the value of the content's "detail" property + /// if it exists, otherwise an empty string. + +private: + std::string _reason; + JSValue::Ptr _pContent; +}; + + +// +// inlines +// + + +inline const std::string& RESTServerException::reason() const +{ + return _reason; +} + + +inline int RESTServerException::status() const +{ + return code(); +} + + +inline JSValue::Ptr RESTServerException::content() const +{ + return _pContent; +} + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_RESTServerException_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/RawDeserializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/RawDeserializer.h new file mode 100644 index 0000000000..a6edbe52da --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/RawDeserializer.h @@ -0,0 +1,88 @@ +// +// RawDeserializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: RawDeserializer +// +// Definition of the RawDeserializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_RawDeserializer_INCLUDED +#define RemotingNG_REST_RawDeserializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/Deserializer.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API RawDeserializer: public Poco::RemotingNG::Deserializer + /// Deserialization of text-based or binary scalar values from a request body. +{ +public: + RawDeserializer(std::istream& stream); + /// Creates the RawDeserializer using the given input stream. + + ~RawDeserializer(); + /// Destroys the RawDeserializer. + + // Poco::RemotingNG::Deserializer + Poco::RemotingNG::SerializerBase::MessageType findMessage(std::string& name); + void deserializeMessageBegin(const std::string& name, SerializerBase::MessageType type); + void deserializeMessageEnd(const std::string& name, SerializerBase::MessageType type); + bool deserializeStructBegin(const std::string& name, bool isMandatory); + void deserializeStructEnd(const std::string& name); + bool deserializeSequenceBegin(const std::string& name, bool isMandatory, Poco::UInt32& lengthHint); + void deserializeSequenceEnd(const std::string& name); + bool deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull); + void deserializeNullableEnd(const std::string& name); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int8& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt8& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int16& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt16& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int32& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt32& val); + bool deserialize(const std::string& name, bool isMandatory, long& val); + bool deserialize(const std::string& name, bool isMandatory, unsigned long& val); +#ifndef POCO_INT64_IS_LONG + bool deserialize(const std::string& name, bool isMandatory, Poco::Int64& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt64& val); +#endif + bool deserialize(const std::string& name, bool isMandatory, float& val); + bool deserialize(const std::string& name, bool isMandatory, double& val); + bool deserialize(const std::string& name, bool isMandatory, bool& val); + bool deserialize(const std::string& name, bool isMandatory, char& val); + bool deserialize(const std::string& name, bool isMandatory, std::string& val); + bool deserialize(const std::string& name, bool isMandatory, std::vector& val); + +protected: + void resetImpl(); + void setupImpl(std::istream& inStream); + const std::string& deserializeData(const std::string& name, bool isMandatory, bool& found); + +private: + RawDeserializer(const RawDeserializer&); + RawDeserializer& operator = (const RawDeserializer&); + + std::istream* _pStream; + std::string _data; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_RawDeserializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/RawSerializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/RawSerializer.h new file mode 100644 index 0000000000..9a36a81a56 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/RawSerializer.h @@ -0,0 +1,90 @@ +// +// RawSerializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: RawSerializer +// +// Definition of the RawSerializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_RawSerializer_INCLUDED +#define RemotingNG_REST_RawSerializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/NumberFormatter.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API RawSerializer: public Poco::RemotingNG::Serializer + /// Raw text-based or binary serialization of scalar values. +{ +public: + RawSerializer(std::ostream& stream); + /// Creates the RawSerializer using the given stream. + + ~RawSerializer(); + /// Destroys the RawSerializer. + + // Poco::RemotingNG::Serializer + void serializeMessageBegin(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type); + void serializeMessageEnd(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type); + void serializeFaultMessage(const std::string& name, const Poco::Exception& exc); + void serializeStructBegin(const std::string& name); + void serializeStructEnd(const std::string& name); + void serializeSequenceBegin(const std::string& name, Poco::UInt32 numElems); + void serializeSequenceEnd(const std::string& name); + void serializeNullableBegin(const std::string& name, bool isNull); + void serializeNullableEnd(const std::string& name); + void serialize(const std::string& name, Poco::Int8 val); + void serialize(const std::string& name, Poco::UInt8 val); + void serialize(const std::string& name, Poco::Int16 val); + void serialize(const std::string& name, Poco::UInt16 val); + void serialize(const std::string& name, Poco::Int32 val); + void serialize(const std::string& name, Poco::UInt32 val); + void serialize(const std::string& name, long val); + void serialize(const std::string& name, unsigned long val); +#ifndef POCO_INT64_IS_LONG + void serialize(const std::string& name, Poco::Int64 val); + void serialize(const std::string& name, Poco::UInt64 val); +#endif + void serialize(const std::string& name, float val); + void serialize(const std::string& name, double val); + void serialize(const std::string& name, bool val); + void serialize(const std::string& name, char val); + void serialize(const std::string& name, const std::string& val); + void serialize(const std::string& name, const std::vector& val); + void resetImpl(); + void setupImpl(std::ostream&); + +protected: + void serializeData(const std::string& name, const std::string& val); + +private: + std::ostream* _pStream; + + static const std::string VAL_TRUE; + static const std::string VAL_FALSE; + + friend class RawDeserializer; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_RawSerializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/ScalarDeserializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/ScalarDeserializer.h new file mode 100644 index 0000000000..0ea4753d88 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/ScalarDeserializer.h @@ -0,0 +1,86 @@ +// +// ScalarDeserializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: ScalarDeserializer +// +// Definition of the ScalarDeserializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_ScalarDeserializer_INCLUDED +#define RemotingNG_REST_ScalarDeserializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/Deserializer.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API ScalarDeserializer: public Poco::RemotingNG::Deserializer + /// Deserialization of scalar values from form, header or path. +{ +public: + ScalarDeserializer(); + /// Creates the ScalarDeserializer. + + ~ScalarDeserializer(); + /// Destroys the ScalarDeserializer. + + // Poco::RemotingNG::Deserializer + Poco::RemotingNG::SerializerBase::MessageType findMessage(std::string& name); + void deserializeMessageBegin(const std::string& name, SerializerBase::MessageType type); + void deserializeMessageEnd(const std::string& name, SerializerBase::MessageType type); + bool deserializeStructBegin(const std::string& name, bool isMandatory); + void deserializeStructEnd(const std::string& name); + bool deserializeSequenceBegin(const std::string& name, bool isMandatory, Poco::UInt32& lengthHint); + void deserializeSequenceEnd(const std::string& name); + bool deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull); + void deserializeNullableEnd(const std::string& name); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int8& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt8& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int16& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt16& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::Int32& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt32& val); + bool deserialize(const std::string& name, bool isMandatory, long& val); + bool deserialize(const std::string& name, bool isMandatory, unsigned long& val); +#ifndef POCO_INT64_IS_LONG + bool deserialize(const std::string& name, bool isMandatory, Poco::Int64& val); + bool deserialize(const std::string& name, bool isMandatory, Poco::UInt64& val); +#endif + bool deserialize(const std::string& name, bool isMandatory, float& val); + bool deserialize(const std::string& name, bool isMandatory, double& val); + bool deserialize(const std::string& name, bool isMandatory, bool& val); + bool deserialize(const std::string& name, bool isMandatory, char& val); + bool deserialize(const std::string& name, bool isMandatory, std::string& val); + bool deserialize(const std::string& name, bool isMandatory, std::vector& val); + +protected: + void resetImpl(); + void setupImpl(std::istream& inStream); + virtual const std::string& deserializeData(const std::string& name, bool isMandatory, bool& found) = 0; + virtual bool deserializeBuffer(const std::string& name, bool isMandatory, std::vector& val); + +private: + ScalarDeserializer(const ScalarDeserializer&); + ScalarDeserializer& operator = (const ScalarDeserializer&); +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_ScalarDeserializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/ScalarSerializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/ScalarSerializer.h new file mode 100644 index 0000000000..f924338935 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/ScalarSerializer.h @@ -0,0 +1,89 @@ +// +// ScalarSerializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: ScalarSerializer +// +// Definition of the ScalarSerializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_ScalarSerializer_INCLUDED +#define RemotingNG_REST_ScalarSerializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/NumberFormatter.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API ScalarSerializer: public Poco::RemotingNG::Serializer + /// Serialization of scalar values for form, path or header. +{ +public: + ScalarSerializer(); + /// Creates the ScalarSerializer. + + ~ScalarSerializer(); + /// Destroys the ScalarSerializer. + + // Poco::RemotingNG::Serializer + void serializeMessageBegin(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type); + void serializeMessageEnd(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type); + void serializeFaultMessage(const std::string& name, const Poco::Exception& exc); + void serializeStructBegin(const std::string& name); + void serializeStructEnd(const std::string& name); + void serializeSequenceBegin(const std::string& name, Poco::UInt32 numElems); + void serializeSequenceEnd(const std::string& name); + void serializeNullableBegin(const std::string& name, bool isNull); + void serializeNullableEnd(const std::string& name); + void serialize(const std::string& name, Poco::Int8 val); + void serialize(const std::string& name, Poco::UInt8 val); + void serialize(const std::string& name, Poco::Int16 val); + void serialize(const std::string& name, Poco::UInt16 val); + void serialize(const std::string& name, Poco::Int32 val); + void serialize(const std::string& name, Poco::UInt32 val); + void serialize(const std::string& name, long val); + void serialize(const std::string& name, unsigned long val); +#ifndef POCO_INT64_IS_LONG + void serialize(const std::string& name, Poco::Int64 val); + void serialize(const std::string& name, Poco::UInt64 val); +#endif + void serialize(const std::string& name, float val); + void serialize(const std::string& name, double val); + void serialize(const std::string& name, bool val); + void serialize(const std::string& name, char val); + void serialize(const std::string& name, const std::string& val); + void serialize(const std::string& name, const std::vector& val); + void resetImpl(); + void setupImpl(std::ostream&); + +protected: + virtual void serializeData(const std::string& name, const std::string& val) = 0; + virtual void serializeBuffer(const std::string& name, const std::vector& val); + +private: + static const std::string VAL_TRUE; + static const std::string VAL_FALSE; + + friend class ScalarDeserializer; +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_ScalarSerializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/Serializer.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/Serializer.h new file mode 100644 index 0000000000..376a81bccf --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/Serializer.h @@ -0,0 +1,140 @@ +// +// Serializer.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: Serializer +// +// Definition of the Serializer class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_Serializer_INCLUDED +#define RemotingNG_REST_Serializer_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/RemotingNG/REST/JSONSerializer.h" +#include "Poco/RemotingNG/REST/FormSerializer.h" +#include "Poco/RemotingNG/REST/HeaderSerializer.h" +#include "Poco/RemotingNG/REST/PathSerializer.h" +#include "Poco/RemotingNG/REST/RawSerializer.h" +#include "Poco/SharedPtr.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class Deserializer; + + +class RemotingNGREST_API Serializer: public Poco::RemotingNG::Serializer + /// The Serializer implementation for the REST + /// Transport. +{ +public: + Serializer(); + /// Creates the Serializer. + + ~Serializer(); + /// Destroys the Serializer. + + void setRequest(Poco::Net::HTTPRequest& request); + /// Sets the HTTP request object. + + void setResponse(Poco::Net::HTTPResponse& response); + /// Sets the HTTP response object. + + // Poco::RemotingNG::Serializer + void serializeMessageBegin(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type); + void serializeMessageEnd(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type); + void serializeFaultMessage(const std::string& name, const Poco::Exception& exc); + void serializeStructBegin(const std::string& name); + void serializeStructEnd(const std::string& name); + void serializeSequenceBegin(const std::string& name, Poco::UInt32 numElems); + void serializeSequenceEnd(const std::string& name); + void serializeNullableBegin(const std::string& name, bool isNull); + void serializeNullableEnd(const std::string& name); + void serializeOptionalBegin(const std::string& name, bool isSpecified); + void serializeOptionalEnd(const std::string& name); + void serialize(const std::string& name, Poco::Int8 val); + void serialize(const std::string& name, Poco::UInt8 val); + void serialize(const std::string& name, Poco::Int16 val); + void serialize(const std::string& name, Poco::UInt16 val); + void serialize(const std::string& name, Poco::Int32 val); + void serialize(const std::string& name, Poco::UInt32 val); + void serialize(const std::string& name, long val); + void serialize(const std::string& name, unsigned long val); +#ifndef POCO_INT64_IS_LONG + void serialize(const std::string& name, Poco::Int64 val); + void serialize(const std::string& name, Poco::UInt64 val); +#endif + void serialize(const std::string& name, float val); + void serialize(const std::string& name, double val); + void serialize(const std::string& name, bool val); + void serialize(const std::string& name, char val); + void serialize(const std::string& name, const std::string& val); + void serialize(const std::string& name, const std::vector& val); + +protected: + void resetImpl(); + void setupImpl(std::ostream& out); + Poco::SharedPtr subSerializer(); + + static const std::string LOCATION_PATH; + static const std::string LOCATION_QUERY; + static const std::string LOCATION_HEADER; + static const std::string LOCATION_BODY; + static const std::string LOCATION_FORM; + static const std::string FORMAT_RAW; + static const std::string FORMAT_BINARY; + static const std::string FORMAT_JSON; + +private: + Serializer(const Serializer&); + Serializer& operator = (const Serializer&); + +private: + std::ostream* _pStream; + Poco::Net::HTTPRequest* _pRequest; + Poco::Net::HTTPResponse* _pResponse; + Poco::SharedPtr _pPathSerializer; + Poco::SharedPtr _pQuerySerializer; + Poco::SharedPtr _pHeaderSerializer; + Poco::SharedPtr _pRawSerializer; + Poco::SharedPtr _pJSONSerializer; + Poco::SharedPtr _pFormSerializer; + + friend class Deserializer; +}; + + +// +// inlines +// +inline void Serializer::setRequest(Poco::Net::HTTPRequest& request) +{ + _pRequest = &request; +} + + +inline void Serializer::setResponse(Poco::Net::HTTPResponse& response) +{ + _pResponse = &response; +} + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_Serializer_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/Transport.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/Transport.h new file mode 100644 index 0000000000..0f881d9556 --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/Transport.h @@ -0,0 +1,294 @@ +// +// Transport.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: Transport +// +// Definition of the Transport class. +// +// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_Transport_INCLUDED +#define RemotingNG_REST_Transport_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/Serializer.h" +#include "Poco/RemotingNG/REST/Deserializer.h" +#include "Poco/RemotingNG/REST/CookieStore.h" +#include "Poco/RemotingNG/Transport.h" +#include "Poco/RemotingNG/Credentials.h" +#include "Poco/Net/HTTPClientSession.h" +#include "Poco/Net/HTTPSessionFactory.h" +#include "Poco/Net/HTTPCredentials.h" +#include "Poco/SharedPtr.h" +#include "Poco/URI.h" +#include +#include + + +namespace Poco +{ + class InflatingInputStream; + class DeflatingOutputStream; +} + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API Transport: public Poco::RemotingNG::Transport + /// The Transport implementation for RemotingNG REST. + /// + /// This transport implements REST-style APIs based on the OpenAPI + /// specification (formerly the Swagger RESTful API) + /// (see + /// for the specification). + /// + /// The transport supports HTTP Basic and HTTP Digest authentication. + /// HTTP Digest authentication is not supported for one-way requests. +{ +public: + static const std::string PROTOCOL; + static const std::string CONTENT_TYPE; + + enum AuthMode + /// Authentication mode. + { + AUTH_NONE = 0, /// No authentication. + AUTH_BASIC = 1, /// HTTP Basic Authentication only (credentials are always sent). + AUTH_DIGEST = 2, /// HTTP Digest Authentication only. + AUTH_ANY = 3, /// HTTP Basic or Digest authentication (whichever the server requests). + AUTH_BEARER = 4, /// OAuth 2.0 Bearer Token (Credentials::ATTR_TOKEN, Credentials::ATTR_MECHANISM). + AUTH_CUSTOM = 5 /// Use custom authentication header (Credentials::ATTR_TOKEN, Credentials::ATTR_MECHANISM). + }; + + Transport(); + /// Creates a Transport for REST. + + ~Transport(); + /// Destroys the Transport. + + Poco::Timespan getTimeout() const; + /// Returns the HTTP timeout. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + void setTimeout(const Poco::Timespan& timeout); + /// Sets the HTTP timeout. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + bool isKeepAliveEnabled() const; + /// Returns true iff HTTP/1.1 persistent connections are enabled. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + void enableKeepAlive(bool enable); + /// Enables or disables HTTP/1.1 persistent connections. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + Poco::Timespan getKeepAliveTimeout() const; + /// Returns the timeout for HTTP/1.1 persistent connections. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + void setKeepAliveTimeout(const Poco::Timespan& timeout); + /// Sets the timeout for HTTP/1.1 persistent connections. + /// + /// The Transport must be connected, otherwise a Poco::IllegalStateException + /// will be thrown. + + bool isCompressionEnabled() const; + /// Returns true iff HTTP compression (GZIP) is enabled for requests. + /// Default is disabled. + + void enableCompression(bool enable); + /// Enables or disables HTTP compression via GZIP Content-Encoding for + /// requests. + /// This is normally disabled, due to a lack of support by most servers. + /// + /// Regardless of this setting, server responses can always be compressed + /// using GZIP Content-Encoding. + + void setAuthentication(AuthMode authMode); + /// Sets the authentication mode. + + AuthMode getAuthentication() const; + /// Returns the authentication mode. + + //@ deprecated + void setUsername(const std::string& username); + /// Sets the username for HTTP authentication. + /// + /// Deprecated. Code should be changed to + /// use setCredentials(). + + //@ deprecated + const std::string& getUsername() const; + /// Returns the username for HTTP authentication. + /// + /// Deprecated. Code should be changed to + /// use getCredentials(). + + //@ deprecated + void setPassword(const std::string& password); + /// Sets the password for HTTP authentication. + /// + /// Deprecated. Code should be changed to + /// use setCredentials(). + + //@ deprecated + const std::string& getPassword() const; + /// Returns the password for HTTP authentication. + /// + /// Deprecated. Code should be changed to + /// use getCredentials(). + + void setCredentials(const Poco::RemotingNG::Credentials& creds); + /// Sets the credentials which must match the specified + /// authentication mode (see setAuthentication()). + /// + /// For AUTH_BASIC, AUTH_DIGEST and AUTH_ANY, the + /// Credentials object must contain a + /// Credentials::ATTR_USERNAME and a Credentials::ATTR_PASSWORD + /// attribute. + /// + /// For AUTH_BEARER, the Credentials object must + /// contain a Credentials::ATTR_TOKEN attribute containing the + /// bearer token. Optionally, a Credentials::ATTR_MECHANISM + /// attribute can be specified to override the default + /// authentication scheme ("Bearer"). + /// + /// For AUTH_CUSTOM, the Credentials object must + /// contain a Credentials::ATTR_TOKEN attribute containing the + /// value passed in the custom authentication header, as + /// well as a Credentials::ATTR_MECHANISM attribute specifying + /// the name of the request header. + + const Poco::RemotingNG::Credentials& getCredentials() const; + /// Returns a const reference to the internal + /// Credentials object. + + const std::string& getUserAgent() const; + /// Returns the value of the User-Agent header sent with REST HTTP + /// requests, or an empty string if no User-Agent value has been set. + + void setUserAgent(const std::string& userAgent); + /// Sets the value of the User-Agent header sent with REST HTTP + /// requests. If an empty string is given (default), no User-Agent + /// header is included in the request. + + void setCustomHeader(const std::string& name, const std::string& value); + /// Adds a custom HTTP header to the HTTP request. + + void removeCustomHeader(const std::string& name); + /// Removes a custom HTTP header previously added with setCustomHeader(). + + bool hasCustomHeader(const std::string& name) const; + /// Returns true if a custom HTTP header with the given name has been set. + + const std::string& getCustomHeader(const std::string& name) const; + /// Returns the value of the custom HTTP header with the given name. + /// + /// Throws a Poco::NotFoundException if the custom header with the + /// given name does not exist. + + void setProxyConfig(const Poco::Net::ProxyConfig& proxyConfig); + /// Sets the proxy configuration. + + const Poco::Net::ProxyConfig& getProxyConfig() const; + /// Returns the proxy configuration. + + CookieStore::Ptr getCookieStore() const; + /// Returns the CookieStore. + + void setCookieStore(CookieStore::Ptr pCookieStore); + /// Sets the CookieStore. + + static Poco::Net::HTTPSessionFactory& httpSessionFactory(); + /// Returns the Poco::Net::HTTPSessionFactory instance used by + /// the transport. + + // Poco::RemotingNG::Transport + const std::string& endPoint() const; + void connect(const std::string& endPoint); + void disconnect(); + bool connected() const; + Poco::RemotingNG::Serializer& beginMessage(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + void sendMessage(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + Poco::RemotingNG::Serializer& beginRequest(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + Poco::RemotingNG::Deserializer& sendRequest(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType); + void endRequest(); + +protected: + const Poco::Net::HTTPClientSession& requireSession() const; + Poco::Net::HTTPClientSession& requireSession(); + void prepareRequest(const std::string& messageName); + + static const std::string USER_AGENT; + static const std::string BEARER; + static const std::string EMPTY; + +private: + Poco::RemotingNG::Credentials _creds; + Poco::Net::HTTPCredentials _httpCreds; + Poco::Net::ProxyConfig _proxyConfig; + Poco::SharedPtr _pSession; + Poco::SharedPtr _pRequest; + Poco::SharedPtr _pResponse; + Serializer _serializer; + Deserializer _deserializer; + std::string _endPoint; + Poco::URI _endPointURI; + bool _keepAlive; + bool _compression; + AuthMode _authMode; + std::string _userAgent; + std::map _customHeaders; + Poco::SharedPtr _pStream; + Poco::SharedPtr _pInflater; + Poco::SharedPtr _pDeflater; + CookieStore::Ptr _pCookieStore; + + static Poco::Net::HTTPSessionFactory _httpSessionFactory; + + friend class RESTRequestHandler; +}; + + +// +// inlines +// +inline Poco::Net::HTTPSessionFactory& Transport::httpSessionFactory() +{ + return _httpSessionFactory; +} + + +inline const Poco::RemotingNG::Credentials& Transport::getCredentials() const +{ + return _creds; +} + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_Transport_INCLUDED diff --git a/RemotingNG/REST/include/Poco/RemotingNG/REST/TransportFactory.h b/RemotingNG/REST/include/Poco/RemotingNG/REST/TransportFactory.h new file mode 100644 index 0000000000..850104de9d --- /dev/null +++ b/RemotingNG/REST/include/Poco/RemotingNG/REST/TransportFactory.h @@ -0,0 +1,56 @@ +// +// TransportFactory.h +// +// Library: RemotingNG/REST +// Package: REST +// Module: TransportFactory +// +// Definition of the TransportFactory class. +// +// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingNG_REST_TransportFactory_INCLUDED +#define RemotingNG_REST_TransportFactory_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "Poco/RemotingNG/REST/Serializer.h" +#include "Poco/RemotingNG/TransportFactory.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RemotingNGREST_API TransportFactory: public Poco::RemotingNG::TransportFactory + /// The TransportFactory for RemotingNG REST Transport objects. +{ +public: + TransportFactory(); + /// Creates a TransportFactory. + + ~TransportFactory(); + /// Destroys the TransportFactory. + + Poco::RemotingNG::Transport* createTransport(); + + static void registerFactory(); + /// Helper function to register the factory with the manager. + + static void unregisterFactory(); + /// Helper function to unregister the factory with the manager. +}; + + +} } } // namespace Poco::RemotingNG::REST + + +#endif // RemotingNG_REST_TransportFactory_INCLUDED diff --git a/RemotingNG/REST/src/CookieStore.cpp b/RemotingNG/REST/src/CookieStore.cpp new file mode 100644 index 0000000000..e4f07a25ef --- /dev/null +++ b/RemotingNG/REST/src/CookieStore.cpp @@ -0,0 +1,86 @@ +// +// CookieStore.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: CookieStore +// +// Copyright (c) 2006-2012, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/CookieStore.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +CookieStore::CookieStore() +{ +} + + +CookieStore::~CookieStore() +{ +} + + +void CookieStore::addCookies(Poco::Net::HTTPRequest& request) +{ + Poco::FastMutex::ScopedLock lock(_mutex); + + Poco::Timestamp now; + Poco::Net::NameValueCollection cookies; + for (CookieMap::const_iterator it = _cookies.begin(); it != _cookies.end(); ++it) + { + if (it->second.expireTime == 0 || now <= it->second.expireTime) + { + cookies.add(it->second.cookie.getName(), it->second.cookie.getValue()); + } + } + if (!cookies.empty()) + { + request.setCookies(cookies); + } +} + + +void CookieStore::updateCookies(const Poco::Net::HTTPResponse& response) +{ + Poco::FastMutex::ScopedLock lock(_mutex); + + std::vector cookies; + response.getCookies(cookies); + Poco::Timestamp now; + for (std::vector::const_iterator it = cookies.begin(); it != cookies.end(); ++it) + { + if (it->getMaxAge() == -1) + { + CookieInfo ci; + ci.cookie = *it; + ci.expireTime = 0; + _cookies[it->getName()] = ci; + } + else if (it->getMaxAge() == 0) + { + _cookies.erase(it->getName()); + } + else + { + CookieInfo ci; + ci.cookie = *it; + ci.expireTime += it->getMaxAge()*Poco::Timestamp::resolution(); + _cookies[it->getName()] = ci; + } + } +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/Deserializer.cpp b/RemotingNG/REST/src/Deserializer.cpp new file mode 100644 index 0000000000..6774f5d7e9 --- /dev/null +++ b/RemotingNG/REST/src/Deserializer.cpp @@ -0,0 +1,311 @@ +// +// Deserializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: Deserializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/Deserializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/String.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +Deserializer::Deserializer() +{ +} + + +Deserializer::~Deserializer() +{ +} + + +Poco::RemotingNG::SerializerBase::MessageType Deserializer::findMessage(std::string& name) +{ + poco_check_ptr (_pRequest); + + name = _pRequest->getMethod(); + if (name == Poco::Net::HTTPRequest::HTTP_POST) + { + name = _pRequest->get("X-HTTP-Method-Override"s, name); + } + + Poco::toLowerInPlace(name); + if (name == "delete") name += "_"; + return Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST; +} + + +void Deserializer::deserializeMessageBegin(const std::string&, SerializerBase::MessageType) +{ +} + + +void Deserializer::deserializeMessageEnd(const std::string& name, SerializerBase::MessageType type) +{ + // consume extra response content + int ch = _pStream->get(); + while (ch != -1) ch = _pStream->get(); + +} + + +bool Deserializer::deserializeStructBegin(const std::string& name, bool isMandatory) +{ + return subDeserializer()->deserializeStructBegin(name, isMandatory); +} + + +void Deserializer::deserializeStructEnd(const std::string& name) +{ + subDeserializer()->deserializeStructEnd(name); +} + + +bool Deserializer::deserializeSequenceBegin(const std::string& name, bool isMandatory, Poco::UInt32& sizeHint) +{ + return subDeserializer()->deserializeSequenceBegin(name, isMandatory, sizeHint); +} + + +void Deserializer::deserializeSequenceEnd(const std::string& name) +{ + subDeserializer()->deserializeSequenceEnd(name); +} + + +bool Deserializer::deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull) +{ + return subDeserializer()->deserializeNullableBegin(name, isMandatory, isNull); +} + + +void Deserializer::deserializeNullableEnd(const std::string& name) +{ + subDeserializer()->deserializeNullableEnd(name); +} + + +bool Deserializer::deserializeOptionalBegin(const std::string& name, bool isMandatory, bool& isSpecified) +{ + return subDeserializer()->deserializeOptionalBegin(name, isMandatory, isSpecified); +} + + +void Deserializer::deserializeOptionalEnd(const std::string& name) +{ + subDeserializer()->deserializeOptionalEnd(name); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int8& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt8& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int16& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt16& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int32& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt32& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, long& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, unsigned long& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +#ifndef POCO_INT64_IS_LONG +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int64& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt64& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} +#endif + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, float& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, double& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, bool& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, char& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, std::string& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +bool Deserializer::deserialize(const std::string& name, bool isMandatory, std::vector& val) +{ + return subDeserializer()->deserialize(name, isMandatory, val); +} + + +void Deserializer::setupImpl(std::istream& stream) +{ + resetImpl(); + _pStream = &stream; +} + + +void Deserializer::resetImpl() +{ + _pStream = 0; + _pRequest = 0; + _pResponse = 0; + _pPathDeserializer = 0; + _pQueryDeserializer = 0; + _pHeaderDeserializer = 0; + _pRawDeserializer = 0; + _pJSONDeserializer = 0; + _pFormDeserializer = 0; +} + + +Poco::SharedPtr Deserializer::subDeserializer() +{ + std::string location = getProperty(PROP_LOCATION, Serializer::LOCATION_BODY); + std::string format = getProperty(PROP_FORMAT, Serializer::FORMAT_JSON); + if (location == Serializer::LOCATION_PATH) + { + if (!_pPathDeserializer) + { + if (!_pRequest) throw Poco::RemotingNG::DeserializerException("Location 'path' can be used in request only"); + _pPathDeserializer = new PathDeserializer(getProperty(PROP_PATH, ""), *_pRequest); + } + return _pPathDeserializer; + } + else if (location == Serializer::LOCATION_QUERY) + { + if (!_pQueryDeserializer) + { + if (!_pRequest) throw Poco::RemotingNG::SerializerException("Location 'query' can be used in request only"); + _pQueryDeserializer = new FormDeserializer(*_pRequest); + } + return _pQueryDeserializer; + } + else if (location == Serializer::LOCATION_HEADER) + { + if (!_pHeaderDeserializer) + { + if (_pRequest) + _pHeaderDeserializer = new HeaderDeserializer(*_pRequest); + else if (_pResponse) + _pHeaderDeserializer = new HeaderDeserializer(*_pResponse); + else + throw Poco::IllegalStateException("No request or response object available"); + } + return _pHeaderDeserializer; + } + else if (location == Serializer::LOCATION_BODY) + { + if (format == Serializer::FORMAT_RAW || format == Serializer::FORMAT_BINARY) + { + if (_pJSONDeserializer) throw Poco::RemotingNG::DeserializerException("Cannot use body formats 'raw' and 'json' simultaneously"); + if (_pFormDeserializer) throw Poco::RemotingNG::DeserializerException("Cannot use locations 'form' and 'body' simultaneously"); + if (!_pRawDeserializer) + { + _pRawDeserializer = new RawDeserializer(*_pStream); + } + return _pRawDeserializer; + } + else if (format == Serializer::FORMAT_JSON) + { + if (_pRawDeserializer) throw Poco::RemotingNG::DeserializerException("Cannot use body formats 'raw' and 'json' simultaneously"); + if (_pFormDeserializer) throw Poco::RemotingNG::DeserializerException("Cannot use locations 'form' and 'body' simultaneously"); + if (!_pJSONDeserializer) + { + _pJSONDeserializer = new JSONDeserializer(*_pStream); + } + return _pJSONDeserializer; + } + else throw Poco::RemotingNG::DeserializerException("Unsupported format", format); + } + else if (location == Serializer::LOCATION_FORM) + { + if (_pRawDeserializer || _pJSONDeserializer) throw Poco::RemotingNG::DeserializerException("Cannot use locations 'form' and 'body' simultaneously"); + if (!_pFormDeserializer) + { + if (_pRequest) + _pFormDeserializer = new FormDeserializer(*_pRequest, *_pStream); + else if (_pResponse) + _pFormDeserializer = new FormDeserializer(*_pResponse, *_pStream); + else + throw Poco::IllegalStateException("No request or response object available"); + } + return _pFormDeserializer; + } + else throw Poco::RemotingNG::SerializerException("Invalid location", location); +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/FormDeserializer.cpp b/RemotingNG/REST/src/FormDeserializer.cpp new file mode 100644 index 0000000000..a7feec68ca --- /dev/null +++ b/RemotingNG/REST/src/FormDeserializer.cpp @@ -0,0 +1,148 @@ +// +// FormDeserializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: FormDeserializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/FormDeserializer.h" +#include "Poco/RemotingNG/REST/FormSerializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/Net/PartHandler.h" +#include "Poco/NumberParser.h" +#include "Poco/Base64Decoder.h" +#include "Poco/String.h" +#include +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class PartHandler: public Poco::Net::PartHandler +{ +public: + PartHandler(FormDeserializer& deserializer): + _deserializer(deserializer) + { + } + + void handlePart(const Poco::Net::MessageHeader& header, std::istream& stream) + { + std::string name; + if (header.has(CONTENT_DISPOSITION)) + { + std::string disp; + Poco::Net::NameValueCollection params; + Poco::Net::MessageHeader::splitParameters(header[CONTENT_DISPOSITION], disp, params); + name = params.get(NAME, EMPTY); + } + + if (!name.empty()) + { + _deserializer.handlePart(name, stream); + } + } + + static const std::string CONTENT_DISPOSITION; + static const std::string NAME; + static const std::string EMPTY; + +private: + FormDeserializer& _deserializer; +}; + + +const std::string PartHandler::CONTENT_DISPOSITION("Content-Disposition"); +const std::string PartHandler::NAME("name"); +const std::string PartHandler::EMPTY; + + +FormDeserializer::FormDeserializer(Poco::Net::HTTPRequest& request): + _form(request) +{ +} + + +FormDeserializer::FormDeserializer(Poco::Net::HTTPRequest& request, std::istream& stream) +{ + PartHandler partHandler(*this); + _form.load(request, stream, partHandler); +} + + +FormDeserializer::FormDeserializer(Poco::Net::HTTPResponse& response, std::istream& stream) +{ + _form.setEncoding(response.getContentType()); + PartHandler partHandler(*this); + _form.read(stream, partHandler); +} + + +FormDeserializer::~FormDeserializer() +{ +} + + +bool FormDeserializer::deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull) +{ + isNull = !_form.has(name); + return !isNull; +} + + +bool FormDeserializer::deserializeBuffer(const std::string& name, bool isMandatory, std::vector& val) +{ + PartMap::iterator it = _parts.find(name); + if (it != _parts.end()) + { + std::swap(val, it->second); + return true; + } + else + { + return ScalarDeserializer::deserializeBuffer(name, isMandatory, val); + } +} + + +const std::string& FormDeserializer::deserializeData(const std::string& name, bool isMandatory, bool& found) +{ + if (_form.has(name)) + { + found = true; + return _form.get(name); + } + else if (isMandatory) + { + throw Poco::RemotingNG::MissingParamException(name); + } + else + { + found = false; + return EMPTY; + } +} + + +void FormDeserializer::handlePart(const std::string& name, std::istream& stream) +{ + _parts[name].assign(std::istreambuf_iterator(stream), std::istreambuf_iterator()); +} + + +const std::string FormDeserializer::EMPTY; + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/FormSerializer.cpp b/RemotingNG/REST/src/FormSerializer.cpp new file mode 100644 index 0000000000..b55b004600 --- /dev/null +++ b/RemotingNG/REST/src/FormSerializer.cpp @@ -0,0 +1,155 @@ +// +// FormSerializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: FormSerializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/FormSerializer.h" +#include "Poco/Net/PartSource.h" +#include "Poco/MemoryStream.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class CharVectorPartSource: public Poco::Net::PartSource +{ +public: + CharVectorPartSource(const std::vector& data, const std::string& filename, const std::string& contentType): + Poco::Net::PartSource(contentType), + _data(data), + _filename(filename), + _contentType(contentType), + _stream(&data[0], data.size()) + { + } + + ~CharVectorPartSource() + { + } + + std::istream& stream() + { + return _stream; + } + + const std::string& filename() const + { + return _filename; + } + + std::streamsize getContentLength() const + { + return _data.size(); + } + +private: + const std::vector& _data; + std::string _filename; + std::string _contentType; + Poco::MemoryInputStream _stream; +}; + + +FormSerializer::FormSerializer(Poco::Net::HTTPRequest& request): + _pRequest(&request), + _pResponse(0), + _pStream(0) +{ +} + + +FormSerializer::FormSerializer(Poco::Net::HTTPRequest& request, std::ostream& stream): + _pRequest(&request), + _pResponse(0), + _pStream(&stream) +{ + if (_pRequest->getContentType() == Poco::Net::HTMLForm::ENCODING_MULTIPART) + { + _form.setEncoding(Poco::Net::HTMLForm::ENCODING_MULTIPART); + } +} + + +FormSerializer::FormSerializer(Poco::Net::HTTPResponse& response, std::ostream& stream): + _pRequest(0), + _pResponse(&response), + _pStream(&stream) +{ + if (_pResponse->getContentType() == Poco::Net::HTMLForm::ENCODING_MULTIPART) + { + _form.setEncoding(Poco::Net::HTMLForm::ENCODING_MULTIPART); + } +} + + +FormSerializer::~FormSerializer() +{ +} + + +void FormSerializer::close() +{ + if (_pRequest) + { + if (_pStream) + { + _form.prepareSubmit(*_pRequest); + _form.write(*_pStream); + } + else + { + std::ostringstream str; + str << _pRequest->getURI() << '?'; + _form.write(str); + _pRequest->setURI(str.str()); + } + } + else if (_pResponse) + { + if (_pStream) + { + _pResponse->setContentType(_form.getEncoding()); + _form.write(*_pStream); + } + } +} + + +void FormSerializer::serializeData(const std::string& name, const std::string& val) +{ + _form.set(name, val); +} + + +void FormSerializer::serializeBuffer(const std::string& name, const std::vector& val) +{ + if (_form.getEncoding() == Poco::Net::HTMLForm::ENCODING_MULTIPART) + { + std::string contentType = getProperty(PROP_CONTENT_TYPE, APPLICATION_OCTET_STREAM); + _form.addPart(name, new CharVectorPartSource(val, name, contentType)); + } + else + { + ScalarSerializer::serializeBuffer(name, val); + } +} + + +const std::string FormSerializer::APPLICATION_OCTET_STREAM("application/octet-stream"); + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/HeaderDeserializer.cpp b/RemotingNG/REST/src/HeaderDeserializer.cpp new file mode 100644 index 0000000000..f311369e4c --- /dev/null +++ b/RemotingNG/REST/src/HeaderDeserializer.cpp @@ -0,0 +1,71 @@ +// +// HeaderDeserializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: HeaderDeserializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/HeaderDeserializer.h" +#include "Poco/RemotingNG/REST/HeaderSerializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/NumberParser.h" +#include "Poco/Base64Decoder.h" +#include "Poco/String.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +const std::string HeaderDeserializer::EMPTY; + + +HeaderDeserializer::HeaderDeserializer(const Poco::Net::HTTPMessage& message): + _message(message) +{ +} + + +HeaderDeserializer::~HeaderDeserializer() +{ +} + + +bool HeaderDeserializer::deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull) +{ + isNull = !_message.has(name); + return !isNull; +} + + +const std::string& HeaderDeserializer::deserializeData(const std::string& name, bool isMandatory, bool& found) +{ + if (_message.has(name)) + { + found = true; + return _message.get(name); + } + else if (isMandatory) + { + throw Poco::RemotingNG::MissingParamException(name); + } + else + { + found = false; + return EMPTY; + } +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/HeaderSerializer.cpp b/RemotingNG/REST/src/HeaderSerializer.cpp new file mode 100644 index 0000000000..0c7a7df5b1 --- /dev/null +++ b/RemotingNG/REST/src/HeaderSerializer.cpp @@ -0,0 +1,42 @@ +// +// HeaderSerializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: HeaderSerializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/HeaderSerializer.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +HeaderSerializer::HeaderSerializer(Poco::Net::HTTPMessage& message): + _pMessage(&message) +{ +} + + +HeaderSerializer::~HeaderSerializer() +{ +} + + +void HeaderSerializer::serializeData(const std::string& name, const std::string& val) +{ + _pMessage->set(name, val); +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/JSArray.cpp b/RemotingNG/REST/src/JSArray.cpp new file mode 100644 index 0000000000..1d4031e64d --- /dev/null +++ b/RemotingNG/REST/src/JSArray.cpp @@ -0,0 +1,71 @@ +// +// JSArray.cpp +// +// Library: RemotingNG/REST +// Package: JSValue +// Module: JSArray +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/JSArray.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +JSArray::JSArray() +{ +} + + +JSArray::~JSArray() +{ +} + + +JSValue::Type JSArray::type() const +{ + return JS_ARRAY; +} + + +std::size_t JSArray::size() const +{ + return _vector.size(); +} + + +const JSValue::Ptr& JSArray::operator [] (std::size_t index) const +{ + if (index < _vector.size()) + return _vector[index]; + else + throw Poco::InvalidAccessException("index out of range"); +} + + +JSValue::Ptr& JSArray::operator [] (std::size_t index) +{ + if (index < _vector.size()) + { + return _vector[index]; + } + else if (index == _vector.size()) + { + _vector.push_back(JSValue::Ptr()); + return _vector.back(); + } + else throw Poco::InvalidAccessException("index out of range"); +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/JSONDeserializer.cpp b/RemotingNG/REST/src/JSONDeserializer.cpp new file mode 100644 index 0000000000..6c25807221 --- /dev/null +++ b/RemotingNG/REST/src/JSONDeserializer.cpp @@ -0,0 +1,502 @@ +// +// JSONDeserializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: JSONDeserializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/JSONDeserializer.h" +#include "Poco/RemotingNG/REST/JSONSerializer.h" +#include "Poco/RemotingNG/REST/JSONParser.h" +#include "Poco/RemotingNG/REST/JSObject.h" +#include "Poco/RemotingNG/REST/RESTServerException.h" +#include "Poco/NumberParser.h" +#include "Poco/Base64Decoder.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +JSONDeserializer::JSONDeserializer(std::istream& stream): + _objectDepth(0) +{ + setupImpl(stream); +} + + +JSONDeserializer::~JSONDeserializer() +{ +} + + +void JSONDeserializer::deserializeError(const std::string& reason, int status) +{ + poco_assert_dbg (_objectStack.size() == 1); + + std::string exception; + std::string message; + if (_objectStack.front()->has(JSONSerializer::JSON_ERROR)) + { + exception = (*_objectStack.front())[JSONSerializer::JSON_ERROR]->stringValue(); + } + if (_objectStack.front()->has(JSONSerializer::JSON_DETAIL)) + { + message = (*_objectStack.front())[JSONSerializer::JSON_DETAIL]->stringValue(); + } + std::string fullMessage; + if (!exception.empty()) + { + fullMessage += exception; + } + if (!fullMessage.empty() && !message.empty()) + { + fullMessage += ": "; + } + fullMessage += message; + + throw RESTServerException(reason, fullMessage, status, _objectStack.front()); +} + + +Poco::RemotingNG::SerializerBase::MessageType JSONDeserializer::findMessage(std::string&) +{ + poco_bugcheck(); + return Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST; +} + + +void JSONDeserializer::deserializeMessageBegin(const std::string&, SerializerBase::MessageType) +{ + poco_bugcheck(); +} + + +void JSONDeserializer::deserializeMessageEnd(const std::string& name, SerializerBase::MessageType type) +{ + poco_bugcheck(); +} + + +bool JSONDeserializer::deserializeStructBegin(const std::string& name, bool isMandatory) +{ + if (_objectDepth == 0 && _objectStack.size() == 1 && _objectStack.back()->type() == JSValue::JS_OBJECT) + { + _objectDepth++; + return true; + } + + bool found = false; + JSValue::Ptr pObject = findValue(name, isMandatory, found); + if (found) + { + if (pObject->type() != JSValue::JS_OBJECT) + Poco::RemotingNG::DeserializerException("expected object, found something else", name); + + _objectStack.push_back(pObject); + _objectDepth++; + return true; + } + else if (isMandatory) + { + throw Poco::RemotingNG::MissingParamException(name); + } + return false; +} + + +void JSONDeserializer::deserializeStructEnd(const std::string& name) +{ + _objectDepth--; + _objectStack.pop_back(); +} + + +bool JSONDeserializer::deserializeSequenceBegin(const std::string& name, bool isMandatory, Poco::UInt32& sizeHint) +{ + if (_objectDepth == 0 && _objectStack.size() == 1 && _objectStack.back()->type() == JSValue::JS_ARRAY) + { + _indexStack.push_back(0); + sizeHint = static_cast(_objectStack.back()->size()); + _objectDepth++; + return true; + } + + bool found = false; + JSValue::Ptr pArray = findValue(name, isMandatory, found); + if (found) + { + if (pArray->type() != JSValue::JS_ARRAY) + Poco::RemotingNG::DeserializerException("expected array, found something else", name); + + sizeHint = static_cast(pArray->size()); + _objectStack.push_back(pArray); + _indexStack.push_back(0); + _objectDepth++; + return true; + } + else if (isMandatory) + { + throw Poco::RemotingNG::MissingParamException(name); + } + return false; +} + + +void JSONDeserializer::deserializeSequenceEnd(const std::string& name) +{ + _objectDepth--; + _indexStack.pop_back(); + _objectStack.pop_back(); +} + + +bool JSONDeserializer::deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + isNull = pValue.isNull(); + // findValue() will be called again and must return the same value + // Therefore we must adjust the _indexStack's topmost counter. + if (!isNull && _objectStack.back()->type() == JSValue::JS_ARRAY) + { + _indexStack.back()--; + } + } + return found; +} + + +void JSONDeserializer::deserializeNullableEnd(const std::string& name) +{ +} + + +bool JSONDeserializer::deserializeOptionalBegin(const std::string& name, bool isMandatory, bool& isSpecified) +{ + JSValue::Ptr pValue = findValue(name, false, isSpecified); + if (isSpecified) + { + // findValue() will be called again and must return the same value + // Therefore we must adjust the _indexStack's topmost counter. + if (_objectStack.back()->type() == JSValue::JS_ARRAY) + { + _indexStack.back()--; + } + } + return isSpecified; +} + + +void JSONDeserializer::deserializeOptionalEnd(const std::string& name) +{ +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int8& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = static_cast(pValue->asInt32()); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt8& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = static_cast(pValue->asUInt32()); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int16& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = static_cast(pValue->asInt32()); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt16& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = static_cast(pValue->asUInt32()); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int32& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = pValue->asInt32(); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt32& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = pValue->asUInt32(); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, long& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); +#ifdef POCO_INT64_IS_LONG + val = pValue->asInt64(); +#else + val = pValue->asInt32(); +#endif + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, unsigned long& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); +#ifdef POCO_INT64_IS_LONG + val = pValue->asUInt64(); +#else + val = pValue->asUInt32(); +#endif + } + return found; +} + + +#ifndef POCO_INT64_IS_LONG +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int64& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = pValue->asInt64(); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt64& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = pValue->asUInt64(); + } + return found; +} +#endif + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, float& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = static_cast(pValue->asDouble()); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, double& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = pValue->asDouble(); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, bool& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = pValue->asBool(); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, char& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + const std::string& str = pValue->stringValue(); + if (str.size() == 1) + val = str[0]; + else + throw Poco::RemotingNG::DeserializerException(std::string("Illegal char value ") + str); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, std::string& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + val = pValue->stringValue(); + } + return found; +} + + +bool JSONDeserializer::deserialize(const std::string& name, bool isMandatory, std::vector& val) +{ + bool found = false; + JSValue::Ptr pValue = findValue(name, isMandatory, found); + if (found) + { + if (!pValue) throw Poco::NullValueException(name); + std::istringstream istr(pValue->stringValue()); + Poco::Base64Decoder decoder(istr); + val.clear(); + int ch = decoder.get(); + while (ch != -1) + { + val.push_back(static_cast(ch)); + ch = decoder.get(); + } + } + return found; +} + + +JSValue::Ptr JSONDeserializer::findValue(const std::string& name, bool isMandatory, bool& found) +{ + poco_assert (!_objectStack.empty()); + + if (_objectStack.back()->type() == JSValue::JS_ARRAY) + { + if (_indexStack.empty()) + { + throw Poco::RemotingNG::DeserializerException("Expected object, but found array", name); + } + else if (_indexStack.back() < _objectStack.back()->size()) + { + found = true; + return (*_objectStack.back())[_indexStack.back()++]; + } + else + { + found = false; + } + } + else if (_objectStack.back()->type() == JSValue::JS_OBJECT) + { + if (_objectStack.back()->has(name)) + { + found = true; + return (*_objectStack.back())[name]; + } + else + { + found = false; + } + } + else if (_objectDepth == 0 && _objectStack.size() == 1) + { + found = true; + return _objectStack.back(); + } + if (isMandatory) + { + throw Poco::RemotingNG::MissingParamException(name); + } + return JSValue::Ptr(); +} + + +void JSONDeserializer::resetImpl() +{ + _objectStack.clear(); + _indexStack.clear(); + _objectDepth = 0; +} + + +void JSONDeserializer::setupImpl(std::istream& stream) +{ + resetImpl(); + JSONParser parser(stream); + _objectStack.push_back(parser.parse()); + int ch = stream.get(); + while (ch != -1) ch = stream.get(); +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/JSONParser.cpp b/RemotingNG/REST/src/JSONParser.cpp new file mode 100644 index 0000000000..3c6df41d71 --- /dev/null +++ b/RemotingNG/REST/src/JSONParser.cpp @@ -0,0 +1,247 @@ +// +// JSONParser.cpp +// +// Library: RemotingNG/REST +// Package: JSONParser +// Module: JSONParser +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/JSONParser.h" +#include "Poco/RemotingNG/REST/JSScalar.h" +#include "Poco/RemotingNG/REST/JSObject.h" +#include "Poco/RemotingNG/REST/JSArray.h" +#include "Poco/NumberParser.h" +#include "Poco/UTF8Encoding.h" +#include "Poco/Exception.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class DepthGuard +{ +public: + DepthGuard(std::size_t& depth, std::size_t maxDepth): + _depth(depth) + { + if (++_depth > maxDepth) throw Poco::SyntaxException("too many levels"); + } + + ~DepthGuard() + { + --_depth; + } + +private: + std::size_t& _depth; +}; + + +JSONParser::JSONParser(std::istream& istr): + _streambuf(*istr.rdbuf()) +{ +} + + +JSONParser::~JSONParser() +{ +} + + +JSValue::Ptr JSONParser::parse() +{ + _depth = 0; + JSValue::Ptr pResult; + parseValue(_streambuf.sbumpc(), pResult); + return pResult; +} + + +int JSONParser::parseValue(int ch, JSValue::Ptr& pValue) +{ + ch = skipWhitespace(ch); + if (ch == '{') + return parseObject(ch, pValue); + else if (ch == '[') + return parseArray(ch, pValue); + else if (!isEOF(ch)) + return parseScalar(ch, pValue); + else + throw Poco::DataFormatException("no JSON content found"); +} + + +int JSONParser::parseObject(int ch, JSValue::Ptr& pObject) +{ + poco_assert_dbg (ch == '{'); + + DepthGuard depthGuard(_depth, _maxDepth); + + pObject = new JSObject; + ch = skipWhitespace(_streambuf.sbumpc()); + while (ch != '}') + { + std::string name; + ch = skipWhitespace(ch); + ch = parseString(ch, name); + ch = skipWhitespace(ch); + if (ch != ':') throw Poco::SyntaxException("excepted ':'"); + JSValue::Ptr pValue; + ch = parseValue(_streambuf.sbumpc(), pValue); + (*pObject)[name] = pValue; + ch = skipWhitespace(ch); + if (ch == ',') + ch = skipWhitespace(_streambuf.sbumpc()); + else if (ch != '}') + throw Poco::SyntaxException("expected '}' or ','"); + } + if (ch == '}') ch = _streambuf.sbumpc(); + return ch; +} + + +int JSONParser::parseArray(int ch, JSValue::Ptr& pArray) +{ + poco_assert_dbg (ch == '['); + + DepthGuard depthGuard(_depth, _maxDepth); + + pArray = new JSArray; + ch = skipWhitespace(_streambuf.sbumpc()); + while (ch != ']') + { + ch = skipWhitespace(ch); + JSValue::Ptr pValue; + ch = parseValue(ch, pValue); + (*pArray)[pArray->size()] = pValue; + ch = skipWhitespace(ch); + if (ch == ',') + ch = skipWhitespace(_streambuf.sbumpc()); + else if (ch != ']') + throw Poco::SyntaxException("expected ']' or ','"); + } + if (ch == ']') ch = _streambuf.sbumpc(); + return ch; +} + + +int JSONParser::parseScalar(int ch, JSValue::Ptr& pObject) +{ + std::string value; + if (ch == '"') + { + ch = parseString(ch, value); + pObject = new JSScalar(value, JSScalar::JS_STRING); + } + else + { + while (!isEOF(ch) && !isWhitespace(ch) && ch != ',' && ch != ']' && ch != '}') + { + value += static_cast(ch); + ch = _streambuf.sbumpc(); + } + if (value == "true" || value == "false") + pObject = new JSScalar(value, JSScalar::JS_BOOL); + else if (value != "null") + pObject = new JSScalar(value, JSScalar::JS_NUMBER); // TODO: check number syntax + } + return ch; +} + + +int JSONParser::parseString(int ch, std::string& str) +{ + str.clear(); + if (ch != '"') throw Poco::SyntaxException(std::string("string expected, but found '") + std::string(1, ch) + "\'"); + ch = _streambuf.sbumpc(); + while (ch != '"' && !isEOF(ch)) + { + if (ch == '\\') + { + ch = _streambuf.sbumpc(); + switch (ch) + { + case '"': + case '\\': + case '/': + str += static_cast(ch); + break; + case 'b': + str += '\b'; + break; + case 'f': + str += '\f'; + break; + case 'n': + str += '\n'; + break; + case 'r': + str += '\r'; + break; + case 't': + str += '\t'; + break; + case 'u': + ch = parseUnicode(ch, str); + continue; + default: + throw Poco::SyntaxException("invalid escape sequence"); + } + } + else + { + str += static_cast(ch); + } + ch = _streambuf.sbumpc(); + } + if (ch == '"') ch = _streambuf.sbumpc(); + return ch; +} + + +int JSONParser::parseUnicode(int ch, std::string& str) +{ + poco_assert (ch == 'u'); + + std::string hex; + ch = _streambuf.sbumpc(); + while (ch != -1 && hex.size() < 4) + { + hex += static_cast(ch); + ch = _streambuf.sbumpc(); + } + if (hex.size() == 4) + { + int code = Poco::NumberParser::parseHex(hex); + unsigned char buffer[8]; + Poco::UTF8Encoding utf8; + int n = utf8.convert(code, buffer, sizeof(buffer)); + str.append(reinterpret_cast(&buffer[0]), n); + } + else throw Poco::SyntaxException("bad unicode character reference in string"); + + return ch; +} + + +int JSONParser::skipWhitespace(int ch) +{ + while (isWhitespace(ch)) + { + ch = _streambuf.sbumpc(); + } + return ch; +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/JSONSerializer.cpp b/RemotingNG/REST/src/JSONSerializer.cpp new file mode 100644 index 0000000000..8edf6d6fa8 --- /dev/null +++ b/RemotingNG/REST/src/JSONSerializer.cpp @@ -0,0 +1,348 @@ +// +// JSONSerializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: JSONSerializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/JSONSerializer.h" +#include "Poco/NumberFormatter.h" +#include "Poco/Base64Encoder.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +const std::string JSONSerializer::JSON_ERROR("error"); +const std::string JSONSerializer::JSON_CODE("code"); +const std::string JSONSerializer::JSON_DETAIL("detail"); +const std::string JSONSerializer::JSON_TRUE("true"); +const std::string JSONSerializer::JSON_FALSE("false"); +const std::string JSONSerializer::JSON_NULL("null"); + + +JSONSerializer::JSONSerializer(std::ostream& stream): + _pStream(&stream), + _indent(0) +{ +} + + +JSONSerializer::~JSONSerializer() +{ +} + + +void JSONSerializer::serializeMessageBegin(const std::string&, Poco::RemotingNG::SerializerBase::MessageType type) +{ +} + + +void JSONSerializer::serializeMessageEnd(const std::string&, Poco::RemotingNG::SerializerBase::MessageType type) +{ +} + + +void JSONSerializer::serializeFaultMessage(const std::string& methodName, const Poco::Exception& e) +{ + poco_assert_dbg(_pStream); + + *_pStream << + "{\n" << + "\t\"" << JSON_ERROR << "\": \"" << e.name() << "\",\n" + "\t\"" << JSON_DETAIL << "\": " << escapeString(e.message()) << ",\n" << + "\t\"" << JSON_CODE << "\": " << e.code() << "\n" << + "}\n"; + _pStream->flush(); +} + + +void JSONSerializer::serializeStructBegin(const std::string& name) +{ + if (!_state.empty()) + { + writeSeparator(); + if (_state.back() != ST_ARRAY) + { + *_pStream << std::string(_indent, '\t') << "\"" << name << "\":\n"; + } + } + *_pStream << std::string(_indent, '\t') << "{"; + ++_indent; + _state.push_back(ST_OBJECT_FIRST); +} + + +void JSONSerializer::serializeStructEnd(const std::string& name) +{ + _state.pop_back(); + --_indent; + *_pStream << + "\n" << + std::string(_indent, '\t') << "}"; +} + + +void JSONSerializer::serializeSequenceBegin(const std::string& name, Poco::UInt32 numElems) +{ + if (!_state.empty()) + { + writeSeparator(); + if (_state.back() != ST_ARRAY) + { + *_pStream << std::string(_indent, '\t') << "\"" << name << "\":\n"; + } + } + *_pStream << std::string(_indent, '\t') << "["; + ++_indent; + _state.push_back(ST_ARRAY_FIRST); +} + + +void JSONSerializer::serializeSequenceEnd(const std::string& name) +{ + _state.pop_back(); + --_indent; + *_pStream << + "\n" << + std::string(_indent, '\t') << "]"; +} + + +void JSONSerializer::serializeNullableBegin(const std::string& name, bool isNull) +{ + if (isNull) + { + serializeData(name, JSON_NULL); + } +} + + +void JSONSerializer::serializeNullableEnd(const std::string&) +{ +} + + +void JSONSerializer::serializeOptionalBegin(const std::string& /*name*/, bool /*isSpecified*/) +{ +} + + +void JSONSerializer::serializeOptionalEnd(const std::string&) +{ +} + + +void JSONSerializer::serialize(const std::string& name, Poco::Int8 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void JSONSerializer::serialize(const std::string& name, Poco::UInt8 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void JSONSerializer::serialize(const std::string& name, Poco::Int16 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void JSONSerializer::serialize(const std::string& name, Poco::UInt16 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void JSONSerializer::serialize(const std::string& name, Poco::Int32 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void JSONSerializer::serialize(const std::string& name, Poco::UInt32 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void JSONSerializer::serialize(const std::string& name, long val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void JSONSerializer::serialize(const std::string& name, unsigned long val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +#ifndef POCO_INT64_IS_LONG +void JSONSerializer::serialize(const std::string& name, Poco::Int64 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void JSONSerializer::serialize(const std::string& name, Poco::UInt64 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} +#endif + + +void JSONSerializer::serialize(const std::string& name, float val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void JSONSerializer::serialize(const std::string& name, double val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void JSONSerializer::serialize(const std::string& name, bool val) +{ + serializeData(name, val? JSON_TRUE : JSON_FALSE); +} + + +void JSONSerializer::serialize(const std::string& name, char val) +{ + std::string tmp("\""); + tmp += val; + tmp += '\"'; + serializeData(name, tmp); +} + + +void JSONSerializer::serialize(const std::string& name, const std::vector& val) +{ + std::stringstream base64; + base64 << '\"'; + Poco::Base64Encoder encoder(base64); + encoder.write(&val[0], static_cast(val.size())); + encoder.close(); + base64 << '\"'; + serializeData(name, base64.str()); +} + + +void JSONSerializer::serialize(const std::string& name, const std::string& val) +{ + serializeData(name, escapeString(val)); +} + + +void JSONSerializer::serializeData(const std::string& name, const std::string& val) +{ + writeSeparator(); + *_pStream << std::string(_indent, '\t'); + if (!_state.empty() && _state.back() != ST_ARRAY) + { + *_pStream << "\"" << name << "\": "; + } + *_pStream << val; +} + + +void JSONSerializer::writeSeparator() +{ + if (!_state.empty()) + { + switch (_state.back()) + { + case ST_OBJECT_FIRST: + *_pStream << "\n"; + _state.back() = ST_OBJECT; + break; + case ST_ARRAY_FIRST: + *_pStream << "\n"; + _state.back() = ST_ARRAY; + break; + default: + *_pStream << ",\n"; + break; + } + } +} + + +void JSONSerializer::resetImpl() +{ + _indent = 0; + _state.clear(); +} + + +void JSONSerializer::setupImpl(std::ostream& stream) +{ + resetImpl(); + _pStream = &stream; +} + + +std::string JSONSerializer::escapeString(const std::string& val) +{ + std::string str("\""); + for (std::string::const_iterator it = val.begin(); it != val.end(); ++it) + { + switch (*it) + { + case '\f': + str += "\\f"; + break; + case '\t': + str += "\\t"; + break; + case '\r': + str += "\\r"; + break; + case '\n': + str += "\\n"; + break; + case '\b': + str += "\\b"; + break; + case '"': + str += "\\\""; + break; + case '\\': + str += "\\\\"; + break; + default: + if (static_cast(*it) < ' ') + { + str += "\\u"; + Poco::NumberFormatter::appendHex(str, static_cast(static_cast(*it)), 4); + } + else + { + str += *it; + } + } + } + str.append("\""); + return str; +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/JSObject.cpp b/RemotingNG/REST/src/JSObject.cpp new file mode 100644 index 0000000000..fe338aa9b3 --- /dev/null +++ b/RemotingNG/REST/src/JSObject.cpp @@ -0,0 +1,69 @@ +// +// JSObject.cpp +// +// Library: RemotingNG/REST +// Package: JSValue +// Module: JSObject +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/JSObject.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +JSObject::JSObject() +{ +} + + +JSObject::~JSObject() +{ +} + + +JSValue::Type JSObject::type() const +{ + return JS_OBJECT; +} + + +std::size_t JSObject::size() const +{ + return _map.size(); +} + + +const JSValue::Ptr& JSObject::operator [] (const std::string& name) const +{ + Map::const_iterator it = _map.find(name); + if (it != _map.end()) + return it->second; + else + throw Poco::NotFoundException(name); +} + + +JSValue::Ptr& JSObject::operator [] (const std::string& name) +{ + return _map[name]; +} + + +bool JSObject::has(const std::string& name) const +{ + return _map.find(name) != _map.end(); +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/JSScalar.cpp b/RemotingNG/REST/src/JSScalar.cpp new file mode 100644 index 0000000000..1de3b9927c --- /dev/null +++ b/RemotingNG/REST/src/JSScalar.cpp @@ -0,0 +1,55 @@ +// +// JSScalar.cpp +// +// Library: RemotingNG/REST +// Package: JSValue +// Module: JSScalar +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/JSScalar.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +JSScalar::JSScalar(Type type): + _type(type) +{ +} + + +JSScalar::JSScalar(const std::string& value, Type type): + _value(value), + _type(type) +{ +} + + +JSScalar::~JSScalar() +{ +} + + +JSValue::Type JSScalar::type() const +{ + return _type; +} + + +const std::string& JSScalar::stringValue() const +{ + return _value; +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/JSValue.cpp b/RemotingNG/REST/src/JSValue.cpp new file mode 100644 index 0000000000..a88824accd --- /dev/null +++ b/RemotingNG/REST/src/JSValue.cpp @@ -0,0 +1,68 @@ +// +// JSValue.cpp +// +// Library: RemotingNG/REST +// Package: JSValue +// Module: JSValue +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/JSValue.h" +#include "Poco/Exception.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +std::size_t JSValue::size() const +{ + return 0; +} + + +const std::string& JSValue::stringValue() const +{ + throw Poco::NotImplementedException("Cannot create string representation of non-scalar JSValue"); +} + + +const JSValue::Ptr& JSValue::operator [] (const std::string& name) const +{ + throw Poco::InvalidAccessException("Named value access is only supported for JSObject"); +} + + +JSValue::Ptr& JSValue::operator [] (const std::string& name) +{ + throw Poco::InvalidAccessException("Named value access is only supported for JSObject"); +} + + +const JSValue::Ptr& JSValue::operator [] (std::size_t index) const +{ + throw Poco::InvalidAccessException("Ordered value access is only supported for JSArray"); +} + + +JSValue::Ptr& JSValue::operator [] (std::size_t index) +{ + throw Poco::InvalidAccessException("Ordered value access is only supported for JSArray"); +} + + +bool JSValue::has(const std::string& name) const +{ + return false; +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/Listener.cpp b/RemotingNG/REST/src/Listener.cpp new file mode 100644 index 0000000000..98ae2cca80 --- /dev/null +++ b/RemotingNG/REST/src/Listener.cpp @@ -0,0 +1,165 @@ +// +// Listener.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: Listener +// +// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/Listener.h" +#include "Poco/RemotingNG/REST/Transport.h" +#include "Poco/RemotingNG/REST/RESTRequestHandlerFactory.h" +#include "Poco/Net/HTTPRequestHandlerFactory.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Exception.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +const std::string Listener::CORS_ALLOWED_HEADERS("Accept, Content-Type"); + + +Listener::Listener(const std::string& endPoint, Protocol proto): + Poco::RemotingNG::Listener(endPoint), + _secure(proto == PROTO_HTTPS), + _logServiceExceptions(false), + _enableChunkedTransferEncoding(false), + _enableCompression(true), + _enableCORS(false), + _corsAllowedHeaders(CORS_ALLOWED_HEADERS) +{ +} + + +Listener::Listener(const std::string& endPoint, Poco::Net::HTTPServerParams::Ptr pParams): + Poco::RemotingNG::Listener(endPoint), + _secure(false), + _logServiceExceptions(false), + _enableChunkedTransferEncoding(false), + _enableCompression(true), + _enableCORS(false), + _corsAllowedHeaders(CORS_ALLOWED_HEADERS) +{ + Poco::Net::SocketAddress addr(endPoint); + Poco::Net::ServerSocket socket(addr); + _pHTTPServer = new Poco::Net::HTTPServer(new RESTRequestHandlerFactory(*this), socket, pParams); +} + + +Listener::Listener(const std::string& endPoint, const Poco::Net::ServerSocket& socket, Poco::Net::HTTPServerParams::Ptr pParams): + Poco::RemotingNG::Listener(endPoint), + _secure(socket.secure()), + _logServiceExceptions(false), + _enableChunkedTransferEncoding(false), + _enableCompression(true), + _enableCORS(false), + _corsAllowedHeaders(CORS_ALLOWED_HEADERS) +{ + _pHTTPServer = new Poco::Net::HTTPServer(new RESTRequestHandlerFactory(*this), socket, pParams); +} + + +Listener::~Listener() +{ +} + + +void Listener::enableChunkedTransferEncoding(bool enable) +{ + _enableChunkedTransferEncoding = enable; +} + + +void Listener::enableCompression(bool enable) +{ + _enableCompression = enable; +} + + +void Listener::enableCORS(bool enable) +{ + _enableCORS = enable; +} + + +void Listener::setCORSAllowedOrigin(const std::string& origin) +{ + _corsAllowedOrigin = origin; +} + + +void Listener::setCORSAllowedHeaders(const std::string& headers) +{ + if (headers.find("Content-Type") == std::string::npos) + throw Poco::InvalidArgumentException("CORS allowed headers must include Content-Type"); + + _corsAllowedHeaders = headers; +} + + +void Listener::logServiceExceptions(bool enable) +{ + _logServiceExceptions = enable; +} + + +void Listener::start() +{ + if (_pHTTPServer) _pHTTPServer->start(); +} + + +void Listener::stop() +{ + if (_pHTTPServer) _pHTTPServer->stop(); +} + + +const std::string& Listener::protocol() const +{ + return Transport::PROTOCOL; +} + + +std::string Listener::createURI(const Poco::RemotingNG::Identifiable::TypeId& typeId, const Poco::RemotingNG::Identifiable::ObjectId& objectId) +{ + std::string uri(_secure ? "https://" : "http://"); + uri += endPoint(); + uri += '/'; + uri += protocol(); + uri += '/'; + uri += typeId; + uri += '/'; + uri += objectId; + return uri; +} + + +bool Listener::handlesURI(const std::string& /*uri*/) +{ + return false; +} + + +void Listener::registerObject(Poco::RemotingNG::RemoteObject::Ptr /*pRemoteObject*/, Poco::RemotingNG::Skeleton::Ptr /*pSkeleton*/) +{ +} + + +void Listener::unregisterObject(Poco::RemotingNG::RemoteObject::Ptr /*pRemoteObject*/) +{ +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/PathDeserializer.cpp b/RemotingNG/REST/src/PathDeserializer.cpp new file mode 100644 index 0000000000..333f1c65bb --- /dev/null +++ b/RemotingNG/REST/src/PathDeserializer.cpp @@ -0,0 +1,117 @@ +// +// PathDeserializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: PathDeserializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/PathDeserializer.h" +#include "Poco/RemotingNG/REST/PathSerializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/NumberParser.h" +#include "Poco/Base64Decoder.h" +#include "Poco/URI.h" +#include "Poco/Path.h" +#include "Poco/String.h" +#include +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +PathDeserializer::PathDeserializer(const std::string& pathTemplate, const Poco::Net::HTTPRequest& request) +{ + parsePath(pathTemplate, request); +} + + +PathDeserializer::~PathDeserializer() +{ +} + + +bool PathDeserializer::deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull) +{ + isNull = _values.find(name) == _values.end(); + return !isNull; +} + + +const std::string& PathDeserializer::deserializeData(const std::string& name, bool isMandatory, bool& found) +{ + std::map::const_iterator it = _values.find(name); + if (it != _values.end()) + { + found = true; + return it->second; + } + else if (isMandatory) + { + throw Poco::RemotingNG::MissingParamException(name); + } + else + { + found = false; + return PathSerializer::EMPTY; + } +} + + +void PathDeserializer::parsePath(const std::string& pathTemplate, const Poco::Net::HTTPRequest& request) +{ + Poco::URI uri(request.getURI()); + Poco::Path path(uri.getPath(), Poco::Path::PATH_UNIX); + + // Manually tokenize pathTemplate by '/' to avoid Poco::Path mangling special characters + std::vector templParts; + std::string::size_type start = 0; + if (!pathTemplate.empty() && pathTemplate[0] == '/') start = 1; + while (start < pathTemplate.size()) + { + std::string::size_type end = pathTemplate.find('/', start); + if (end == std::string::npos) end = pathTemplate.size(); + templParts.push_back(pathTemplate.substr(start, end - start)); + start = end + 1; + } + + for (std::size_t i = 0; i < templParts.size(); i++) + { + const std::string& item = templParts[i]; + if (item.size() > 2 && item[0] == '{') + { + // Check for alternation pattern: {name:(option1|option2|...)} + std::size_t colonPos = item.find(':'); + if (colonPos != std::string::npos && colonPos > 1 && colonPos + 1 < item.size() && item[colonPos + 1] == '(') + { + std::string name(item, 1, colonPos - 1); + if (i <= static_cast(path.depth())) + { + _values[name] = path[static_cast(i)]; + } + } + else + { + std::string name(item, 1, item.size() - 2); + if (i <= static_cast(path.depth())) + { + _values[name] = path[static_cast(i)]; + } + } + } + } +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/PathSerializer.cpp b/RemotingNG/REST/src/PathSerializer.cpp new file mode 100644 index 0000000000..84bad21ec1 --- /dev/null +++ b/RemotingNG/REST/src/PathSerializer.cpp @@ -0,0 +1,92 @@ +// +// PathSerializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: PathSerializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/PathSerializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/Base64Encoder.h" +#include "Poco/URI.h" +#include "Poco/Path.h" +#include + + +using namespace std::string_literals; + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +const std::string PathSerializer::EMPTY; + + +PathSerializer::PathSerializer(const std::string& pathTemplate, Poco::Net::HTTPRequest& request): + _pathTemplate(pathTemplate), + _request(request) +{ +} + + +PathSerializer::~PathSerializer() +{ +} + + +void PathSerializer::close() +{ + Poco::URI uri(_request.getURI()); + Poco::Path pathTempl(_pathTemplate, Poco::Path::PATH_UNIX); + Poco::Path path(true); + for (int i = 0; i < pathTempl.depth(); i++) + { + std::string encodedItem; + Poco::URI::encode(replaceItem(pathTempl[i]), "?#"s, encodedItem); + path.pushDirectory(encodedItem); + } + std::string encodedName; + Poco::URI::encode(replaceItem(pathTempl.getFileName()), "?#"s, encodedName); + path.setFileName(encodedName); + uri.setPath(path.toString(Poco::Path::PATH_UNIX)); + _request.setURI(uri.toString()); +} + + +const std::string& PathSerializer::replaceItem(const std::string& item) +{ + std::string::const_iterator it = item.begin(); + std::string::const_iterator end = item.end(); + if (it != end && *it == '{') + { + ++it; + std::string name; + while (it != end && *it != '}') name += *it++; + std::map::const_iterator itm = _values.find(name); + if (itm != _values.end()) + return itm->second; + else + throw Poco::RemotingNG::SerializerException("Missing parameter for path", name); + } + else return item; +} + + +void PathSerializer::serializeData(const std::string& name, const std::string& val) +{ + _values[name] = val; +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/RESTRequestHandler.cpp b/RemotingNG/REST/src/RESTRequestHandler.cpp new file mode 100644 index 0000000000..a6f78bdb18 --- /dev/null +++ b/RemotingNG/REST/src/RESTRequestHandler.cpp @@ -0,0 +1,405 @@ +// +// RESTRequestHandler.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: RESTRequestHandler +// +// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/RESTRequestHandler.h" +#include "Poco/RemotingNG/REST/Serializer.h" +#include "Poco/RemotingNG/REST/Deserializer.h" +#include "Poco/RemotingNG/REST/Transport.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Net/HTTPServerResponse.h" +#include "Poco/Net/HTTPBasicCredentials.h" +#include "Poco/RemotingNG/ORB.h" +#include "Poco/RemotingNG/ServerTransport.h" +#include "Poco/RemotingNG/Context.h" +#include "Poco/StringTokenizer.h" +#include "Poco/StreamCopier.h" +#include "Poco/InflatingStream.h" +#include "Poco/DeflatingStream.h" +#include + + +using namespace std::string_literals; + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +class RESTServerTransport: public Poco::RemotingNG::ServerTransport +{ +public: + RESTServerTransport(Listener& listener, const Credentials& credentials, Poco::Logger& logger): + _listener(listener), + _credentials(credentials), + _logger(logger) + { + } + + bool authenticate(const std::string& /*method*/) + { + Authenticator::Ptr pAuth = _listener.getAuthenticator(); + if (pAuth) + { + return pAuth->authenticate(_credentials).done(); + } + return false; + } + + bool authorize(const std::string& method, const std::string& permission) + { + Authorizer::Ptr pAuth = _listener.getAuthorizer(); + if (pAuth) + { + return pAuth->authorize(method, permission); + } + return false; + } + + void reportException(const std::string& method, const Poco::Exception& exc) + { + if (_listener.areServiceExceptionsLogged()) + { + _logger.error("Exception in %s: %s"s, method, exc.displayText()); + } + } + +private: + const Listener& _listener; + const Credentials& _credentials; + Poco::Logger& _logger; +}; + + + +class ChunkedServerTransport: public RESTServerTransport +{ +public: + ChunkedServerTransport(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response, Listener& listener, const Poco::RemotingNG::Credentials& credentials, Poco::Logger& logger): + RESTServerTransport(listener, credentials, logger), + _request(request), + _response(response), + _enableCompression(listener.isCompressionEnabled()), + _pInflater(0), + _pDeflater(0), + _replySent(false) + { + } + + ~ChunkedServerTransport() + { + delete _pInflater; + delete _pDeflater; + } + + Poco::RemotingNG::Deserializer& beginRequest() + { + if (_request.get("Content-Encoding"s, ""s) == "gzip") + { + _pInflater = new Poco::InflatingInputStream(_request.stream(), Poco::InflatingStreamBuf::STREAM_GZIP); + _deserializer.setup(*_pInflater); + } + else + { + _deserializer.setup(_request.stream()); + } + _deserializer.setRequest(_request); + return _deserializer; + } + + Poco::RemotingNG::Serializer& sendReply(Poco::RemotingNG::SerializerBase::MessageType messageType) + { + // consume extra request content + std::istream& istr = _request.stream(); + int ch = istr.get(); + while (ch != -1) ch = istr.get(); + + if (messageType == Poco::RemotingNG::SerializerBase::MESSAGE_FAULT) + { + _response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_INTERNAL_SERVER_ERROR); + } + + _response.setChunkedTransferEncoding(true); + _response.setContentType(getAttribute(Poco::RemotingNG::SerializerBase::PROP_CONTENT_TYPE, Transport::CONTENT_TYPE)); + bool compressResponse(_enableCompression && _request.hasToken("Accept-Encoding"s, "gzip"s) && messageType != Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + if (compressResponse) + { + _response.set("Content-Encoding"s, "gzip"s); + _pDeflater = new Poco::DeflatingOutputStream(_response.send(), Poco::DeflatingStreamBuf::STREAM_GZIP, 1); + _serializer.setup(*_pDeflater); + _replySent = true; + } + else + { + if (messageType == Poco::RemotingNG::SerializerBase::MESSAGE_FAULT) + { + _serializer.setup(_faultStream); + } + else + { + _serializer.setup(_response.send()); + _replySent = true; + } + } + _serializer.setResponse(_response); + return _serializer; + } + + void endRequest() + { + if (_pDeflater) _pDeflater->close(); + if (!_replySent) // one-way message + { + _replySent = true; + std::ostream& responseStream = _response.send(); + Poco::StreamCopier::copyStream(_faultStream, responseStream); + } + } + +private: + Poco::Net::HTTPServerRequest& _request; + Poco::Net::HTTPServerResponse& _response; + Poco::RemotingNG::REST::Serializer _serializer; + Poco::RemotingNG::REST::Deserializer _deserializer; + bool _enableCompression; + Poco::InflatingInputStream* _pInflater; + Poco::DeflatingOutputStream* _pDeflater; + std::stringstream _faultStream; + bool _replySent; +}; + + +class NonChunkedServerTransport: public RESTServerTransport +{ +public: + NonChunkedServerTransport(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response, Listener& listener, const Poco::RemotingNG::Credentials& credentials, Poco::Logger& logger): + RESTServerTransport(listener, credentials, logger), + _request(request), + _response(response), + _enableCompression(listener.isCompressionEnabled()), + _pInflater(0), + _pDeflater(0) + { + } + + ~NonChunkedServerTransport() + { + delete _pInflater; + delete _pDeflater; + } + + Poco::RemotingNG::Deserializer& beginRequest() + { + if (_request.get("Content-Encoding"s, ""s) == "gzip") + { + _pInflater = new Poco::InflatingInputStream(_request.stream(), Poco::InflatingStreamBuf::STREAM_GZIP); + _deserializer.setup(*_pInflater); + } + else + { + _deserializer.setup(_request.stream()); + } + _deserializer.setRequest(_request); + return _deserializer; + } + + Poco::RemotingNG::Serializer& sendReply(Poco::RemotingNG::SerializerBase::MessageType messageType) + { + // consume extra request content + std::istream& istr = _request.stream(); + int ch = istr.get(); + while (ch != -1) ch = istr.get(); + + if (messageType == Poco::RemotingNG::SerializerBase::MESSAGE_FAULT) + { + _response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_INTERNAL_SERVER_ERROR); + } + + _response.setContentType(getAttribute(Poco::RemotingNG::SerializerBase::PROP_CONTENT_TYPE, Transport::CONTENT_TYPE)); + bool compressResponse(_enableCompression && _request.hasToken("Accept-Encoding"s, "gzip"s) && messageType != Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + if (compressResponse) + { + _response.set("Content-Encoding"s, "gzip"s); + _pDeflater = new Poco::DeflatingOutputStream(_bufferStream, Poco::DeflatingStreamBuf::STREAM_GZIP, 1); + _serializer.setup(*_pDeflater); + } + else + { + _serializer.setup(_bufferStream); + } + _serializer.setResponse(_response); + return _serializer; + } + + void endRequest() + { + if (_pDeflater) _pDeflater->close(); + _response.setContentLength(static_cast(_bufferStream.tellp())); + std::ostream& ostr = _response.send(); + Poco::StreamCopier::copyStream(_bufferStream, ostr); + } + +private: + Poco::Net::HTTPServerRequest& _request; + Poco::Net::HTTPServerResponse& _response; + Poco::RemotingNG::REST::Serializer _serializer; + Poco::RemotingNG::REST::Deserializer _deserializer; + bool _enableCompression; + Poco::InflatingInputStream* _pInflater; + Poco::DeflatingOutputStream* _pDeflater; + std::stringstream _bufferStream; +}; + + +RESTRequestHandler::RESTRequestHandler(Listener& listener): + _listener(listener), + _logger(Poco::Logger::get("RemotingNG.REST.RESTRequestHandler"s)) +{ +} + + +RESTRequestHandler::~RESTRequestHandler() +{ +} + + +void RESTRequestHandler::handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) +{ + if (_logger.debug()) + { + std::string message(request.getMethod()); + message += " "; + message += request.getURI(); + message += " "; + message += request.getVersion(); + message += " from "; + message += request.clientAddress().toString(); + _logger.debug(message); + } + + const std::string& method = request.getMethod(); + if (_listener.isCORSEnabled() && method == Poco::Net::HTTPRequest::HTTP_OPTIONS && request.has("Origin"s)) + { + if (handleCORS(request, response)) + { + response.set("Access-Control-Allow-Methods"s, "HEAD, GET, PUT, POST, PATCH, DELETE"s); + response.set("Access-Control-Allow-Headers"s, _listener.getCORSAllowedHeaders()); + } + response.setContentLength(0); + response.send(); + return; + } + + std::string ce = request.get("Content-Encoding"s, ""s); + if (!ce.empty() && ce != "gzip") + { + response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_UNSUPPORTEDMEDIATYPE); + response.setContentLength(0); + response.send(); + return; + } + + if (_listener.isCORSEnabled() && request.has("Origin"s)) + { + if (!handleCORS(request, response)) + { + response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_METHOD_NOT_ALLOWED); + response.setContentLength(0); + response.send(); + return; + } + } + + Poco::RemotingNG::Credentials credentials; + Poco::RemotingNG::ScopedContext scopedContext; + scopedContext.context()->setValue("transport"s, _listener.protocol()); + scopedContext.context()->setValue("remoteAddress"s, request.clientAddress()); + scopedContext.context()->setValue("localAddress"s, request.serverAddress()); + scopedContext.context()->setValue("uri"s, request.getURI()); + scopedContext.context()->clearCredentials(); + if (request.hasCredentials()) + { + std::string scheme; + std::string authInfo; + request.getCredentials(scheme, authInfo); + if (scheme == Poco::Net::HTTPBasicCredentials::SCHEME) + { + Poco::Net::HTTPBasicCredentials creds(authInfo); + scopedContext.context()->setValue("username"s, creds.getUsername()); + scopedContext.context()->setValue("password"s, creds.getPassword()); + credentials.setAttribute(Credentials::ATTR_USERNAME, creds.getUsername()); + credentials.setAttribute(Credentials::ATTR_PASSWORD, creds.getPassword()); + scopedContext.context()->setCredentials(credentials); + } + else if (scheme == "Bearer") + { + credentials.setAttribute(Credentials::ATTR_MECHANISM, scheme); + credentials.setAttribute(Credentials::ATTR_TOKEN, authInfo); + scopedContext.context()->setCredentials(credentials); + } + } + scopedContext.context()->setValue("httpRequest"s, &request); + scopedContext.context()->setValue("httpResponse"s, &response); + + const std::string& uri = request.getURI(); + Poco::RemotingNG::ORB& orb = Poco::RemotingNG::ORB::instance(); + bool supportsChunked = (_listener.isChunkedTransferEncodingEnabled() && request.getVersion() != Poco::Net::HTTPServerRequest::HTTP_1_0); + if (supportsChunked) + { + ChunkedServerTransport transport(request, response, _listener, credentials, _logger); + bool serviceFound = orb.invoke(_listener, uri, transport); + if (!serviceFound) + { + Poco::NotFoundException exc(request.getURI()); + transport.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT).serializeFaultMessage(""s, exc); + transport.endRequest(); + } + } + else + { + NonChunkedServerTransport transport(request, response, _listener, credentials, _logger); + bool serviceFound = orb.invoke(_listener, uri, transport); + if (!serviceFound) + { + Poco::NotFoundException exc(request.getURI()); + transport.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT).serializeFaultMessage(""s, exc); + transport.endRequest(); + } + } +} + + +bool RESTRequestHandler::handleCORS(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) +{ + const std::string& allowedOrigin = _listener.getCORSAllowedOrigin(); + if (allowedOrigin.empty()) + { + response.set("Access-Control-Allow-Origin"s, request.get("Origin"s)); + response.set("Access-Control-Allow-Credentials"s, "true"s); + return true; + } + else if (allowedOrigin == "*" || allowedOrigin == request.get("Origin"s)) + { + response.set("Access-Control-Allow-Origin"s, allowedOrigin); + response.set("Access-Control-Allow-Credentials"s, "true"s); + return true; + } + return false; +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/RESTRequestHandlerFactory.cpp b/RemotingNG/REST/src/RESTRequestHandlerFactory.cpp new file mode 100644 index 0000000000..c17f0efbf6 --- /dev/null +++ b/RemotingNG/REST/src/RESTRequestHandlerFactory.cpp @@ -0,0 +1,44 @@ +// +// RESTRequestHandlerFactory.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: RESTRequestHandlerFactory +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/RESTRequestHandlerFactory.h" +#include "Poco/RemotingNG/REST/RESTRequestHandler.h" +#include "Poco/Net/HTTPServerRequest.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +RESTRequestHandlerFactory::RESTRequestHandlerFactory(Listener& listener): + _listener(listener) +{ +} + + +RESTRequestHandlerFactory::~RESTRequestHandlerFactory() +{ +} + + +Poco::Net::HTTPRequestHandler* RESTRequestHandlerFactory::createRequestHandler(const Poco::Net::HTTPServerRequest& request) +{ + return new RESTRequestHandler(_listener); +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/RESTServerException.cpp b/RemotingNG/REST/src/RESTServerException.cpp new file mode 100644 index 0000000000..30c7fac3ec --- /dev/null +++ b/RemotingNG/REST/src/RESTServerException.cpp @@ -0,0 +1,112 @@ +// +// RESTServerException.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: RESTServerException +// +// Copyright (c) 2024, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/RESTServerException.h" +#include "Poco/RemotingNG/REST/JSONSerializer.h" + + +using namespace std::string_literals; + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +RESTServerException::RESTServerException(const std::string& reason, int status, JSValue::Ptr pContent): + Poco::RemotingNG::RemoteException(reason, status), + _reason(reason), + _pContent(pContent) +{ +} + + +RESTServerException::RESTServerException(const std::string& reason, const std::string& message, int status, JSValue::Ptr pContent): + Poco::RemotingNG::RemoteException(reason, message, status), + _reason(reason), + _pContent(pContent) +{ +} + + +RESTServerException::RESTServerException(const RESTServerException& exc): + Poco::RemotingNG::RemoteException(exc), + _pContent(exc._pContent) +{ +} + + +RESTServerException::~RESTServerException() noexcept +{ +} + + +RESTServerException& RESTServerException::operator = (const RESTServerException& exc) +{ + if (&exc != this) + { + RemoteException::operator = (exc); + _pContent = exc._pContent; + } + return *this; +} + + +const char* RESTServerException::name() const noexcept +{ + return "REST Server Error"; +} + + +const char* RESTServerException::className() const noexcept +{ + return typeid(*this).name(); +} + + +Poco::Exception* RESTServerException::clone() const +{ + return new RESTServerException(*this); +} + + +void RESTServerException::rethrow() const +{ + throw *this; +} + + +std::string RESTServerException::error() const +{ + if (_pContent->has(JSONSerializer::JSON_ERROR)) + { + return (*_pContent)[JSONSerializer::JSON_ERROR]->stringValue(); + } + else return ""s; +} + + +std::string RESTServerException::detail() const +{ + if (_pContent->has(JSONSerializer::JSON_DETAIL)) + { + return (*_pContent)[JSONSerializer::JSON_DETAIL]->stringValue(); + } + else return ""s; +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/RawDeserializer.cpp b/RemotingNG/REST/src/RawDeserializer.cpp new file mode 100644 index 0000000000..bfce9c5778 --- /dev/null +++ b/RemotingNG/REST/src/RawDeserializer.cpp @@ -0,0 +1,336 @@ +// +// RawDeserializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: RawDeserializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/RawDeserializer.h" +#include "Poco/RemotingNG/REST/RawSerializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/NumberParser.h" +#include "Poco/StreamCopier.h" +#include "Poco/String.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +RawDeserializer::RawDeserializer(std::istream& stream): + _pStream(&stream) +{ +} + + +RawDeserializer::~RawDeserializer() +{ +} + + +Poco::RemotingNG::SerializerBase::MessageType RawDeserializer::findMessage(std::string&) +{ + poco_bugcheck(); + return Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST; +} + + +void RawDeserializer::deserializeMessageBegin(const std::string&, SerializerBase::MessageType) +{ + poco_bugcheck(); +} + + +void RawDeserializer::deserializeMessageEnd(const std::string& name, SerializerBase::MessageType type) +{ + poco_bugcheck(); +} + + +bool RawDeserializer::deserializeStructBegin(const std::string& name, bool isMandatory) +{ + throw Poco::RemotingNG::DeserializerException("Cannot deserialize a structure using raw format"); +} + + +void RawDeserializer::deserializeStructEnd(const std::string& name) +{ +} + + +bool RawDeserializer::deserializeSequenceBegin(const std::string& name, bool isMandatory, Poco::UInt32& sizeHint) +{ + throw Poco::RemotingNG::DeserializerException("Cannot deserialize a sequence using raw format"); +} + + +void RawDeserializer::deserializeSequenceEnd(const std::string& name) +{ +} + + +bool RawDeserializer::deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull) +{ + return false; +} + + +void RawDeserializer::deserializeNullableEnd(const std::string& name) +{ +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int8& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = static_cast(Poco::NumberParser::parse(strVal)); + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt8& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = static_cast(Poco::NumberParser::parseUnsigned(strVal)); + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int16& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = static_cast(Poco::NumberParser::parse(strVal)); + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt16& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = static_cast(Poco::NumberParser::parseUnsigned(strVal)); + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int32& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = Poco::NumberParser::parse(strVal); + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt32& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = Poco::NumberParser::parseUnsigned(strVal); + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, long& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { +#ifndef POCO_INT64_IS_LONG + val = Poco::NumberParser::parse(strVal); +#else + val = Poco::NumberParser::parse64(strVal); +#endif + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, unsigned long& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { +#ifndef POCO_INT64_IS_LONG + val = Poco::NumberParser::parseUnsigned(strVal); +#else + val = Poco::NumberParser::parseUnsigned64(strVal); +#endif + } + return ret; +} + + +#ifndef POCO_INT64_IS_LONG +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int64& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = Poco::NumberParser::parse64(strVal); + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt64& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = Poco::NumberParser::parseUnsigned64(strVal); + } + return ret; +} +#endif + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, float& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = (float)Poco::NumberParser::parseFloat(strVal); + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, double& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = Poco::NumberParser::parseFloat(strVal); + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, bool& val) +{ + // parse for true/1 or false/0 + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + if (Poco::icompare(strVal, RawSerializer::VAL_FALSE) == 0 || strVal == "0") + val = false; + else if (Poco::icompare(strVal, RawSerializer::VAL_TRUE) == 0 || strVal == "1") + val = true; + else + { + reset(); + throw Poco::RemotingNG::DeserializerException("Illegal bool value ", strVal); + } + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, char& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + if (strVal.size() != 1) + { + reset(); + throw Poco::RemotingNG::DeserializerException("Illegal char value ", strVal); + } + val = strVal[0]; + } + return ret; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, std::string& val) +{ + poco_check_ptr (_pStream); + + val.clear(); + Poco::StreamCopier::copyToString(*_pStream, val); + return true; +} + + +bool RawDeserializer::deserialize(const std::string& name, bool isMandatory, std::vector& val) +{ + poco_check_ptr (_pStream); + + val.clear(); + int ch = _pStream->get(); + while (ch != -1) + { + val.push_back(static_cast(ch)); + ch = _pStream->get(); + } + return !val.empty(); +} + + +const std::string& RawDeserializer::deserializeData(const std::string& name, bool isMandatory, bool& found) +{ + poco_check_ptr (_pStream); + + _data.clear(); + Poco::StreamCopier::copyToString(*_pStream, _data); + found = !_data.empty(); + return _data; +} + + +void RawDeserializer::resetImpl() +{ + _data.clear(); + _pStream = 0; +} + + +void RawDeserializer::setupImpl(std::istream& stream) +{ + resetImpl(); + _pStream = &stream; +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/RawSerializer.cpp b/RemotingNG/REST/src/RawSerializer.cpp new file mode 100644 index 0000000000..8ed2da0130 --- /dev/null +++ b/RemotingNG/REST/src/RawSerializer.cpp @@ -0,0 +1,217 @@ +// +// RawSerializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: RawSerializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/RawSerializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +const std::string RawSerializer::VAL_TRUE("true"); +const std::string RawSerializer::VAL_FALSE("false"); + + +RawSerializer::RawSerializer(std::ostream& stream): + _pStream(&stream) +{ +} + + +RawSerializer::~RawSerializer() +{ +} + + +void RawSerializer::serializeMessageBegin(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type) +{ + poco_bugcheck(); +} + + +void RawSerializer::serializeMessageEnd(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type) +{ + poco_bugcheck(); +} + + +void RawSerializer::serializeFaultMessage(const std::string& methodName, const Poco::Exception& /* e */) +{ + poco_bugcheck(); +} + + +void RawSerializer::serializeStructBegin(const std::string& name) +{ + throw Poco::RemotingNG::SerializerException("Cannot serialize a structure using raw format"); +} + + +void RawSerializer::serializeStructEnd(const std::string& name) +{ + poco_bugcheck(); +} + + +void RawSerializer::serializeSequenceBegin(const std::string& name, Poco::UInt32 numElems) +{ + throw Poco::RemotingNG::SerializerException("Cannot serialize a sequence using raw format"); +} + + +void RawSerializer::serializeSequenceEnd(const std::string& name) +{ + poco_bugcheck(); +} + + +void RawSerializer::serializeNullableBegin(const std::string& name, bool isNull) +{ +} + + +void RawSerializer::serializeNullableEnd(const std::string&) +{ +} + + +void RawSerializer::serialize(const std::string& name, Poco::Int8 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void RawSerializer::serialize(const std::string& name, Poco::UInt8 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void RawSerializer::serialize(const std::string& name, Poco::Int16 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void RawSerializer::serialize(const std::string& name, Poco::UInt16 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void RawSerializer::serialize(const std::string& name, Poco::Int32 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void RawSerializer::serialize(const std::string& name, Poco::UInt32 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void RawSerializer::serialize(const std::string& name, long val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void RawSerializer::serialize(const std::string& name, unsigned long val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +#ifndef POCO_INT64_IS_LONG +void RawSerializer::serialize(const std::string& name, Poco::Int64 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void RawSerializer::serialize(const std::string& name, Poco::UInt64 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} +#endif + + +void RawSerializer::serialize(const std::string& name, float val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void RawSerializer::serialize(const std::string& name, double val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void RawSerializer::serialize(const std::string& name, bool val) +{ + serializeData(name, val? VAL_TRUE : VAL_FALSE); +} + + +void RawSerializer::serialize(const std::string& name, const std::string& val) +{ + serializeData(name, val); +} + + +void RawSerializer::serialize(const std::string& name, char val) +{ + std::string tmp; + tmp += val; + serializeData(name, tmp); +} + + +void RawSerializer::serialize(const std::string& name, const std::vector& val) +{ + poco_check_ptr (_pStream); + + _pStream->write(&val[0], static_cast(val.size())); +} + + +void RawSerializer::serializeData(const std::string& name, const std::string& val) +{ + poco_check_ptr (_pStream); + + _pStream->write(val.data(), static_cast(val.size())); +} + + +void RawSerializer::setupImpl(std::ostream& stream) +{ + resetImpl(); + _pStream = &stream; +} + + +void RawSerializer::resetImpl() +{ + _pStream = 0; +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/ScalarDeserializer.cpp b/RemotingNG/REST/src/ScalarDeserializer.cpp new file mode 100644 index 0000000000..0a3abb1730 --- /dev/null +++ b/RemotingNG/REST/src/ScalarDeserializer.cpp @@ -0,0 +1,333 @@ +// +// ScalarDeserializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: ScalarDeserializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/ScalarDeserializer.h" +#include "Poco/RemotingNG/REST/ScalarSerializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/NumberParser.h" +#include "Poco/Base64Decoder.h" +#include "Poco/String.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +ScalarDeserializer::ScalarDeserializer() +{ +} + + +ScalarDeserializer::~ScalarDeserializer() +{ +} + + +Poco::RemotingNG::SerializerBase::MessageType ScalarDeserializer::findMessage(std::string&) +{ + poco_bugcheck(); + return Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST; +} + + +void ScalarDeserializer::deserializeMessageBegin(const std::string&, SerializerBase::MessageType) +{ + poco_bugcheck(); +} + + +void ScalarDeserializer::deserializeMessageEnd(const std::string& name, SerializerBase::MessageType type) +{ + poco_bugcheck(); +} + + +bool ScalarDeserializer::deserializeStructBegin(const std::string& name, bool isMandatory) +{ + throw Poco::RemotingNG::DeserializerException("Cannot deserialize a structure from a header, form or path"); +} + + +void ScalarDeserializer::deserializeStructEnd(const std::string& name) +{ +} + + +bool ScalarDeserializer::deserializeSequenceBegin(const std::string& name, bool isMandatory, Poco::UInt32& sizeHint) +{ + throw Poco::RemotingNG::DeserializerException("Cannot deserialize a sequence from a header, form or path"); +} + + +void ScalarDeserializer::deserializeSequenceEnd(const std::string& name) +{ +} + + +bool ScalarDeserializer::deserializeNullableBegin(const std::string& name, bool isMandatory, bool& isNull) +{ + return false; +} + + +void ScalarDeserializer::deserializeNullableEnd(const std::string& name) +{ +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int8& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = static_cast(Poco::NumberParser::parse(strVal)); + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt8& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = static_cast(Poco::NumberParser::parseUnsigned(strVal)); + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int16& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = static_cast(Poco::NumberParser::parse(strVal)); + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt16& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = static_cast(Poco::NumberParser::parseUnsigned(strVal)); + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int32& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = Poco::NumberParser::parse(strVal); + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt32& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = Poco::NumberParser::parseUnsigned(strVal); + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, long& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { +#ifndef POCO_INT64_IS_LONG + val = Poco::NumberParser::parse(strVal); +#else + val = Poco::NumberParser::parse64(strVal); +#endif + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, unsigned long& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { +#ifndef POCO_INT64_IS_LONG + val = Poco::NumberParser::parseUnsigned(strVal); +#else + val = Poco::NumberParser::parseUnsigned64(strVal); +#endif + } + return ret; +} + + +#ifndef POCO_INT64_IS_LONG +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::Int64& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = Poco::NumberParser::parse64(strVal); + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, Poco::UInt64& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = Poco::NumberParser::parseUnsigned64(strVal); + } + return ret; +} +#endif + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, float& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = (float)Poco::NumberParser::parseFloat(strVal); + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, double& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = Poco::NumberParser::parseFloat(strVal); + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, bool& val) +{ + // parse for true/1 or false/0 + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + if (Poco::icompare(strVal, ScalarSerializer::VAL_FALSE) == 0 || strVal == "0") + val = false; + else if (Poco::icompare(strVal, ScalarSerializer::VAL_TRUE) == 0 || strVal == "1") + val = true; + else + { + reset(); + throw Poco::RemotingNG::DeserializerException("Illegal bool value ", strVal); + } + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, char& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + if (strVal.size() != 1) + { + reset(); + throw Poco::RemotingNG::DeserializerException("Illegal char value ", strVal); + } + val = strVal[0]; + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, std::string& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + val = strVal; + } + return ret; +} + + +bool ScalarDeserializer::deserialize(const std::string& name, bool isMandatory, std::vector& val) +{ + return deserializeBuffer(name, isMandatory, val); +} + + +bool ScalarDeserializer::deserializeBuffer(const std::string& name, bool isMandatory, std::vector& val) +{ + bool ret = false; + const std::string& strVal = deserializeData(name, isMandatory, ret); + if (ret) + { + std::istringstream istr(strVal); + Poco::Base64Decoder decoder(istr); + val.clear(); + int ch = decoder.get(); + while (ch != -1) + { + val.push_back(static_cast(ch)); + ch = decoder.get(); + } + } + return ret; +} + + +void ScalarDeserializer::resetImpl() +{ +} + + +void ScalarDeserializer::setupImpl(std::istream&) +{ +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/ScalarSerializer.cpp b/RemotingNG/REST/src/ScalarSerializer.cpp new file mode 100644 index 0000000000..2dc936b68e --- /dev/null +++ b/RemotingNG/REST/src/ScalarSerializer.cpp @@ -0,0 +1,214 @@ +// +// ScalarSerializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: ScalarSerializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/ScalarSerializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/Base64Encoder.h" +#include + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +const std::string ScalarSerializer::VAL_TRUE("true"); +const std::string ScalarSerializer::VAL_FALSE("false"); + + +ScalarSerializer::ScalarSerializer() +{ +} + + +ScalarSerializer::~ScalarSerializer() +{ +} + + +void ScalarSerializer::serializeMessageBegin(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type) +{ + poco_bugcheck(); +} + + +void ScalarSerializer::serializeMessageEnd(const std::string& name, Poco::RemotingNG::SerializerBase::MessageType type) +{ + poco_bugcheck(); +} + + +void ScalarSerializer::serializeFaultMessage(const std::string& methodName, const Poco::Exception& /* e */) +{ + poco_bugcheck(); +} + + +void ScalarSerializer::serializeStructBegin(const std::string& name) +{ + throw Poco::RemotingNG::SerializerException("Cannot serialize a structure to a header, form or path"); +} + + +void ScalarSerializer::serializeStructEnd(const std::string& name) +{ + poco_bugcheck(); +} + + +void ScalarSerializer::serializeSequenceBegin(const std::string& name, Poco::UInt32 numElems) +{ + throw Poco::RemotingNG::SerializerException("Cannot serialize a sequence to a header, form or path"); +} + + +void ScalarSerializer::serializeSequenceEnd(const std::string& name) +{ + poco_bugcheck(); +} + + +void ScalarSerializer::serializeNullableBegin(const std::string& name, bool isNull) +{ +} + + +void ScalarSerializer::serializeNullableEnd(const std::string&) +{ +} + + +void ScalarSerializer::serialize(const std::string& name, Poco::Int8 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void ScalarSerializer::serialize(const std::string& name, Poco::UInt8 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void ScalarSerializer::serialize(const std::string& name, Poco::Int16 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void ScalarSerializer::serialize(const std::string& name, Poco::UInt16 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void ScalarSerializer::serialize(const std::string& name, Poco::Int32 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void ScalarSerializer::serialize(const std::string& name, Poco::UInt32 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void ScalarSerializer::serialize(const std::string& name, long val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void ScalarSerializer::serialize(const std::string& name, unsigned long val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +#ifndef POCO_INT64_IS_LONG +void ScalarSerializer::serialize(const std::string& name, Poco::Int64 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void ScalarSerializer::serialize(const std::string& name, Poco::UInt64 val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} +#endif + + +void ScalarSerializer::serialize(const std::string& name, float val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void ScalarSerializer::serialize(const std::string& name, double val) +{ + serializeData(name, Poco::NumberFormatter::format(val)); +} + + +void ScalarSerializer::serialize(const std::string& name, bool val) +{ + serializeData(name, val? VAL_TRUE : VAL_FALSE); +} + + +void ScalarSerializer::serialize(const std::string& name, const std::string& val) +{ + serializeData(name, val); +} + + +void ScalarSerializer::serialize(const std::string& name, char val) +{ + std::string tmp; + tmp += val; + serializeData(name, tmp); +} + + +void ScalarSerializer::serialize(const std::string& name, const std::vector& val) +{ + serializeBuffer(name, val); +} + + +void ScalarSerializer::serializeBuffer(const std::string& name, const std::vector& val) +{ + std::stringstream base64; + Poco::Base64Encoder encoder(base64); + encoder.write(&val[0], static_cast(val.size())); + encoder.close(); + serializeData(name, base64.str()); +} + + +void ScalarSerializer::setupImpl(std::ostream&) +{ +} + + +void ScalarSerializer::resetImpl() +{ +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/Serializer.cpp b/RemotingNG/REST/src/Serializer.cpp new file mode 100644 index 0000000000..b1ba17290a --- /dev/null +++ b/RemotingNG/REST/src/Serializer.cpp @@ -0,0 +1,395 @@ +// +// Serializer.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: Serializer +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/Serializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/Net/NetException.h" +#include "Poco/Base64Encoder.h" + + +using namespace std::string_literals; + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +const std::string Serializer::LOCATION_PATH("path"); +const std::string Serializer::LOCATION_QUERY("query"); +const std::string Serializer::LOCATION_HEADER("header"); +const std::string Serializer::LOCATION_BODY("body"); +const std::string Serializer::LOCATION_FORM("form"); +const std::string Serializer::FORMAT_RAW("raw"); +const std::string Serializer::FORMAT_BINARY("binary"); +const std::string Serializer::FORMAT_JSON("json"); + + +Serializer::Serializer(): + _pStream(0), + _pRequest(0), + _pResponse(0) +{ +} + + +Serializer::~Serializer() +{ +} + + +void Serializer::serializeMessageBegin(const std::string&, Poco::RemotingNG::SerializerBase::MessageType type) +{ + poco_assert_dbg(_pStream); + + switch (type) + { + case Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST: + case Poco::RemotingNG::SerializerBase::MESSAGE_REPLY: + break; + + default: + poco_bugcheck(); + } +} + + +void Serializer::serializeMessageEnd(const std::string&, Poco::RemotingNG::SerializerBase::MessageType type) +{ + poco_assert_dbg(_pStream); + + switch (type) + { + case Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST: + if (_pPathSerializer) + _pPathSerializer->close(); + if (_pQuerySerializer) + _pQuerySerializer->close(); + // fallthrough + + case Poco::RemotingNG::SerializerBase::MESSAGE_REPLY: + if (_pFormSerializer) + _pFormSerializer->close(); + _pStream->flush(); + _pStream = 0; + break; + + default: + poco_bugcheck(); + } +} + + +void Serializer::serializeFaultMessage(const std::string& methodName, const Poco::Exception& e) +{ + poco_assert_dbg(_pStream); + poco_assert_dbg(_pResponse); + + _pResponse->setContentType("application/json"s); + try + { + e.rethrow(); + } + catch (Poco::RemotingNG::MethodNotFoundException&) + { + _pResponse->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_METHOD_NOT_ALLOWED); + } + catch (Poco::Net::HTTPException&) + { + _pResponse->setStatusAndReason(static_cast(e.code())); + } + catch (Poco::RemotingNG::AuthenticationFailedException&) + { + _pResponse->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_UNAUTHORIZED); + } + catch (Poco::RemotingNG::NoPermissionException&) + { + _pResponse->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_FORBIDDEN); + } + catch (Poco::NoPermissionException&) + { + _pResponse->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_FORBIDDEN); + } + catch (Poco::NotFoundException&) + { + _pResponse->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_NOT_FOUND); + } + catch (Poco::ExistsException&) + { + _pResponse->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_CONFLICT); + } + catch (Poco::InvalidArgumentException&) + { + _pResponse->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_BAD_REQUEST); + } + catch (Poco::NotImplementedException&) + { + _pResponse->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_NOT_IMPLEMENTED); + } + catch (Poco::Exception&) + { + _pResponse->setStatusAndReason(Poco::Net::HTTPResponse::HTTP_INTERNAL_SERVER_ERROR); + } + JSONSerializer serializer(*_pStream); + serializer.serializeFaultMessage(methodName, e); + _pStream->flush(); +} + + +void Serializer::serializeStructBegin(const std::string& name) +{ + subSerializer()->serializeStructBegin(name); +} + + +void Serializer::serializeStructEnd(const std::string& name) +{ + subSerializer()->serializeStructEnd(name); +} + + +void Serializer::serializeSequenceBegin(const std::string& name, Poco::UInt32 numElems) +{ + subSerializer()->serializeSequenceBegin(name, numElems); +} + + +void Serializer::serializeSequenceEnd(const std::string& name) +{ + subSerializer()->serializeSequenceEnd(name); +} + + +void Serializer::serializeNullableBegin(const std::string& name, bool isNull) +{ + subSerializer()->serializeNullableBegin(name, isNull); +} + + +void Serializer::serializeNullableEnd(const std::string& name) +{ + subSerializer()->serializeNullableEnd(name); +} + + +void Serializer::serializeOptionalBegin(const std::string& name, bool isSpecified) +{ + subSerializer()->serializeOptionalBegin(name, isSpecified); +} + + +void Serializer::serializeOptionalEnd(const std::string& name) +{ + subSerializer()->serializeOptionalEnd(name); +} + + +void Serializer::serialize(const std::string& name, Poco::Int8 val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, Poco::UInt8 val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, Poco::Int16 val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, Poco::UInt16 val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, Poco::Int32 val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, Poco::UInt32 val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, long val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, unsigned long val) +{ + subSerializer()->serialize(name, val); +} + + +#ifndef POCO_INT64_IS_LONG +void Serializer::serialize(const std::string& name, Poco::Int64 val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, Poco::UInt64 val) +{ + subSerializer()->serialize(name, val); +} +#endif + + +void Serializer::serialize(const std::string& name, float val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, double val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, bool val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, char val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, const std::vector& val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::serialize(const std::string& name, const std::string& val) +{ + subSerializer()->serialize(name, val); +} + + +void Serializer::setupImpl(std::ostream& stream) +{ + resetImpl(); + _pStream = &stream; +} + + +void Serializer::resetImpl() +{ + _pRequest = 0; + _pResponse = 0; + _pPathSerializer = 0; + _pQuerySerializer = 0; + _pHeaderSerializer = 0; + _pRawSerializer = 0; + _pJSONSerializer = 0; + _pFormSerializer = 0; +} + + +Poco::SharedPtr Serializer::subSerializer() +{ + std::string location = getProperty(PROP_LOCATION, LOCATION_BODY); + std::string format = getProperty(PROP_FORMAT, FORMAT_JSON); + if (location == LOCATION_PATH) + { + if (!_pPathSerializer) + { + if (!_pRequest) throw Poco::RemotingNG::SerializerException("Location 'path' can be used in request only"); + _pPathSerializer = new PathSerializer(getProperty(PROP_PATH, ""s), *_pRequest); + } + return _pPathSerializer; + } + else if (location == LOCATION_QUERY) + { + if (!_pQuerySerializer) + { + if (!_pRequest) throw Poco::RemotingNG::SerializerException("Location 'query' can be used in request only"); + _pQuerySerializer = new FormSerializer(*_pRequest); + } + return _pQuerySerializer; + } + else if (location == LOCATION_HEADER) + { + if (!_pHeaderSerializer) + { + if (_pRequest) + _pHeaderSerializer = new HeaderSerializer(*_pRequest); + else if (_pResponse) + _pHeaderSerializer = new HeaderSerializer(*_pResponse); + else + throw Poco::IllegalStateException("No request or response object available"); + } + return _pHeaderSerializer; + } + else if (location == LOCATION_BODY) + { + if (format == FORMAT_RAW || format == FORMAT_BINARY) + { + if (_pJSONSerializer) throw Poco::RemotingNG::SerializerException("Cannot use body formats 'raw' and 'json' simultaneously"); + if (_pFormSerializer) throw Poco::RemotingNG::SerializerException("Cannot use locations 'form' and 'body' simultaneously"); + if (!_pRawSerializer) + { + _pRawSerializer = new RawSerializer(*_pStream); + } + return _pRawSerializer; + } + else if (format == FORMAT_JSON) + { + if (_pRawSerializer) throw Poco::RemotingNG::SerializerException("Cannot use body formats 'raw' and 'json' simultaneously"); + if (_pFormSerializer) throw Poco::RemotingNG::SerializerException("Cannot use locations 'form' and 'body' simultaneously"); + if (!_pJSONSerializer) + { + _pJSONSerializer = new JSONSerializer(*_pStream); + } + return _pJSONSerializer; + } + else throw Poco::RemotingNG::SerializerException("Unsupported format", format); + } + else if (location == LOCATION_FORM) + { + if (_pRawSerializer || _pJSONSerializer) throw Poco::RemotingNG::SerializerException("Cannot use locations 'form' and 'body' simultaneously"); + if (!_pFormSerializer) + { + if (_pRequest) + _pFormSerializer = new FormSerializer(*_pRequest, *_pStream); + else if (_pResponse) + _pFormSerializer = new FormSerializer(*_pResponse, *_pStream); + else + throw Poco::IllegalStateException("No request or response object available"); + } + return _pFormSerializer; + } + else throw Poco::RemotingNG::SerializerException("Invalid location", location); +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/Transport.cpp b/RemotingNG/REST/src/Transport.cpp new file mode 100644 index 0000000000..75618af6c3 --- /dev/null +++ b/RemotingNG/REST/src/Transport.cpp @@ -0,0 +1,481 @@ +// +// Transport.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: Transport +// +// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/Transport.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/Net/HTTPRequest.h" +#include "Poco/Net/HTTPResponse.h" +#include "Poco/Net/HTTPSessionFactory.h" +#include "Poco/Net/HTTPBasicCredentials.h" +#include "Poco/Net/OAuth20Credentials.h" +#include "Poco/NullStream.h" +#include "Poco/InflatingStream.h" +#include "Poco/DeflatingStream.h" +#include "Poco/StreamCopier.h" +#include "Poco/NumberFormatter.h" +#include "Poco/String.h" + + +using namespace std::string_literals; + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +const std::string Transport::PROTOCOL("rest"); +const std::string Transport::USER_AGENT("User-Agent"); +const std::string Transport::CONTENT_TYPE("application/json; charset=\"utf-8\""); +const std::string Transport::BEARER("Bearer"); +const std::string Transport::EMPTY; + + +Poco::Net::HTTPSessionFactory Transport::_httpSessionFactory; + + +Transport::Transport(): + _keepAlive(false), + _compression(false), + _authMode(AUTH_NONE), + _pCookieStore(new CookieStore) +{ +} + + +Transport::~Transport() +{ +} + + +Poco::Timespan Transport::getTimeout() const +{ + return requireSession().getTimeout(); +} + + +void Transport::setTimeout(const Poco::Timespan& timeout) +{ + requireSession().setTimeout(timeout); +} + + +bool Transport::isKeepAliveEnabled() const +{ + return _keepAlive; +} + + +void Transport::enableKeepAlive(bool enable) +{ + requireSession().setKeepAlive(enable); + _keepAlive = enable; +} + + +Poco::Timespan Transport::getKeepAliveTimeout() const +{ + return requireSession().getKeepAliveTimeout(); +} + + +void Transport::setKeepAliveTimeout(const Poco::Timespan& timeout) +{ + requireSession().setKeepAliveTimeout(timeout); +} + + +bool Transport::isCompressionEnabled() const +{ + return _compression; +} + + +void Transport::enableCompression(bool enable) +{ + _compression = enable; +} + + +void Transport::setAuthentication(AuthMode mode) +{ + _authMode = mode; +} + + +Transport::AuthMode Transport::getAuthentication() const +{ + return _authMode; +} + + +void Transport::setUsername(const std::string& username) +{ + _creds.setAttribute(Credentials::ATTR_USERNAME, username); +} + + +const std::string& Transport::getUsername() const +{ + return _creds.getAttribute(Credentials::ATTR_USERNAME, EMPTY); +} + + +void Transport::setPassword( const std::string& password) +{ + _creds.setAttribute(Credentials::ATTR_PASSWORD, password); +} + + +const std::string& Transport::getPassword() const +{ + return _creds.getAttribute(Credentials::ATTR_PASSWORD, EMPTY); +} + + +void Transport::setCredentials(const Poco::RemotingNG::Credentials& creds) +{ + _creds = creds; +} + + +const std::string& Transport::getUserAgent() const +{ + return _userAgent; +} + + +void Transport::setUserAgent(const std::string& userAgent) +{ + _userAgent = userAgent; +} + + +void Transport::setCustomHeader(const std::string& name, const std::string& value) +{ + _customHeaders[name] = value; +} + + +void Transport::removeCustomHeader(const std::string& name) +{ + _customHeaders.erase(name); +} + + +bool Transport::hasCustomHeader(const std::string& name) const +{ + return _customHeaders.find(name) != _customHeaders.end(); +} + + +const std::string& Transport::getCustomHeader(const std::string& name) const +{ + const auto it = _customHeaders.find(name); + if (it != _customHeaders.end()) + return it->second; + else + throw Poco::NotFoundException(name); +} + + +void Transport::setProxyConfig(const Poco::Net::ProxyConfig& proxyConfig) +{ + _proxyConfig = proxyConfig; +} + + +const Poco::Net::ProxyConfig& Transport::getProxyConfig() const +{ + return _proxyConfig; +} + + +CookieStore::Ptr Transport::getCookieStore() const +{ + return _pCookieStore; +} + + +void Transport::setCookieStore(CookieStore::Ptr pCookieStore) +{ + _pCookieStore = pCookieStore; +} + + +const std::string& Transport::endPoint() const +{ + return _endPoint; +} + + +void Transport::connect(const std::string& endPoint) +{ + _endPoint = endPoint; + _endPointURI = endPoint; + _pSession = _httpSessionFactory.createClientSession(_endPointURI); + _pSession->setKeepAlive(_keepAlive); + if (!_proxyConfig.host.empty()) + { + _pSession->setProxyConfig(_proxyConfig); + } +} + + +void Transport::disconnect() +{ + _pSession = 0; + _endPoint.clear(); + _endPointURI.clear(); +} + + +bool Transport::connected() const +{ + return !_pSession.isNull(); +} + + +Poco::RemotingNG::Serializer& Transport::beginMessage(const Poco::RemotingNG::Identifiable::ObjectId& oid, const Poco::RemotingNG::Identifiable::TypeId& tid, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType) +{ + return beginRequest(oid, tid, messageName, messageType); +} + + +void Transport::sendMessage(const Poco::RemotingNG::Identifiable::ObjectId& /*oid*/, const Poco::RemotingNG::Identifiable::TypeId& /*tid*/, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType /*messageType*/) +{ + _pDeflater = 0; + _pRequest->setContentLength(static_cast(_pStream->tellp())); + std::ostream& requestStream = _pSession->sendRequest(*_pRequest); + if (_pDeflater) _pDeflater->close(); + Poco::StreamCopier::copyStream(*_pStream, requestStream); + + _pResponse = new Poco::Net::HTTPResponse; + std::istream& istr = _pSession->receiveResponse(*_pResponse); + if (_pCookieStore) + { + _pCookieStore->updateCookies(*_pResponse); + } + Poco::NullOutputStream ostr; + Poco::StreamCopier::copyStream(istr, ostr); +} + + +Poco::RemotingNG::Serializer& Transport::beginRequest(const Poco::RemotingNG::Identifiable::ObjectId& /*oid*/, const Poco::RemotingNG::Identifiable::TypeId& /*tid*/, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType messageType) +{ + if (messageType == Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST) + { + _pRequest = new Poco::Net::HTTPRequest(Poco::Net::HTTPRequest::HTTP_POST, _endPointURI.getPathEtc(), Poco::Net::HTTPMessage::HTTP_1_1); + prepareRequest(messageName); + + _pStream = new std::stringstream; + if (_compression) + { + _pDeflater = new Poco::DeflatingOutputStream(*_pStream, Poco::DeflatingStreamBuf::STREAM_GZIP, 1); + _serializer.setup(*_pDeflater); + } + else + { + _serializer.setup(*_pStream); + } + _serializer.setRequest(*_pRequest); + + return _serializer; + } + else + { + poco_bugcheck(); + throw Poco::BugcheckException(); + } +} + + +Poco::RemotingNG::Deserializer& Transport::sendRequest(const Poco::RemotingNG::Identifiable::ObjectId& /*oid*/, const Poco::RemotingNG::Identifiable::TypeId& /*tid*/, const std::string& messageName, Poco::RemotingNG::SerializerBase::MessageType /*messageType*/) +{ + _pDeflater = 0; + std::istream* pResponseStream; + + _pResponse = new Poco::Net::HTTPResponse; + _pRequest->setContentLength(static_cast(_pStream->tellp())); + std::ostream& requestStream = _pSession->sendRequest(*_pRequest); + if (_pDeflater) _pDeflater->close(); + Poco::StreamCopier::copyStream(*_pStream, requestStream); + pResponseStream = &_pSession->receiveResponse(*_pResponse); + + if (_pResponse->getStatus() == Poco::Net::HTTPResponse::HTTP_UNAUTHORIZED && (_authMode == AUTH_DIGEST || _authMode == AUTH_ANY)) + { + Poco::NullOutputStream nullStream; + Poco::StreamCopier::copyStream(*pResponseStream, nullStream); + + _httpCreds.authenticate(*_pRequest, *_pResponse); + std::ostream& requestStream = _pSession->sendRequest(*_pRequest); + _pStream->clear(); + _pStream->seekg(0); + Poco::StreamCopier::copyStream(*_pStream, requestStream); + pResponseStream = &_pSession->receiveResponse(*_pResponse); + } + if (_pCookieStore) + { + _pCookieStore->updateCookies(*_pResponse); + } + if (_pResponse->getStatus() < 400) + { + if (_pResponse->get("Content-Encoding"s, ""s) == "gzip") + { + _pInflater = new Poco::InflatingInputStream(*pResponseStream, Poco::InflatingStreamBuf::STREAM_GZIP); + _deserializer.setup(*_pInflater); + } + else + { + _deserializer.setup(*pResponseStream); + } + _deserializer.setResponse(*_pResponse); + + return _deserializer; + } + else + { + std::string jsonError; + if (_pResponse->get("Content-Encoding"s, ""s) == "gzip") + { + Poco::InflatingInputStream inflater(*pResponseStream, Poco::InflatingStreamBuf::STREAM_GZIP); + Poco::StreamCopier::copyToString(inflater, jsonError); + } + else + { + Poco::StreamCopier::copyToString(*pResponseStream, jsonError); + } + try + { + if (jsonError.empty() || _pResponse->getContentType().compare(0, 16, "application/json"s) != 0) + { + throw Poco::RemotingNG::TransportException("HTTP Error", _pResponse->getReason(), static_cast(_pResponse->getStatus())); + } + else + { + std::istringstream istr(jsonError); + JSONDeserializer deser(istr); + deser.deserializeError(_pResponse->getReason(), _pResponse->getStatus()); + } + } + catch (Poco::RemotingNG::TransportException&) + { + throw; + } + catch (Poco::RemotingNG::RemoteException& exc) + { + if (exc.message().empty()) + throw Poco::RemotingNG::RemoteException(jsonError, _pResponse->getStatus()); + else + throw; + } + catch (Poco::Exception&) + { + throw Poco::RemotingNG::RemoteException(_pResponse->getReason(), jsonError, _pResponse->getStatus()); + } + + return _deserializer; // should never be reached + } +} + + +void Transport::endRequest() +{ + _serializer.reset(); + _deserializer.reset(); + _pStream = 0; + _pInflater = 0; + _pDeflater = 0; + _pRequest = 0; + _pResponse = 0; +} + + +const Poco::Net::HTTPClientSession& Transport::requireSession() const +{ + if (_pSession) + return *_pSession; + else + throw Poco::IllegalStateException("Transport not connected"); +} + + +Poco::Net::HTTPClientSession& Transport::requireSession() +{ + if (_pSession) + return *_pSession; + else + throw Poco::IllegalStateException("Transport not connected"); +} + + +void Transport::prepareRequest(const std::string& messageName) +{ + std::string method; + if (messageName == "delete_"s) + { + method = "DELETE"; + } + else + { + method = Poco::toUpper(messageName); + } + _pRequest->setMethod(method); + if (method == "POST" || method == "PUT" || method == "PATCH") + { + _pRequest->setContentType(getAttribute("contentType"s, CONTENT_TYPE)); + } + _pRequest->setChunkedTransferEncoding(false); + _pRequest->set("Accept-Encoding"s, "gzip"s); + if (_compression) + { + _pRequest->set("Content-Encoding"s, "gzip"s); + } + if (_authMode == AUTH_BASIC || _authMode == AUTH_DIGEST || _authMode == AUTH_ANY) + { + _httpCreds.setUsername(_creds.getAttribute(Credentials::ATTR_USERNAME, EMPTY)); + _httpCreds.setPassword(_creds.getAttribute(Credentials::ATTR_PASSWORD, EMPTY)); + } + if (_authMode == AUTH_BASIC) + { + Poco::Net::HTTPBasicCredentials creds(_httpCreds.getUsername(), _httpCreds.getPassword()); + creds.authenticate(*_pRequest); + } + else if (_authMode == AUTH_BEARER) + { + Poco::Net::OAuth20Credentials creds(_creds.getAttribute(Credentials::ATTR_TOKEN), _creds.getAttribute(Credentials::ATTR_MECHANISM, BEARER)); + creds.authenticate(*_pRequest); + } + else if (_authMode == AUTH_CUSTOM) + { + _pRequest->set(_creds.getAttribute(Credentials::ATTR_MECHANISM), _creds.getAttribute(Credentials::ATTR_TOKEN)); + } + if (!_userAgent.empty()) + { + _pRequest->set(USER_AGENT, _userAgent); + } + for (const auto& p: _customHeaders) + { + _pRequest->set(p.first, p.second); + } + if (_pCookieStore) + { + _pCookieStore->addCookies(*_pRequest); + } +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/src/TransportFactory.cpp b/RemotingNG/REST/src/TransportFactory.cpp new file mode 100644 index 0000000000..934d180165 --- /dev/null +++ b/RemotingNG/REST/src/TransportFactory.cpp @@ -0,0 +1,58 @@ +// +// TransportFactory.cpp +// +// Library: RemotingNG/REST +// Package: REST +// Module: TransportFactory +// +// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Poco/RemotingNG/REST/TransportFactory.h" +#include "Poco/RemotingNG/REST/Transport.h" +#include "Poco/RemotingNG/TransportFactoryManager.h" +#include "Poco/Net/HTTPSessionInstantiator.h" + + +namespace Poco { +namespace RemotingNG { +namespace REST { + + +TransportFactory::TransportFactory() +{ +} + + +TransportFactory::~TransportFactory() +{ +} + + +Poco::RemotingNG::Transport* TransportFactory::createTransport() +{ + return new Transport; +} + + +void TransportFactory::registerFactory() +{ + Transport::httpSessionFactory().registerProtocol("http", new Poco::Net::HTTPSessionInstantiator); + Poco::RemotingNG::TransportFactoryManager::instance().registerFactory(Transport::PROTOCOL, new TransportFactory); +} + + +void TransportFactory::unregisterFactory() +{ + Poco::RemotingNG::TransportFactoryManager::instance().unregisterFactory(Transport::PROTOCOL); + Transport::httpSessionFactory().unregisterProtocol("http"); +} + + +} } } // namespace Poco::RemotingNG::REST diff --git a/RemotingNG/REST/testsuite/CMakeLists.txt b/RemotingNG/REST/testsuite/CMakeLists.txt new file mode 100644 index 0000000000..b59dbe4e6e --- /dev/null +++ b/RemotingNG/REST/testsuite/CMakeLists.txt @@ -0,0 +1,32 @@ +# Sources +file(GLOB SRCS_G "src/*.cpp") +POCO_SOURCES_AUTO(TEST_SRCS ${SRCS_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "src/*.h") +POCO_HEADERS_AUTO(TEST_SRCS ${HDRS_G}) + +POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF + src/WinDriver.cpp +) + +add_executable(RemotingNGREST-testrunner ${TEST_SRCS}) +if(ANDROID) + add_test( + NAME RemotingNGREST + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/RemotingNGREST-testrunner -DTEST_PARAMETER=-all -P ${PROJECT_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake + ) +else() + add_test( + NAME RemotingNGREST + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND RemotingNGREST-testrunner -ignore ${PROJECT_SOURCE_DIR}/cppignore.lnx -all + ) + set_tests_properties(RemotingNGREST PROPERTIES ENVIRONMENT POCO_BASE=${PROJECT_SOURCE_DIR}) +endif() + +target_link_libraries(RemotingNGREST-testrunner PUBLIC Poco::RemotingNGREST Poco::RemotingNG Poco::Net CppUnit) +target_include_directories(RemotingNGREST-testrunner + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include +) diff --git a/RemotingNG/REST/testsuite/Makefile b/RemotingNG/REST/testsuite/Makefile new file mode 100644 index 0000000000..ca81df00c3 --- /dev/null +++ b/RemotingNG/REST/testsuite/Makefile @@ -0,0 +1,46 @@ +# +# Makefile +# +# Makefile for Poco RemotingNG REST Transport testsuite +# + +include $(POCO_BASE)/build/rules/global + +objects = \ + Driver \ + JSONParserTest \ + JSONSerializerTest \ + JSONDeserializerTest \ + PathSerializerTest \ + PathDeserializerTest \ + HeaderSerializerTest \ + HeaderDeserializerTest \ + FormSerializerTest \ + FormDeserializerTest \ + RawSerializerTest \ + RawDeserializerTest \ + SerializerTest \ + DeserializerTest \ + RESTTestSuite \ + Tester \ + ITester \ + TesterProxy \ + TesterProxyFactory \ + TesterClientHelper \ + TesterSkeleton \ + TesterRemoteObject \ + TesterServerHelper \ + IAuthTester \ + AuthTesterClientHelper \ + AuthTesterProxy \ + AuthTesterProxyFactory \ + AuthTesterRemoteObject \ + AuthTesterServerHelper \ + AuthTesterSkeleton \ + RemotingTest + +target = testrunner +target_version = 1 +target_libs = PocoRemotingNGREST PocoRemotingNG PocoNet PocoFoundation CppUnit + +include $(POCO_BASE)/build/rules/exec diff --git a/RemotingNG/REST/testsuite/RemoteGen.xml b/RemotingNG/REST/testsuite/RemoteGen.xml new file mode 100644 index 0000000000..d72796584e --- /dev/null +++ b/RemotingNG/REST/testsuite/RemoteGen.xml @@ -0,0 +1,18 @@ + + + + + ../../../Foundation/include/Poco/Timestamp.h + src/Tester.h + + + + src + src + src + false + both + false + + + diff --git a/RemotingNG/REST/testsuite/src/AuthTesterClientHelper.cpp b/RemotingNG/REST/testsuite/src/AuthTesterClientHelper.cpp new file mode 100644 index 0000000000..937a4dea60 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterClientHelper.cpp @@ -0,0 +1,55 @@ +// +// AuthTesterClientHelper.cpp +// +// Package: Generated +// Module: AuthTesterClientHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "AuthTesterClientHelper.h" +#include "AuthTesterProxyFactory.h" +#include "Poco/SingletonHolder.h" + + +namespace +{ + Poco::SingletonHolder shAuthTesterClientHelper; +} + + +AuthTesterClientHelper::AuthTesterClientHelper(): + _pORB(0) +{ + _pORB = &Poco::RemotingNG::ORB::instance(); + _pORB->registerProxyFactory("AuthTester", new AuthTesterProxyFactory); +} + + +AuthTesterClientHelper::~AuthTesterClientHelper() +{ +} + + +IAuthTester::Ptr AuthTesterClientHelper::findImpl(const std::string& uri) +{ + Poco::RemotingNG::Identifiable::Ptr pInterface = _pORB->findObject(uri); + return pInterface.cast(); +} + + +IAuthTester::Ptr AuthTesterClientHelper::findImpl(const std::string& uri, const std::string& protocol) +{ + Poco::RemotingNG::Identifiable::Ptr pInterface = _pORB->findObject(uri, IAuthTester::remoting__typeId(), protocol); + return pInterface.cast(); +} + + +AuthTesterClientHelper& AuthTesterClientHelper::instance() +{ + return *shAuthTesterClientHelper.get(); +} + + diff --git a/RemotingNG/REST/testsuite/src/AuthTesterClientHelper.h b/RemotingNG/REST/testsuite/src/AuthTesterClientHelper.h new file mode 100644 index 0000000000..218d950db8 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterClientHelper.h @@ -0,0 +1,72 @@ +// +// AuthTesterClientHelper.h +// +// Package: Generated +// Module: AuthTesterClientHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef AuthTesterClientHelper_INCLUDED +#define AuthTesterClientHelper_INCLUDED + + +#include "IAuthTester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/ORB.h" + + +class AuthTesterClientHelper +{ +public: + AuthTesterClientHelper(); + /// Creates a AuthTesterClientHelper. + + ~AuthTesterClientHelper(); + /// Destroys the AuthTesterClientHelper. + + static IAuthTester::Ptr find(const std::string& uri); + /// Return an interface for the service object identified by the given URI. + /// + /// Depending on whether the service object has been registered on the same ORB, or not, + /// the ORB will either return a RemoteObject (with forwards calls locally, without the + /// need for serialization/deserialization), or a Proxy. + /// + /// The URI must have the following format: :///// + + static IAuthTester::Ptr find(const std::string& uri, const std::string& protocol); + /// Return a Proxy for the service object identified by the given URI. + /// + /// The given protocol name is used to determine the Transport used by + /// the Proxy. This is used for objects identified by URIs that do not + /// follow the standard Remoting URI structure. + +private: + IAuthTester::Ptr findImpl(const std::string& uri); + + IAuthTester::Ptr findImpl(const std::string& uri, const std::string& protocol); + + static AuthTesterClientHelper& instance(); + + Poco::RemotingNG::ORB* _pORB; +}; + + +inline IAuthTester::Ptr AuthTesterClientHelper::find(const std::string& uri) +{ + return AuthTesterClientHelper::instance().findImpl(uri); +} + + +inline IAuthTester::Ptr AuthTesterClientHelper::find(const std::string& uri, const std::string& protocol) +{ + return AuthTesterClientHelper::instance().findImpl(uri, protocol); +} + + + + +#endif // AuthTesterClientHelper_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/AuthTesterProxy.cpp b/RemotingNG/REST/testsuite/src/AuthTesterProxy.cpp new file mode 100644 index 0000000000..ea8164187d --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterProxy.cpp @@ -0,0 +1,88 @@ +// +// AuthTesterProxy.cpp +// +// Package: Generated +// Module: AuthTesterProxy +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "AuthTesterProxy.h" +#include "ObjectDeserializer.h" +#include "ObjectSerializer.h" +#include "Poco/RemotingNG/Deserializer.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Poco/RemotingNG/URIUtility.h" + + +AuthTesterProxy::AuthTesterProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid): + IAuthTester(), + Poco::RemotingNG::Proxy(oid), + _getRet(), + _postRet() +{ +} + + +AuthTesterProxy::~AuthTesterProxy() +{ +} + + +Object AuthTesterProxy::get(int id, const std::string& options) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"get"s,"id"s,"options"s}; + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/authtester/{id}"s); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], id, remoting__ser); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "query"s); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], options, remoting__ser); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + static const std::string REMOTING__REPLY_NAME("getReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _getRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__trans.endRequest(); + return _getRet; +} + + +Object AuthTesterProxy::post(int id, const Object& object) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"post"s,"id"s,"object"s}; + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/authtester/{id}"s); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], id, remoting__ser); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], object, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + static const std::string REMOTING__REPLY_NAME("postReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _postRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__trans.endRequest(); + return _postRet; +} + + +const std::string AuthTesterProxy::DEFAULT_NS; diff --git a/RemotingNG/REST/testsuite/src/AuthTesterProxy.h b/RemotingNG/REST/testsuite/src/AuthTesterProxy.h new file mode 100644 index 0000000000..fc81a3d1cc --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterProxy.h @@ -0,0 +1,53 @@ +// +// AuthTesterProxy.h +// +// Package: Generated +// Module: AuthTesterProxy +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef AuthTesterProxy_INCLUDED +#define AuthTesterProxy_INCLUDED + + +#include "IAuthTester.h" +#include "Poco/RemotingNG/Proxy.h" + + +class AuthTesterProxy: public IAuthTester, public Poco::RemotingNG::Proxy +{ +public: + using Ptr = Poco::AutoPtr; + + AuthTesterProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid); + /// Creates a AuthTesterProxy. + + virtual ~AuthTesterProxy(); + /// Destroys the AuthTesterProxy. + + Object get(int id, const std::string& options = std::string("none")); + + Object post(int id, const Object& object); + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + +private: + static const std::string DEFAULT_NS; + mutable Object _getRet; + mutable Object _postRet; +}; + + +inline const Poco::RemotingNG::Identifiable::TypeId& AuthTesterProxy::remoting__typeId() const +{ + return IAuthTester::remoting__typeId(); +} + + + + +#endif // AuthTesterProxy_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/AuthTesterProxyFactory.cpp b/RemotingNG/REST/testsuite/src/AuthTesterProxyFactory.cpp new file mode 100644 index 0000000000..22f59a1c46 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterProxyFactory.cpp @@ -0,0 +1,32 @@ +// +// AuthTesterProxyFactory.cpp +// +// Package: Generated +// Module: AuthTesterProxyFactory +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "AuthTesterProxyFactory.h" + + +AuthTesterProxyFactory::AuthTesterProxyFactory(): + Poco::RemotingNG::ProxyFactory() + +{ +} + + +AuthTesterProxyFactory::~AuthTesterProxyFactory() +{ +} + + +Poco::RemotingNG::Proxy* AuthTesterProxyFactory::createProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid) const +{ + return new AuthTesterProxy(oid); +} + + diff --git a/RemotingNG/REST/testsuite/src/AuthTesterProxyFactory.h b/RemotingNG/REST/testsuite/src/AuthTesterProxyFactory.h new file mode 100644 index 0000000000..3d411dca16 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterProxyFactory.h @@ -0,0 +1,38 @@ +// +// AuthTesterProxyFactory.h +// +// Package: Generated +// Module: AuthTesterProxyFactory +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef AuthTesterProxyFactory_INCLUDED +#define AuthTesterProxyFactory_INCLUDED + + +#include "AuthTesterProxy.h" +#include "Poco/RemotingNG/ProxyFactory.h" + + +class AuthTesterProxyFactory: public Poco::RemotingNG::ProxyFactory +{ +public: + AuthTesterProxyFactory(); + /// Creates a AuthTesterProxyFactory. + + ~AuthTesterProxyFactory(); + /// Destroys the AuthTesterProxyFactory. + + Poco::RemotingNG::Proxy* createProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid) const; + /// Creates and returns a new Proxy object. + +}; + + + + +#endif // AuthTesterProxyFactory_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/AuthTesterRemoteObject.cpp b/RemotingNG/REST/testsuite/src/AuthTesterRemoteObject.cpp new file mode 100644 index 0000000000..c909dda5cc --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterRemoteObject.cpp @@ -0,0 +1,34 @@ +// +// AuthTesterRemoteObject.cpp +// +// Package: Generated +// Module: AuthTesterRemoteObject +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "AuthTesterRemoteObject.h" + + +AuthTesterRemoteObject::AuthTesterRemoteObject(const Poco::RemotingNG::Identifiable::ObjectId& oid, Poco::SharedPtr pServiceObject): + IAuthTester(), + Poco::RemotingNG::RemoteObject(oid), + _pServiceObject(pServiceObject) +{ +} + + +AuthTesterRemoteObject::~AuthTesterRemoteObject() +{ + try + { + } + catch (...) + { + poco_unexpected(); + } +} + + diff --git a/RemotingNG/REST/testsuite/src/AuthTesterRemoteObject.h b/RemotingNG/REST/testsuite/src/AuthTesterRemoteObject.h new file mode 100644 index 0000000000..165141d1bf --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterRemoteObject.h @@ -0,0 +1,65 @@ +// +// AuthTesterRemoteObject.h +// +// Package: Generated +// Module: AuthTesterRemoteObject +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef AuthTesterRemoteObject_INCLUDED +#define AuthTesterRemoteObject_INCLUDED + + +#include "IAuthTester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/RemoteObject.h" +#include "Poco/SharedPtr.h" + + +class AuthTesterRemoteObject: public IAuthTester, public Poco::RemotingNG::RemoteObject +{ +public: + using Ptr = Poco::AutoPtr; + + AuthTesterRemoteObject(const Poco::RemotingNG::Identifiable::ObjectId& oid, Poco::SharedPtr pServiceObject); + /// Creates a AuthTesterRemoteObject. + + virtual ~AuthTesterRemoteObject(); + /// Destroys the AuthTesterRemoteObject. + + Object get(int id, const std::string& options = std::string("none")); + + Object post(int id, const Object& object); + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + +private: + Poco::SharedPtr _pServiceObject; +}; + + +inline Object AuthTesterRemoteObject::get(int id, const std::string& options) +{ + return _pServiceObject->get(id, options); +} + + +inline Object AuthTesterRemoteObject::post(int id, const Object& object) +{ + return _pServiceObject->post(id, object); +} + + +inline const Poco::RemotingNG::Identifiable::TypeId& AuthTesterRemoteObject::remoting__typeId() const +{ + return IAuthTester::remoting__typeId(); +} + + + + +#endif // AuthTesterRemoteObject_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/AuthTesterServerHelper.cpp b/RemotingNG/REST/testsuite/src/AuthTesterServerHelper.cpp new file mode 100644 index 0000000000..68610b7ff1 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterServerHelper.cpp @@ -0,0 +1,81 @@ +// +// AuthTesterServerHelper.cpp +// +// Package: Generated +// Module: AuthTesterServerHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "AuthTesterServerHelper.h" +#include "AuthTesterSkeleton.h" +#include "Poco/RemotingNG/URIUtility.h" +#include "Poco/SingletonHolder.h" + + +namespace +{ + Poco::SingletonHolder shAuthTesterServerHelper; +} + + +AuthTesterServerHelper::AuthTesterServerHelper(): + _pORB(0) +{ + _pORB = &Poco::RemotingNG::ORB::instance(); + registerSkeleton(); +} + + +AuthTesterServerHelper::~AuthTesterServerHelper() +{ +} + + +void AuthTesterServerHelper::shutdown() +{ + AuthTesterServerHelper::instance().unregisterSkeleton(); + shAuthTesterServerHelper.reset(); +} + + +Poco::AutoPtr AuthTesterServerHelper::createRemoteObjectImpl(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid) +{ + Poco::AutoPtr pRemoteObject = new AuthTesterRemoteObject(oid, pServiceObject); + pRemoteObject->remoting__setURI(Poco::URI("/authtester/{id}")); + return pRemoteObject; +} + + +AuthTesterServerHelper& AuthTesterServerHelper::instance() +{ + return *shAuthTesterServerHelper.get(); +} + + +std::string AuthTesterServerHelper::registerObjectImpl(Poco::AutoPtr pRemoteObject, const std::string& listenerId) +{ + return _pORB->registerObject(pRemoteObject, listenerId); +} + + +void AuthTesterServerHelper::registerSkeleton() +{ + _pORB->registerSkeleton("AuthTester", new AuthTesterSkeleton); +} + + +void AuthTesterServerHelper::unregisterObjectImpl(const std::string& uri) +{ + _pORB->unregisterObject(uri); +} + + +void AuthTesterServerHelper::unregisterSkeleton() +{ + _pORB->unregisterSkeleton("AuthTester", true); +} + + diff --git a/RemotingNG/REST/testsuite/src/AuthTesterServerHelper.h b/RemotingNG/REST/testsuite/src/AuthTesterServerHelper.h new file mode 100644 index 0000000000..0019aa36a5 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterServerHelper.h @@ -0,0 +1,105 @@ +// +// AuthTesterServerHelper.h +// +// Package: Generated +// Module: AuthTesterServerHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef AuthTesterServerHelper_INCLUDED +#define AuthTesterServerHelper_INCLUDED + + +#include "AuthTesterRemoteObject.h" +#include "IAuthTester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/ORB.h" +#include "Poco/RemotingNG/ServerHelper.h" +#include "Tester.h" + + +class AuthTesterServerHelper +{ +public: + using Service = AuthTester; + + AuthTesterServerHelper(); + /// Creates a AuthTesterServerHelper. + + ~AuthTesterServerHelper(); + /// Destroys the AuthTesterServerHelper. + + static Poco::AutoPtr createRemoteObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid); + /// Creates and returns a RemoteObject wrapper for the given AuthTester instance. + + static std::string registerObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid, const std::string& listenerId); + /// Creates a RemoteObject wrapper for the given AuthTester instance + /// and registers it with the ORB and the Listener instance + /// uniquely identified by the Listener's ID. + /// + /// Returns the URI created for the object. + + static std::string registerRemoteObject(Poco::AutoPtr pRemoteObject, const std::string& listenerId); + /// Registers the given RemoteObject with the ORB and the Listener instance + /// uniquely identified by the Listener's ID. + /// + /// Returns the URI created for the object. + + static void shutdown(); + /// Removes the Skeleton for AuthTester from the ORB. + + static void unregisterObject(const std::string& uri); + /// Unregisters a service object identified by URI from the ORB. + +private: + static Poco::AutoPtr createRemoteObjectImpl(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid); + + static AuthTesterServerHelper& instance(); + /// Returns a static instance of the helper class. + + std::string registerObjectImpl(Poco::AutoPtr pRemoteObject, const std::string& listenerId); + + void registerSkeleton(); + + void unregisterObjectImpl(const std::string& uri); + + void unregisterSkeleton(); + + Poco::RemotingNG::ORB* _pORB; +}; + + +inline Poco::AutoPtr AuthTesterServerHelper::createRemoteObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid) +{ + return AuthTesterServerHelper::instance().createRemoteObjectImpl(pServiceObject, oid); +} + + +inline std::string AuthTesterServerHelper::registerObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid, const std::string& listenerId) +{ + return AuthTesterServerHelper::instance().registerObjectImpl(createRemoteObject(pServiceObject, oid), listenerId); +} + + +inline std::string AuthTesterServerHelper::registerRemoteObject(Poco::AutoPtr pRemoteObject, const std::string& listenerId) +{ + return AuthTesterServerHelper::instance().registerObjectImpl(pRemoteObject, listenerId); +} + + +inline void AuthTesterServerHelper::unregisterObject(const std::string& uri) +{ + AuthTesterServerHelper::instance().unregisterObjectImpl(uri); +} + + + + +REMOTING_SPECIALIZE_SERVER_HELPER(, AuthTester) + + +#endif // AuthTesterServerHelper_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/AuthTesterSkeleton.cpp b/RemotingNG/REST/testsuite/src/AuthTesterSkeleton.cpp new file mode 100644 index 0000000000..ef5249f8da --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterSkeleton.cpp @@ -0,0 +1,178 @@ +// +// AuthTesterSkeleton.cpp +// +// Package: Generated +// Module: AuthTesterSkeleton +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "AuthTesterSkeleton.h" +#include "ObjectDeserializer.h" +#include "ObjectSerializer.h" +#include "Poco/RemotingNG/Deserializer.h" +#include "Poco/RemotingNG/MethodHandler.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/RemotingNG/ServerTransport.h" +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Poco/SharedPtr.h" + + +class AuthTesterGetMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"get"s,"id"s,"options"s}; + bool remoting__requestSucceeded = false; + try + { + int id; + std::string options("none"); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/authtester/{id}"s); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, id); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "query"s); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], false, remoting__deser, options); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + if (!remoting__trans.authenticate(REMOTING__NAMES[0])) + throw Poco::RemotingNG::AuthenticationFailedException(); + AuthTesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Object remoting__return = remoting__pCastedRO->get(id, options); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + static const std::string REMOTING__REPLY_NAME("getReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("AuthTester::get"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("AuthTester::get"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("AuthTester::get"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class AuthTesterPostMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"post"s,"id"s,"object"s}; + bool remoting__requestSucceeded = false; + try + { + int id; + Object object; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/authtester/{id}"s); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, id); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, object); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + if (!remoting__trans.authenticate(REMOTING__NAMES[0])) + throw Poco::RemotingNG::AuthenticationFailedException(); + static const std::string REMOTING__PERMISSION("perm1"); + if (!remoting__trans.authorize(REMOTING__NAMES[0], REMOTING__PERMISSION)) + throw Poco::RemotingNG::NoPermissionException(REMOTING__PERMISSION); + AuthTesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Object remoting__return = remoting__pCastedRO->post(id, object); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + static const std::string REMOTING__REPLY_NAME("postReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("AuthTester::post"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("AuthTester::post"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("AuthTester::post"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +AuthTesterSkeleton::AuthTesterSkeleton(): + Poco::RemotingNG::Skeleton() + +{ + using namespace std::string_literals; + + addMethodHandler("get"s, new AuthTesterGetMethodHandler); + addMethodHandler("post"s, new AuthTesterPostMethodHandler); +} + + +AuthTesterSkeleton::~AuthTesterSkeleton() +{ +} + + +const std::string AuthTesterSkeleton::DEFAULT_NS; diff --git a/RemotingNG/REST/testsuite/src/AuthTesterSkeleton.h b/RemotingNG/REST/testsuite/src/AuthTesterSkeleton.h new file mode 100644 index 0000000000..de3ff3ff15 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/AuthTesterSkeleton.h @@ -0,0 +1,44 @@ +// +// AuthTesterSkeleton.h +// +// Package: Generated +// Module: AuthTesterSkeleton +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef AuthTesterSkeleton_INCLUDED +#define AuthTesterSkeleton_INCLUDED + + +#include "AuthTesterRemoteObject.h" +#include "Poco/RemotingNG/Skeleton.h" + + +class AuthTesterSkeleton: public Poco::RemotingNG::Skeleton +{ +public: + AuthTesterSkeleton(); + /// Creates a AuthTesterSkeleton. + + virtual ~AuthTesterSkeleton(); + /// Destroys a AuthTesterSkeleton. + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + + static const std::string DEFAULT_NS; +}; + + +inline const Poco::RemotingNG::Identifiable::TypeId& AuthTesterSkeleton::remoting__typeId() const +{ + return IAuthTester::remoting__typeId(); +} + + + + +#endif // AuthTesterSkeleton_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/DeserializerTest.cpp b/RemotingNG/REST/testsuite/src/DeserializerTest.cpp new file mode 100644 index 0000000000..3be227513d --- /dev/null +++ b/RemotingNG/REST/testsuite/src/DeserializerTest.cpp @@ -0,0 +1,271 @@ +// +// DeserializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "DeserializerTest.h" +#include "ObjectDeserializer.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/Deserializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Poco/Net/HTTPRequest.h" +#include "Poco/StreamCopier.h" +#include + + +using namespace Poco::RemotingNG::REST; + + +DeserializerTest::DeserializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +DeserializerTest::~DeserializerTest() +{ +} + + +void DeserializerTest::testGet() +{ + Deserializer deser; + std::stringstream stream; + deser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/tester/1234?options=test"); + deser.setRequest(request); + + std::string method; + assert (deser.findMessage(method) == Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + assert (method == "get"); + + int id; + std::string options("none"); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"); + deser.deserializeMessageBegin("get", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"); + Poco::RemotingNG::TypeDeserializer::deserialize("id", true, deser, id); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "query"); + Poco::RemotingNG::TypeDeserializer::deserialize("options", false, deser, options); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + deser.deserializeMessageEnd("get", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + assert (id == 1234); + assert (options == "test"); +} + + +void DeserializerTest::testPostForm() +{ + Deserializer deser; + std::stringstream stream; + stream << "text=foo%20bar"; + + deser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/tester/1234"); + deser.setRequest(request); + + int id; + std::string text; + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"); + deser.deserializeMessageBegin("post", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"); + Poco::RemotingNG::TypeDeserializer::deserialize("id", true, deser, id); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "form"); + Poco::RemotingNG::TypeDeserializer::deserialize("text", true, deser, text); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + deser.deserializeMessageEnd("post", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + assert (id == 1234); + assert (text == "foo bar"); +} + + +void DeserializerTest::testPostJSONObject() +{ + Deserializer deser; + std::stringstream stream; + stream << + "{\n" + "\t\"data\": \"foo\\u001Ebar\"\n" + "}"; + + deser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/tester/1234"); + deser.setRequest(request); + + int id; + Object object; + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"); + deser.deserializeMessageBegin("post", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"); + Poco::RemotingNG::TypeDeserializer::deserialize("id", true, deser, id); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + Poco::RemotingNG::TypeDeserializer::deserialize("object", true, deser, object); + deser.deserializeMessageEnd("post", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + assert (id == 1234); + assert (object.data == "foo\036bar"); +} + + +void DeserializerTest::testPostJSONArray() +{ + Deserializer deser; + std::stringstream stream; + stream << + "[\n" + "\t\"foo\",\n" + "\t\"bar\"\n" + "]"; + + deser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/tester/1234"); + deser.setRequest(request); + + int id; + std::vector array; + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"); + deser.deserializeMessageBegin("post", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"); + Poco::RemotingNG::TypeDeserializer::deserialize("id", true, deser, id); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + Poco::RemotingNG::TypeDeserializer >::deserialize("array", true, deser, array); + deser.deserializeMessageEnd("post", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + assert (id == 1234); + assert (array.size() == 2); + assert (array[0] == "foo"); + assert (array[1] == "bar"); +} + + +void DeserializerTest::testPostRaw() +{ + Deserializer deser; + std::stringstream stream; + stream << "foo bar"; + + deser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/tester/1234"); + deser.setRequest(request); + + std::string method; + assert (deser.findMessage(method) == Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + assert (method == "post"); + + int id; + std::string text; + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"); + deser.deserializeMessageBegin("post", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"); + Poco::RemotingNG::TypeDeserializer::deserialize("id", true, deser, id); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "body"); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT, "raw"); + Poco::RemotingNG::TypeDeserializer::deserialize("text", true, deser, text); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + deser.deserializeMessageEnd("post", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + assert (id == 1234); + assert (text == "foo bar"); +} + + +void DeserializerTest::testPostRawHeader() +{ + Deserializer deser; + std::stringstream stream; + stream << "foo bar"; + + deser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/tester/1234"); + request.set("X-Header", "Foo Bar"); + deser.setRequest(request); + + std::string method; + assert (deser.findMessage(method) == Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + assert (method == "post"); + + int id; + std::string text; + std::string header; + + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"); + deser.deserializeMessageBegin("post", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"); + Poco::RemotingNG::TypeDeserializer::deserialize("id", true, deser, id); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "body"); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT, "raw"); + Poco::RemotingNG::TypeDeserializer::deserialize("text", true, deser, text); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "header"); + Poco::RemotingNG::TypeDeserializer::deserialize("X-Header", true, deser, header); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + deser.deserializeMessageEnd("post", Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + assert (id == 1234); + assert (text == "foo bar"); + assert (header == "Foo Bar"); +} + + +void DeserializerTest::testMethodOverride() +{ + Deserializer deser; + std::stringstream stream; + + deser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/tester/1234"); + request.set("X-HTTP-Method-Override", "DELETE"); + deser.setRequest(request); + + std::string method; + assert (deser.findMessage(method) == Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + assert (method == "delete_"); +} + + +void DeserializerTest::setUp() +{ +} + + +void DeserializerTest::tearDown() +{ +} + + +CppUnit::Test* DeserializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DeserializerTest"); + + CppUnit_addTest(pSuite, DeserializerTest, testGet); + CppUnit_addTest(pSuite, DeserializerTest, testPostForm); + CppUnit_addTest(pSuite, DeserializerTest, testPostJSONObject); + CppUnit_addTest(pSuite, DeserializerTest, testPostJSONArray); + CppUnit_addTest(pSuite, DeserializerTest, testPostRaw); + CppUnit_addTest(pSuite, DeserializerTest, testPostRawHeader); + CppUnit_addTest(pSuite, DeserializerTest, testMethodOverride); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/DeserializerTest.h b/RemotingNG/REST/testsuite/src/DeserializerTest.h new file mode 100644 index 0000000000..3b1942701f --- /dev/null +++ b/RemotingNG/REST/testsuite/src/DeserializerTest.h @@ -0,0 +1,46 @@ +// +// DeserializerTest.h +// +// Definition of the DeserializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef DeserializerTest_INCLUDED +#define DeserializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class DeserializerTest: public CppUnit::TestCase +{ +public: + DeserializerTest(const std::string& name); + ~DeserializerTest(); + + void testGet(); + void testPostForm(); + void testPostJSONObject(); + void testPostJSONArray(); + void testPostRaw(); + void testPostRawHeader(); + void testMethodOverride(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // DeserializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/Driver.cpp b/RemotingNG/REST/testsuite/src/Driver.cpp new file mode 100644 index 0000000000..ce18048005 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/Driver.cpp @@ -0,0 +1,19 @@ +// +// Driver.cpp +// +// Console-based test driver for Poco RemotingNG REST. +// +// Copyright (c) 2006-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "CppUnit/TestRunner.h" +#include "RESTTestSuite.h" + + +CppUnitMain(RESTTestSuite) diff --git a/RemotingNG/REST/testsuite/src/FormDeserializerTest.cpp b/RemotingNG/REST/testsuite/src/FormDeserializerTest.cpp new file mode 100644 index 0000000000..7293439e6e --- /dev/null +++ b/RemotingNG/REST/testsuite/src/FormDeserializerTest.cpp @@ -0,0 +1,181 @@ +// +// FormDeserializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "FormDeserializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/FormDeserializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include + + +using namespace Poco::RemotingNG::REST; + + +FormDeserializerTest::FormDeserializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +FormDeserializerTest::~FormDeserializerTest() +{ +} + + +void FormDeserializerTest::testGetRequest() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/?id=1234&childId=foo"); + FormDeserializer deserializer(request); + + int id; + bool ok = deserializer.deserialize("id", true, id); + assert (ok); + assert (id == 1234); + + std::string childId; + ok = deserializer.deserialize("childId", true, childId); + assert (ok); + assert (childId == "foo"); +} + + +void FormDeserializerTest::testPostRequest() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"); + std::stringstream str; + str << "id=1234&childId=foo"; + FormDeserializer deserializer(request, str); + + int id; + bool ok = deserializer.deserialize("id", true, id); + assert (ok); + assert (id == 1234); + + std::string childId; + ok = deserializer.deserialize("childId", true, childId); + assert (ok); + assert (childId == "foo"); +} + + +void FormDeserializerTest::testPostRequestMultiPart() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"); + request.setContentType(Poco::Net::HTMLForm::ENCODING_MULTIPART + "; boundary=MIME_boundary_0123456789"); + + std::istringstream str( + "\r\n" + "--MIME_boundary_0123456789\r\n" + "Content-Disposition: form-data; name=\"first\"\r\n" + "\r\n" + "value\r\n" + "--MIME_boundary_0123456789\r\n" + "Content-Disposition: form-data; name=\"second\"\r\n" + "\r\n" + "42\r\n" + "--MIME_boundary_0123456789\r\n" + "Content-Disposition: form-data; name=\"third\"; filename=\"att1.txt\"\r\n" + "Content-Type: text/plain\r\n" + "\r\n" + "This is an attachment\r\n" + "--MIME_boundary_0123456789--\r\n" + ); + + FormDeserializer deserializer(request, str); + + std::string first; + bool ok = deserializer.deserialize("first", true, first); + assert (ok); + assert (first == "value"); + + int second; + ok = deserializer.deserialize("second", true, second); + assert (ok); + assert (second == 42); + + std::vector third; + ok = deserializer.deserialize("third", true, third); + assert (ok); + std::string expected("This is an attachment"); + assert (third == std::vector(expected.begin(), expected.end())); +} + + +void FormDeserializerTest::testResponse() +{ + Poco::Net::HTTPResponse response; + response.setContentType(Poco::Net::HTMLForm::ENCODING_URL); + std::stringstream str; + str << "id=1234&childId=foo"; + FormDeserializer deserializer(response, str); + + int id; + bool ok = deserializer.deserialize("id", true, id); + assert (ok); + assert (id == 1234); + + std::string childId; + ok = deserializer.deserialize("childId", true, childId); + assert (ok); + assert (childId == "foo"); +} + + +void FormDeserializerTest::testTypes() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/?bool=false&double=3.5&int=42&string=foo"); + FormDeserializer deserializer(request); + + std::string stringValue; + bool ok = deserializer.deserialize("string", true, stringValue); + assert (ok); + assert (stringValue == "foo"); + + int intValue; + ok = deserializer.deserialize("int", true, intValue); + assert (ok); + assert (intValue == 42); + + bool boolValue; + ok = deserializer.deserialize("bool", true, boolValue); + assert (ok); + assert (boolValue == false); + + double doubleValue; + ok = deserializer.deserialize("double", true, doubleValue); + assert (ok); + assert (doubleValue == 3.5); +} + + +void FormDeserializerTest::setUp() +{ +} + + +void FormDeserializerTest::tearDown() +{ +} + + +CppUnit::Test* FormDeserializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FormDeserializerTest"); + + CppUnit_addTest(pSuite, FormDeserializerTest, testGetRequest); + CppUnit_addTest(pSuite, FormDeserializerTest, testPostRequest); + CppUnit_addTest(pSuite, FormDeserializerTest, testPostRequestMultiPart); + CppUnit_addTest(pSuite, FormDeserializerTest, testResponse); + CppUnit_addTest(pSuite, FormDeserializerTest, testTypes); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/FormDeserializerTest.h b/RemotingNG/REST/testsuite/src/FormDeserializerTest.h new file mode 100644 index 0000000000..3c6c6199c1 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/FormDeserializerTest.h @@ -0,0 +1,44 @@ +// +// FormDeserializerTest.h +// +// Definition of the FormDeserializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef FormDeserializerTest_INCLUDED +#define FormDeserializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class FormDeserializerTest: public CppUnit::TestCase +{ +public: + FormDeserializerTest(const std::string& name); + ~FormDeserializerTest(); + + void testGetRequest(); + void testPostRequest(); + void testPostRequestMultiPart(); + void testResponse(); + void testTypes(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // FormDeserializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/FormSerializerTest.cpp b/RemotingNG/REST/testsuite/src/FormSerializerTest.cpp new file mode 100644 index 0000000000..9f9c0079bc --- /dev/null +++ b/RemotingNG/REST/testsuite/src/FormSerializerTest.cpp @@ -0,0 +1,175 @@ +// +// FormSerializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "FormSerializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/FormSerializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include + + +using namespace Poco::RemotingNG::REST; +using namespace std::string_literals; + + +FormSerializerTest::FormSerializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +FormSerializerTest::~FormSerializerTest() +{ +} + + +void FormSerializerTest::testGetRequest() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/"s); + FormSerializer serializer(request); + serializer.serialize("id"s, 1234); + serializer.serialize("childId"s, "foo"s); + serializer.close(); + assert (request.getURI() == "/?id=1234&childId=foo"); +} + + +void FormSerializerTest::testPostRequest() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"s); + std::ostringstream ostr; + FormSerializer serializer(request, ostr); + serializer.serialize("id"s, 1234); + serializer.serialize("childId"s, "foo"s); + serializer.close(); + assert (request.getURI() == "/"); + assert (ostr.str() == "id=1234&childId=foo"); +} + + +void FormSerializerTest::testPostMultipartRequest() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"s); + request.setContentType("multipart/form-data"s); + std::ostringstream ostr; + FormSerializer serializer(request, ostr); + serializer.serialize("id"s, 1234); + serializer.serialize("childId"s, "foo"s); + serializer.close(); + assert (request.getURI() == "/"); + std::string str = ostr.str(); + assert (str.substr(0, 16) == "--MIME_boundary_"); + assert (str.find("Content-Disposition: form-data; name=\"id\"\r\n") != std::string::npos); + assert (str.find("1234\r\n") != std::string::npos); + assert (str.find("Content-Disposition: form-data; name=\"childId\"\r\n") != std::string::npos); + assert (str.find("foo\r\n") != std::string::npos); +} + + +void FormSerializerTest::testPostMultipartCharVectorRequest() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"s); + request.setContentType("multipart/form-data"s); + std::ostringstream ostr; + FormSerializer serializer(request, ostr); + serializer.serialize("id"s, 1234); + std::vector data; + std::string s("testdata"); + data.assign(s.begin(), s.end()); + serializer.serialize("data"s, data); + serializer.close(); + assert (request.getURI() == "/"); + std::string str = ostr.str(); + assert (str.substr(0, 16) == "--MIME_boundary_"); + assert (str.find("Content-Disposition: form-data; name=\"id\"\r\n") != std::string::npos); + assert (str.find("1234\r\n") != std::string::npos); + assert (str.find("Content-Disposition: form-data; name=\"data\"; filename=\"data\"\r\n") != std::string::npos); + assert (str.find("Content-Type: application/octet-stream\r\n") != std::string::npos); + assert (str.find("testdata\r\n") != std::string::npos); +} + + +void FormSerializerTest::testPostMultipartCharVectorRequestWithContentType() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"s); + request.setContentType("multipart/form-data"s); + std::ostringstream ostr; + FormSerializer serializer(request, ostr); + serializer.serialize("id"s, 1234); + std::vector data; + std::string s("testdata"); + data.assign(s.begin(), s.end()); + serializer.pushProperty(Poco::RemotingNG::SerializerBase::PROP_CONTENT_TYPE, "image/jpeg"s); + serializer.serialize("data"s, data); + serializer.popProperty(Poco::RemotingNG::SerializerBase::PROP_CONTENT_TYPE); + serializer.close(); + assert (request.getURI() == "/"); + std::string str = ostr.str(); + assert (str.substr(0, 16) == "--MIME_boundary_"); + assert (str.find("Content-Disposition: form-data; name=\"id\"\r\n") != std::string::npos); + assert (str.find("1234\r\n") != std::string::npos); + assert (str.find("Content-Disposition: form-data; name=\"data\"; filename=\"data\"\r\n") != std::string::npos); + assert (str.find("Content-Type: image/jpeg\r\n") != std::string::npos); + assert (str.find("testdata\r\n") != std::string::npos); +} + + +void FormSerializerTest::testResponse() +{ + Poco::Net::HTTPResponse response; + std::ostringstream ostr; + FormSerializer serializer(response, ostr); + serializer.serialize("id"s, 1234); + serializer.serialize("childId"s, "foo"s); + serializer.close(); + assert (ostr.str() == "id=1234&childId=foo"); +} + + +void FormSerializerTest::testTypes() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/"); + std::ostringstream ostr; + FormSerializer serializer(request, ostr); + serializer.serialize("bool"s, false); + serializer.serialize("double"s, 3.5); + serializer.serialize("int"s, static_cast(42)); + serializer.serialize("string"s, "foo"s); + serializer.close(); + assert (ostr.str() == "bool=false&double=3.5&int=42&string=foo"); +} + + +void FormSerializerTest::setUp() +{ +} + + +void FormSerializerTest::tearDown() +{ +} + + +CppUnit::Test* FormSerializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("FormSerializerTest"); + + CppUnit_addTest(pSuite, FormSerializerTest, testGetRequest); + CppUnit_addTest(pSuite, FormSerializerTest, testPostRequest); + CppUnit_addTest(pSuite, FormSerializerTest, testPostMultipartRequest); + CppUnit_addTest(pSuite, FormSerializerTest, testPostMultipartCharVectorRequest); + CppUnit_addTest(pSuite, FormSerializerTest, testPostMultipartCharVectorRequestWithContentType); + CppUnit_addTest(pSuite, FormSerializerTest, testResponse); + CppUnit_addTest(pSuite, FormSerializerTest, testTypes); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/FormSerializerTest.h b/RemotingNG/REST/testsuite/src/FormSerializerTest.h new file mode 100644 index 0000000000..011a91a613 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/FormSerializerTest.h @@ -0,0 +1,46 @@ +// +// FormSerializerTest.h +// +// Definition of the FormSerializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef FormSerializerTest_INCLUDED +#define FormSerializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class FormSerializerTest: public CppUnit::TestCase +{ +public: + FormSerializerTest(const std::string& name); + ~FormSerializerTest(); + + void testGetRequest(); + void testPostRequest(); + void testPostMultipartRequest(); + void testPostMultipartCharVectorRequest(); + void testPostMultipartCharVectorRequestWithContentType(); + void testResponse(); + void testTypes(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // FormSerializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/HeaderDeserializerTest.cpp b/RemotingNG/REST/testsuite/src/HeaderDeserializerTest.cpp new file mode 100644 index 0000000000..84c4e7088f --- /dev/null +++ b/RemotingNG/REST/testsuite/src/HeaderDeserializerTest.cpp @@ -0,0 +1,103 @@ +// +// HeaderDeserializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "HeaderDeserializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/HeaderDeserializer.h" +#include "Poco/Net/HTTPRequest.h" +#include + + +using namespace Poco::RemotingNG::REST; + + +HeaderDeserializerTest::HeaderDeserializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +HeaderDeserializerTest::~HeaderDeserializerTest() +{ +} + + +void HeaderDeserializerTest::testParams() +{ + Poco::Net::HTTPRequest request; + request.set("id", "1234"); + request.set("childId", "foo"); + HeaderDeserializer deserializer(request); + + int id; + bool ok = deserializer.deserialize("id", true, id); + assert (ok); + assert (id == 1234); + + std::string childId; + ok = deserializer.deserialize("childId", true, childId); + assert (ok); + assert (childId == "foo"); +} + + +void HeaderDeserializerTest::testTypes() +{ + Poco::Net::HTTPRequest request; + request.set("string", "foo"); + request.set("int", "42"); + request.set("bool", "false"); + request.set("double", "3.5"); + + HeaderDeserializer deserializer(request); + + std::string stringValue; + bool ok = deserializer.deserialize("string", true, stringValue); + assert (ok); + assert (stringValue == "foo"); + + int intValue; + ok = deserializer.deserialize("int", true, intValue); + assert (ok); + assert (intValue == 42); + + bool boolValue; + ok = deserializer.deserialize("bool", true, boolValue); + assert (ok); + assert (boolValue == false); + + double doubleValue; + ok = deserializer.deserialize("double", true, doubleValue); + assert (ok); + assert (doubleValue == 3.5); +} + + +void HeaderDeserializerTest::setUp() +{ +} + + +void HeaderDeserializerTest::tearDown() +{ +} + + +CppUnit::Test* HeaderDeserializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HeaderDeserializerTest"); + + CppUnit_addTest(pSuite, HeaderDeserializerTest, testParams); + CppUnit_addTest(pSuite, HeaderDeserializerTest, testTypes); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/HeaderDeserializerTest.h b/RemotingNG/REST/testsuite/src/HeaderDeserializerTest.h new file mode 100644 index 0000000000..14458989b2 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/HeaderDeserializerTest.h @@ -0,0 +1,41 @@ +// +// HeaderDeserializerTest.h +// +// Definition of the HeaderDeserializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef HeaderDeserializerTest_INCLUDED +#define HeaderDeserializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class HeaderDeserializerTest: public CppUnit::TestCase +{ +public: + HeaderDeserializerTest(const std::string& name); + ~HeaderDeserializerTest(); + + void testParams(); + void testTypes(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // HeaderDeserializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/HeaderSerializerTest.cpp b/RemotingNG/REST/testsuite/src/HeaderSerializerTest.cpp new file mode 100644 index 0000000000..e4af1b7892 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/HeaderSerializerTest.cpp @@ -0,0 +1,79 @@ +// +// HeaderSerializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "HeaderSerializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/HeaderSerializer.h" +#include "Poco/Net/HTTPRequest.h" +#include + + +using namespace Poco::RemotingNG::REST; +using namespace std::string_literals; + + +HeaderSerializerTest::HeaderSerializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +HeaderSerializerTest::~HeaderSerializerTest() +{ +} + + +void HeaderSerializerTest::testParams() +{ + Poco::Net::HTTPRequest request; + HeaderSerializer serializer(request); + serializer.serialize("id"s, 1234); + serializer.serialize("childId"s, "foo"s); + assert (request.get("id"s) == "1234"); + assert (request.get("childId"s) == "foo"); +} + + +void HeaderSerializerTest::testTypes() +{ + Poco::Net::HTTPRequest request; + HeaderSerializer serializer(request); + serializer.serialize("string"s, "foo"s); + serializer.serialize("int"s, static_cast(42)); + serializer.serialize("bool"s, false); + serializer.serialize("double"s, 3.5); + assert (request.get("string"s) == "foo"); + assert (request.get("int"s) == "42"); + assert (request.get("bool"s) == "false"); + assert (request.get("double"s) == "3.5"); +} + + +void HeaderSerializerTest::setUp() +{ +} + + +void HeaderSerializerTest::tearDown() +{ +} + + +CppUnit::Test* HeaderSerializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HeaderSerializerTest"); + + CppUnit_addTest(pSuite, HeaderSerializerTest, testParams); + CppUnit_addTest(pSuite, HeaderSerializerTest, testTypes); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/HeaderSerializerTest.h b/RemotingNG/REST/testsuite/src/HeaderSerializerTest.h new file mode 100644 index 0000000000..a381c95a98 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/HeaderSerializerTest.h @@ -0,0 +1,41 @@ +// +// HeaderSerializerTest.h +// +// Definition of the HeaderSerializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef HeaderSerializerTest_INCLUDED +#define HeaderSerializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class HeaderSerializerTest: public CppUnit::TestCase +{ +public: + HeaderSerializerTest(const std::string& name); + ~HeaderSerializerTest(); + + void testParams(); + void testTypes(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // HeaderSerializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/IAuthTester.cpp b/RemotingNG/REST/testsuite/src/IAuthTester.cpp new file mode 100644 index 0000000000..b454fedc51 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/IAuthTester.cpp @@ -0,0 +1,33 @@ +// +// IAuthTester.cpp +// +// Package: Generated +// Module: IAuthTester +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "IAuthTester.h" + + +IAuthTester::IAuthTester(): + Poco::RefCountedObject() + +{ +} + + +IAuthTester::~IAuthTester() +{ +} + + +const Poco::RemotingNG::Identifiable::TypeId& IAuthTester::remoting__typeId() +{ + static const std::string REMOTING__TYPE_ID("AuthTester"); + return REMOTING__TYPE_ID; +} + + diff --git a/RemotingNG/REST/testsuite/src/IAuthTester.h b/RemotingNG/REST/testsuite/src/IAuthTester.h new file mode 100644 index 0000000000..8dec5fb5de --- /dev/null +++ b/RemotingNG/REST/testsuite/src/IAuthTester.h @@ -0,0 +1,46 @@ +// +// IAuthTester.h +// +// Package: Generated +// Module: IAuthTester +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef IAuthTester_INCLUDED +#define IAuthTester_INCLUDED + + +#include "Poco/AutoPtr.h" +#include "Poco/RefCountedObject.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Tester.h" + + +class IAuthTester: public virtual Poco::RefCountedObject +{ +public: + using Ptr = Poco::AutoPtr; + + IAuthTester(); + /// Creates a IAuthTester. + + virtual ~IAuthTester(); + /// Destroys the IAuthTester. + + virtual Object get(int id, const std::string& options = std::string("none")) = 0; + + virtual Object post(int id, const Object& object) = 0; + + static const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId(); + /// Returns the TypeId of the class. + +}; + + + + +#endif // IAuthTester_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/ITester.cpp b/RemotingNG/REST/testsuite/src/ITester.cpp new file mode 100644 index 0000000000..6588bc9828 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/ITester.cpp @@ -0,0 +1,33 @@ +// +// ITester.cpp +// +// Package: Generated +// Module: ITester +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "ITester.h" + + +ITester::ITester(): + Poco::RefCountedObject() + +{ +} + + +ITester::~ITester() +{ +} + + +const Poco::RemotingNG::Identifiable::TypeId& ITester::remoting__typeId() +{ + static const std::string REMOTING__TYPE_ID("Tester"); + return REMOTING__TYPE_ID; +} + + diff --git a/RemotingNG/REST/testsuite/src/ITester.h b/RemotingNG/REST/testsuite/src/ITester.h new file mode 100644 index 0000000000..dab53bbae3 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/ITester.h @@ -0,0 +1,50 @@ +// +// ITester.h +// +// Package: Generated +// Module: ITester +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef ITester_INCLUDED +#define ITester_INCLUDED + + +#include "Poco/AutoPtr.h" +#include "Poco/RefCountedObject.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Tester.h" + + +class ITester: public virtual Poco::RefCountedObject +{ +public: + using Ptr = Poco::AutoPtr; + + ITester(); + /// Creates a ITester. + + virtual ~ITester(); + /// Destroys the ITester. + + virtual void delete_(int id) = 0; + + virtual Object get(int id, const std::string& options = std::string("none")) = 0; + + virtual Object post(int id, const Object& object) = 0; + + virtual Object put(int id, const Object& object) = 0; + + static const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId(); + /// Returns the TypeId of the class. + +}; + + + + +#endif // ITester_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/JSONDeserializerTest.cpp b/RemotingNG/REST/testsuite/src/JSONDeserializerTest.cpp new file mode 100644 index 0000000000..09e1cf53c1 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/JSONDeserializerTest.cpp @@ -0,0 +1,331 @@ +// +// JSONDeserializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "JSONDeserializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/Deserializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include + + +using namespace Poco::RemotingNG::REST; + + +JSONDeserializerTest::JSONDeserializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +JSONDeserializerTest::~JSONDeserializerTest() +{ +} + + +void JSONDeserializerTest::testError() +{ + std::string reply( + "{\n" + "\t\"error\": \"Exception\",\n" + "\t\"detail\": \"Detail Text\",\n" + "\t\"code\": 1234\n" + "}\n" + ); + + try + { + std::istringstream istr(reply); + JSONDeserializer deser(istr); + deser.deserializeError("Internal Server Error", 500); + deser.deserializeMessageEnd("test", Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + fail("must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.code() == 500); + assert (exc.message() == "Internal Server Error: Exception: Detail Text"); + } +} + + +void JSONDeserializerTest::testObject() +{ + std::string object( + "{\n" + "\t\"value\": \"foo\"\n" + "}" + ); + + std::istringstream istr(object); + JSONDeserializer deser(istr); + deser.deserializeStructBegin("", true); + std::string value; + bool ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "foo"); + deser.deserializeStructEnd(""); +} + + +void JSONDeserializerTest::testUnexpectedArray() +{ + std::string array( + "[\n" + "\t\"foo\"\n" + "]" + ); + + std::istringstream istr(array); + JSONDeserializer deser(istr); + try + { + deser.deserializeStructBegin("", true); + fail("expects object - must throw"); + } + catch (Poco::RemotingNG::DeserializerException&) + { + } +} + + +void JSONDeserializerTest::testArray() +{ + std::string array( + "[\n" + "\t\"foo\",\n" + "\t\"bar\"\n" + "]" + ); + + std::istringstream istr(array); + JSONDeserializer deser(istr); + Poco::UInt32 length; + deser.deserializeSequenceBegin("", true, length); + assert (length == 2); + std::string value; + bool ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "foo"); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "bar"); + deser.deserializeSequenceEnd(""); +} + + +void JSONDeserializerTest::testUnexpectedObject() +{ + std::string object( + "{\n" + "\t\"value\": \"foo\"\n" + "}" + ); + + std::istringstream istr(object); + JSONDeserializer deser(istr); + Poco::UInt32 length; + try + { + deser.deserializeSequenceBegin("", true, length); + fail ("expected array - must throw"); + } + catch (Poco::RemotingNG::DeserializerException&) + { + } +} + + +void JSONDeserializerTest::testComplexObject() +{ + std::string object( + "{\n" + "\t\"object\":\n" + "\t{\n" + "\t\t\"string\": \"foo\",\n" + "\t\t\"number\": 42,\n" + "\t\t\"boolean\": true\n" + "\t},\n" + "\t\"array\":\n" + "\t[\n" + "\t\t\"foo\",\n" + "\t\t\"bar\"\n" + "\t]\n" + "}" + ); + + std::istringstream istr(object); + JSONDeserializer deser(istr); + deser.deserializeStructBegin("", true); + deser.deserializeStructBegin("object", true); + std::string value; + bool ok = deser.deserialize("string", true, value); + assert (ok); + assert (value == "foo"); + int number; + ok = deser.deserialize("number", true, number); + assert (ok); + assert (number == 42); + bool boolean; + ok = deser.deserialize("boolean", true, boolean); + assert (ok); + assert (boolean == true); + deser.deserializeStructEnd("object"); + Poco::UInt32 length; + deser.deserializeSequenceBegin("array", true, length); + assert (length == 2); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "foo"); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "bar"); + deser.deserializeSequenceEnd("array"); + deser.deserializeStructEnd(""); +} + + +void JSONDeserializerTest::testComplexArray() +{ + std::string array( + "[\n" + "\t[\n" + "\t\t\"foo\"\n" + "\t],\n" + "\t[\n" + "\t\t\"f00\",\n" + "\t\t\"bar\",\n" + "\t\t\"baz\"\n" + "\t]\n" + "]" + ); + + std::istringstream istr(array); + JSONDeserializer deser(istr); + Poco::UInt32 length; + deser.deserializeSequenceBegin("", true, length); + assert (length == 2); + deser.deserializeSequenceBegin("array", true, length); + assert (length == 1); + std::string value; + bool ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "foo"); + deser.deserializeSequenceEnd("array"); + + deser.deserializeSequenceBegin("array", true, length); + assert (length == 3); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "f00"); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "bar"); + ok = deser.deserialize("value", true, value); + assert (ok); + assert (value == "baz"); + deser.deserializeSequenceEnd("array"); + deser.deserializeSequenceEnd(""); +} + + +void JSONDeserializerTest::testScalarBool() +{ + std::string scalar("true"); + + std::istringstream istr(scalar); + JSONDeserializer deser(istr); + bool value; + bool ok = deser.deserialize("", true, value); + assert (ok); + assert (value); +} + + +void JSONDeserializerTest::testScalarInt() +{ + std::string scalar("42"); + + std::istringstream istr(scalar); + JSONDeserializer deser(istr); + int value; + bool ok = deser.deserialize("", true, value); + assert (ok); + assert (value == 42); +} + + +void JSONDeserializerTest::testScalarString() +{ + std::string scalar("\"Hello, world!\""); + + std::istringstream istr(scalar); + JSONDeserializer deser(istr); + std::string value; + bool ok = deser.deserialize("", true, value); + assert (ok); + assert (value == "Hello, world!"); +} + + +void JSONDeserializerTest::testNullValue() +{ + std::string object( + "{\n" + "\t\"value\": null\n" + "}" + ); + + std::istringstream istr(object); + JSONDeserializer deser(istr); + deser.deserializeStructBegin("", true); + std::string value; + try + { + (void) deser.deserialize("value", true, value); + fail("null value, must throw"); + } + catch (Poco::NullValueException& exc) + { + assert (exc.message() == "value"); + } + deser.deserializeStructEnd(""); +} + + +void JSONDeserializerTest::setUp() +{ +} + + +void JSONDeserializerTest::tearDown() +{ +} + + +CppUnit::Test* JSONDeserializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("JSONDeserializerTest"); + + CppUnit_addTest(pSuite, JSONDeserializerTest, testError); + CppUnit_addTest(pSuite, JSONDeserializerTest, testObject); + CppUnit_addTest(pSuite, JSONDeserializerTest, testUnexpectedArray); + CppUnit_addTest(pSuite, JSONDeserializerTest, testArray); + CppUnit_addTest(pSuite, JSONDeserializerTest, testUnexpectedObject); + CppUnit_addTest(pSuite, JSONDeserializerTest, testComplexObject); + CppUnit_addTest(pSuite, JSONDeserializerTest, testComplexArray); + CppUnit_addTest(pSuite, JSONDeserializerTest, testScalarBool); + CppUnit_addTest(pSuite, JSONDeserializerTest, testScalarInt); + CppUnit_addTest(pSuite, JSONDeserializerTest, testScalarString); + CppUnit_addTest(pSuite, JSONDeserializerTest, testNullValue); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/JSONDeserializerTest.h b/RemotingNG/REST/testsuite/src/JSONDeserializerTest.h new file mode 100644 index 0000000000..a789b3a014 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/JSONDeserializerTest.h @@ -0,0 +1,50 @@ +// +// JSONDeserializerTest.h +// +// Definition of the JSONDeserializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef JSONDeserializerTest_INCLUDED +#define JSONDeserializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class JSONDeserializerTest: public CppUnit::TestCase +{ +public: + JSONDeserializerTest(const std::string& name); + ~JSONDeserializerTest(); + + void testError(); + void testObject(); + void testUnexpectedArray(); + void testArray(); + void testUnexpectedObject(); + void testComplexObject(); + void testComplexArray(); + void testScalarBool(); + void testScalarInt(); + void testScalarString(); + void testNullValue(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // JSONDeserializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/JSONParserTest.cpp b/RemotingNG/REST/testsuite/src/JSONParserTest.cpp new file mode 100644 index 0000000000..a92b52cb42 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/JSONParserTest.cpp @@ -0,0 +1,356 @@ +// +// JSONParserTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "JSONParserTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/JSONParser.h" +#include + + +using namespace Poco::RemotingNG::REST; + + +JSONParserTest::JSONParserTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +JSONParserTest::~JSONParserTest() +{ +} + + +void JSONParserTest::testNull() +{ + std::string json("null"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue.isNull()); +} + + +void JSONParserTest::testNullWithWhitespace() +{ + std::string json(" null "); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue.isNull()); +} + + +void JSONParserTest::testInt() +{ + std::string json("42"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->asInt32() == 42); +} + + +void JSONParserTest::testIntWithWhitespace() +{ + std::string json(" 42 "); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->asInt32() == 42); +} + + +void JSONParserTest::testBool() +{ + std::string json("true"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->asBool()); +} + + +void JSONParserTest::testBoolWithWhitespace() +{ + std::string json(" false"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (!pValue->asBool()); +} + + +void JSONParserTest::testDouble() +{ + std::string json("42.5"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->asDouble() == 42.5); +} + + +void JSONParserTest::testDoubleWithWhitespace() +{ + std::string json(" 42.5"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->asDouble() == 42.5); +} + + +void JSONParserTest::testString() +{ + std::string json("\"abcde\\tfgh\\f\\r\\nijk\\blmn\\u0040opq\""); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->stringValue() == "abcde\tfgh\f\r\nijk\blmn@opq"); +} + + +void JSONParserTest::testStringWithWhitespace() +{ + std::string json(" \"abcde\\tfgh\\f\\r\\nijk\\blmn\\u0040\\u0041\\u0020opq\" "); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->stringValue() == "abcde\tfgh\f\r\nijk\blmn@A opq"); +} + + +void JSONParserTest::testEmptyObject() +{ + std::string json("{}"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 0); +} + + +void JSONParserTest::testEmptyObjectWithWhitespace() +{ + std::string json(" { \r\n } "); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 0); +} + + +void JSONParserTest::testObject1() +{ + std::string json( + "{\n" + "\t\"f1\": 42\n" + "}" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 1); + assert ((*pValue)["f1"]->asInt32() == 42); +} + + +void JSONParserTest::testObject2() +{ + std::string json( + "{\n" + "\t\"f1\": 42,\n" + "\t\"f2\": \"foo\"\n" + "}" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 2); + assert ((*pValue)["f1"]->asInt32() == 42); + assert ((*pValue)["f2"]->stringValue() == "foo"); +} + + +void JSONParserTest::testObject3() +{ + std::string json( + "{" + "\"f1\":42," + "\"f2\":\"foo\"," + "\"f3\":null" + "}" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 3); + assert ((*pValue)["f1"]->asInt32() == 42); + assert ((*pValue)["f2"]->stringValue() == "foo"); + assert ((*pValue)["f3"].isNull()); +} + + +void JSONParserTest::testEmptyArray() +{ + std::string json("[]"); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_ARRAY); + assert (pValue->size() == 0); +} + + +void JSONParserTest::testEmptyArrayWithWhitespace() +{ + std::string json(" [ \r\n ] "); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_ARRAY); + assert (pValue->size() == 0); +} + + +void JSONParserTest::testArray1() +{ + std::string json( + "[\n" + "\t42\n" + "]" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_ARRAY); + assert (pValue->size() == 1); + assert ((*pValue)[0]->asInt32() == 42); +} + + +void JSONParserTest::testArray2() +{ + std::string json( + "[\n" + "\t42,\n" + "\t2112\n" + "]" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_ARRAY); + assert (pValue->size() == 2); + assert ((*pValue)[0]->asInt32() == 42); + assert ((*pValue)[1]->asInt32() == 2112); +} + + +void JSONParserTest::testArray3() +{ + std::string json( + "[" + "42," + "2112," + "90125" + "]" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_ARRAY); + assert (pValue->size() == 3); + assert ((*pValue)[0]->asInt32() == 42); + assert ((*pValue)[1]->asInt32() == 2112); + assert ((*pValue)[2]->asInt32() == 90125); +} + + +void JSONParserTest::testComplexObject() +{ + std::string json( + "{" + "\"f1\":42," + "\"f2\":\"foo\"," + "\"f3\":[1,2,3]," + "\"f4\":{\"f41\":1,\"f42\":2}," + "\"f5\":[{\"f51\":1,\"f52\":2}]" + "}" + ); + std::istringstream istr(json); + JSONParser jp(istr); + JSValue::Ptr pValue = jp.parse(); + assert (pValue->type() == JSValue::JS_OBJECT); + assert (pValue->size() == 5); + assert ((*pValue)["f1"]->asInt32() == 42); + assert ((*pValue)["f2"]->stringValue() == "foo"); + assert ((*pValue)["f3"]->type() == JSValue::JS_ARRAY); + assert ((*pValue)["f3"]->size() == 3); + assert ((*(*pValue)["f3"])[0]->asInt32() == 1); + assert ((*(*pValue)["f3"])[1]->asInt32() == 2); + assert ((*(*pValue)["f3"])[2]->asInt32() == 3); + assert ((*pValue)["f4"]->type() == JSValue::JS_OBJECT); + assert ((*pValue)["f4"]->size() == 2); + assert ((*(*pValue)["f4"])["f41"]->asInt32() == 1); + assert ((*(*pValue)["f4"])["f42"]->asInt32() == 2); + assert ((*pValue)["f5"]->type() == JSValue::JS_ARRAY); + assert ((*pValue)["f5"]->size() == 1); + assert ((*(*(*pValue)["f5"])[0])["f51"]->asInt32() == 1); + assert ((*(*(*pValue)["f5"])[0])["f52"]->asInt32() == 2); +} + + +void JSONParserTest::setUp() +{ +} + + +void JSONParserTest::tearDown() +{ +} + + +CppUnit::Test* JSONParserTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("JSONParserTest"); + + CppUnit_addTest(pSuite, JSONParserTest, testNull); + CppUnit_addTest(pSuite, JSONParserTest, testNullWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testInt); + CppUnit_addTest(pSuite, JSONParserTest, testIntWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testBool); + CppUnit_addTest(pSuite, JSONParserTest, testBoolWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testDouble); + CppUnit_addTest(pSuite, JSONParserTest, testDoubleWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testString); + CppUnit_addTest(pSuite, JSONParserTest, testStringWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testEmptyObject); + CppUnit_addTest(pSuite, JSONParserTest, testEmptyObjectWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testObject1); + CppUnit_addTest(pSuite, JSONParserTest, testObject2); + CppUnit_addTest(pSuite, JSONParserTest, testObject3); + CppUnit_addTest(pSuite, JSONParserTest, testEmptyArray); + CppUnit_addTest(pSuite, JSONParserTest, testEmptyArrayWithWhitespace); + CppUnit_addTest(pSuite, JSONParserTest, testArray1); + CppUnit_addTest(pSuite, JSONParserTest, testArray2); + CppUnit_addTest(pSuite, JSONParserTest, testArray3); + CppUnit_addTest(pSuite, JSONParserTest, testComplexObject); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/JSONParserTest.h b/RemotingNG/REST/testsuite/src/JSONParserTest.h new file mode 100644 index 0000000000..60f2b21297 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/JSONParserTest.h @@ -0,0 +1,60 @@ +// +// JSONParserTest.h +// +// Definition of the JSONParserTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef JSONParserTest_INCLUDED +#define JSONParserTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class JSONParserTest: public CppUnit::TestCase +{ +public: + JSONParserTest(const std::string& name); + ~JSONParserTest(); + + void testNull(); + void testNullWithWhitespace(); + void testInt(); + void testIntWithWhitespace(); + void testBool(); + void testBoolWithWhitespace(); + void testDouble(); + void testDoubleWithWhitespace(); + void testString(); + void testStringWithWhitespace(); + void testEmptyObject(); + void testEmptyObjectWithWhitespace(); + void testObject1(); + void testObject2(); + void testObject3(); + void testEmptyArray(); + void testEmptyArrayWithWhitespace(); + void testArray1(); + void testArray2(); + void testArray3(); + void testComplexObject(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // JSONParserTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/JSONSerializerTest.cpp b/RemotingNG/REST/testsuite/src/JSONSerializerTest.cpp new file mode 100644 index 0000000000..cca1c2361e --- /dev/null +++ b/RemotingNG/REST/testsuite/src/JSONSerializerTest.cpp @@ -0,0 +1,219 @@ +// +// JSONSerializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "JSONSerializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/JSONSerializer.h" +#include + + +using namespace Poco::RemotingNG::REST; +using namespace std::string_literals; + + +JSONSerializerTest::JSONSerializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +JSONSerializerTest::~JSONSerializerTest() +{ +} + + +void JSONSerializerTest::testError() +{ + std::string expectedResult( + "{\n" + "\t\"error\": \"Syntax error\",\n" + "\t\"detail\": \"Testing\",\n" + "\t\"code\": 1234\n" + "}\n" + ); + + std::ostringstream ostr; + JSONSerializer ser(ostr); + Poco::SyntaxException exc("Testing"s, 1234); + ser.serializeFaultMessage(""s, exc); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void JSONSerializerTest::testObject() +{ + std::string expectedResult( + "{\n" + "\t\"value\": \"foo\"\n" + "}" + ); + + std::ostringstream ostr; + JSONSerializer ser(ostr); + ser.serializeStructBegin(""s); + ser.serialize("value"s, "foo"s); + ser.serializeStructEnd(""s); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void JSONSerializerTest::testArray() +{ + std::string expectedResult( + "[\n" + "\t\"foo\",\n" + "\t\"bar\"\n" + "]" + ); + + std::ostringstream ostr; + JSONSerializer ser(ostr); + ser.serializeSequenceBegin(""s, 0); + ser.serialize("value"s, "foo"s); + ser.serialize("value"s, "bar"s); + ser.serializeSequenceEnd(""s); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void JSONSerializerTest::testComplexObject() +{ + std::string expectedResult( + "{\n" + "\t\"object\":\n" + "\t{\n" + "\t\t\"string\": \"foo\",\n" + "\t\t\"number\": 12345,\n" + "\t\t\"boolean\": true\n" + "\t},\n" + "\t\"array\":\n" + "\t[\n" + "\t\t\"foo\",\n" + "\t\t\"bar\"\n" + "\t]\n" + "}" + ); + + std::ostringstream ostr; + JSONSerializer ser(ostr); + ser.serializeStructBegin(""s); + ser.serializeStructBegin("object"s); + ser.serialize("string"s, "foo"s); + ser.serialize("number"s, static_cast(12345)); + ser.serialize("boolean"s, true); + ser.serializeStructEnd("object"s); + ser.serializeSequenceBegin("array"s, 0); + ser.serialize("value"s, "foo"s); + ser.serialize("value"s, "bar"s); + ser.serializeSequenceEnd("array"s); + ser.serializeStructEnd(""s); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void JSONSerializerTest::testComplexArray() +{ + std::string expectedResult( + "[\n" + "\t[\n" + "\t\t\"foo\",\n" + "\t\t\"bar\"\n" + "\t],\n" + "\t[\n" + "\t\t\"f00\",\n" + "\t\t\"baz\"\n" + "\t]\n" + "]" + ); + + std::ostringstream ostr; + JSONSerializer ser(ostr); + ser.serializeSequenceBegin(""s, 0); + ser.serializeSequenceBegin("array"s, 0); + ser.serialize("value"s, "foo"s); + ser.serialize("value"s, "bar"s); + ser.serializeSequenceEnd("array"s); + ser.serializeSequenceBegin("array"s, 0); + ser.serialize("value"s, "f00"s); + ser.serialize("value"s, "baz"s); + ser.serializeSequenceEnd("array"s); + ser.serializeSequenceEnd(""s); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void JSONSerializerTest::testScalarBool() +{ + std::string expectedResult("true"); + + std::ostringstream ostr; + JSONSerializer ser(ostr); + ser.serialize("value"s, true); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void JSONSerializerTest::testScalarInt() +{ + std::string expectedResult("42"); + + std::ostringstream ostr; + JSONSerializer ser(ostr); + ser.serialize("value"s, 42); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void JSONSerializerTest::testScalarString() +{ + std::string expectedResult("\"Hello, world!\""); + + std::ostringstream ostr; + JSONSerializer ser(ostr); + ser.serialize("value"s, "Hello, world!"s); + std::string result = ostr.str(); + assert (result == expectedResult); +} + + +void JSONSerializerTest::setUp() +{ +} + + +void JSONSerializerTest::tearDown() +{ +} + + +CppUnit::Test* JSONSerializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("JSONSerializerTest"); + + CppUnit_addTest(pSuite, JSONSerializerTest, testError); + CppUnit_addTest(pSuite, JSONSerializerTest, testObject); + CppUnit_addTest(pSuite, JSONSerializerTest, testArray); + CppUnit_addTest(pSuite, JSONSerializerTest, testComplexObject); + CppUnit_addTest(pSuite, JSONSerializerTest, testComplexArray); + CppUnit_addTest(pSuite, JSONSerializerTest, testScalarBool); + CppUnit_addTest(pSuite, JSONSerializerTest, testScalarInt); + CppUnit_addTest(pSuite, JSONSerializerTest, testScalarString); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/JSONSerializerTest.h b/RemotingNG/REST/testsuite/src/JSONSerializerTest.h new file mode 100644 index 0000000000..0ecb49bb87 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/JSONSerializerTest.h @@ -0,0 +1,47 @@ +// +// JSONSerializerTest.h +// +// Definition of the JSONSerializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef JSONSerializerTest_INCLUDED +#define JSONSerializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class JSONSerializerTest: public CppUnit::TestCase +{ +public: + JSONSerializerTest(const std::string& name); + ~JSONSerializerTest(); + + void testError(); + void testObject(); + void testArray(); + void testComplexObject(); + void testComplexArray(); + void testScalarBool(); + void testScalarInt(); + void testScalarString(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // JSONSerializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/ObjectDeserializer.h b/RemotingNG/REST/testsuite/src/ObjectDeserializer.h new file mode 100644 index 0000000000..213104fa7f --- /dev/null +++ b/RemotingNG/REST/testsuite/src/ObjectDeserializer.h @@ -0,0 +1,57 @@ +// +// ObjectDeserializer.h +// +// Package: Generated +// Module: TypeDeserializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeDeserializer_Object_INCLUDED +#define TypeDeserializer_Object_INCLUDED + + +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeDeserializer +{ +public: + static bool deserialize(const std::string& name, bool isMandatory, Deserializer& deser, Object& value) + { + using namespace std::string_literals; + + bool ret = deser.deserializeStructBegin(name, isMandatory); + if (ret) + { + deserializeImpl(deser, value); + deser.deserializeStructEnd(name); + } + return ret; + } + + static void deserializeImpl(Deserializer& deser, Object& value) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"data"s}; + TypeDeserializer::deserialize(REMOTING__NAMES[0], true, deser, value.data); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeDeserializer_Object_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/ObjectSerializer.h b/RemotingNG/REST/testsuite/src/ObjectSerializer.h new file mode 100644 index 0000000000..e806beafee --- /dev/null +++ b/RemotingNG/REST/testsuite/src/ObjectSerializer.h @@ -0,0 +1,53 @@ +// +// ObjectSerializer.h +// +// Package: Generated +// Module: TypeSerializer +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TypeSerializer_Object_INCLUDED +#define TypeSerializer_Object_INCLUDED + + +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Tester.h" + + +namespace Poco { +namespace RemotingNG { + + +template <> +class TypeSerializer +{ +public: + static void serialize(const std::string& name, const Object& value, Serializer& ser) + { + using namespace std::string_literals; + + ser.serializeStructBegin(name); + serializeImpl(value, ser); + ser.serializeStructEnd(name); + } + + static void serializeImpl(const Object& value, Serializer& ser) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"data"s,""s}; + TypeSerializer::serialize(REMOTING__NAMES[0], value.data, ser); + } + +}; + + +} // namespace RemotingNG +} // namespace Poco + + +#endif // TypeSerializer_Object_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/PathDeserializerTest.cpp b/RemotingNG/REST/testsuite/src/PathDeserializerTest.cpp new file mode 100644 index 0000000000..90483881bf --- /dev/null +++ b/RemotingNG/REST/testsuite/src/PathDeserializerTest.cpp @@ -0,0 +1,144 @@ +// +// PathDeserializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "PathDeserializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/PathDeserializer.h" +#include + + +using namespace Poco::RemotingNG::REST; + + +PathDeserializerTest::PathDeserializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +PathDeserializerTest::~PathDeserializerTest() +{ +} + + +void PathDeserializerTest::testParams() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/api/object/1234/child/foo"); + PathDeserializer deserializer("/api/object/{id}/child/{childId}", request); + + int id; + bool ok = deserializer.deserialize("id", true, id); + assert (ok); + assert (id == 1234); + + std::string childId; + ok = deserializer.deserialize("childId", true, childId); + assert (ok); + assert (childId == "foo"); +} + + +void PathDeserializerTest::testTypes() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/foo/42/false/3.5"); + PathDeserializer deserializer("/{string}/{int}/{bool}/{double}", request); + + std::string stringValue; + bool ok = deserializer.deserialize("string", true, stringValue); + assert (ok); + assert (stringValue == "foo"); + + int intValue; + ok = deserializer.deserialize("int", true, intValue); + assert (ok); + assert (intValue == 42); + + bool boolValue; + ok = deserializer.deserialize("bool", true, boolValue); + assert (ok); + assert (boolValue == false); + + double doubleValue; + ok = deserializer.deserialize("double", true, doubleValue); + assert (ok); + assert (doubleValue == 3.5); +} + + +void PathDeserializerTest::testAlternation() +{ + // Test alternation pattern: {name:(option1|option2|...)} + Poco::Net::HTTPRequest request1(Poco::Net::HTTPRequest::HTTP_GET, "/api/sql/query"); + PathDeserializer deserializer1("/api/sql/{endpoint:(query|databases|config)}", request1); + + std::string endpoint; + bool ok = deserializer1.deserialize("endpoint", true, endpoint); + assert (ok); + assert (endpoint == "query"); + + // Test with different option + Poco::Net::HTTPRequest request2(Poco::Net::HTTPRequest::HTTP_GET, "/api/sql/databases"); + PathDeserializer deserializer2("/api/sql/{endpoint:(query|databases|config)}", request2); + + ok = deserializer2.deserialize("endpoint", true, endpoint); + assert (ok); + assert (endpoint == "databases"); + + // Test with third option + Poco::Net::HTTPRequest request3(Poco::Net::HTTPRequest::HTTP_GET, "/api/sql/config"); + PathDeserializer deserializer3("/api/sql/{endpoint:(query|databases|config)}", request3); + + ok = deserializer3.deserialize("endpoint", true, endpoint); + assert (ok); + assert (endpoint == "config"); +} + + +void PathDeserializerTest::testAlternationMultiple() +{ + // Test alternation with regular placeholder + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/devs/sql/query/1234"); + PathDeserializer deserializer("/devs/sql/{endpoint:(query|databases|config)}/{id}", request); + + std::string endpoint; + bool ok = deserializer.deserialize("endpoint", true, endpoint); + assert (ok); + assert (endpoint == "query"); + + int id; + ok = deserializer.deserialize("id", true, id); + assert (ok); + assert (id == 1234); +} + + +void PathDeserializerTest::setUp() +{ +} + + +void PathDeserializerTest::tearDown() +{ +} + + +CppUnit::Test* PathDeserializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("PathDeserializerTest"); + + CppUnit_addTest(pSuite, PathDeserializerTest, testParams); + CppUnit_addTest(pSuite, PathDeserializerTest, testTypes); + CppUnit_addTest(pSuite, PathDeserializerTest, testAlternation); + CppUnit_addTest(pSuite, PathDeserializerTest, testAlternationMultiple); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/PathDeserializerTest.h b/RemotingNG/REST/testsuite/src/PathDeserializerTest.h new file mode 100644 index 0000000000..89d40978c6 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/PathDeserializerTest.h @@ -0,0 +1,43 @@ +// +// PathDeserializerTest.h +// +// Definition of the PathDeserializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef PathDeserializerTest_INCLUDED +#define PathDeserializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class PathDeserializerTest: public CppUnit::TestCase +{ +public: + PathDeserializerTest(const std::string& name); + ~PathDeserializerTest(); + + void testParams(); + void testTypes(); + void testAlternation(); + void testAlternationMultiple(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // PathDeserializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/PathSerializerTest.cpp b/RemotingNG/REST/testsuite/src/PathSerializerTest.cpp new file mode 100644 index 0000000000..8ba23df53f --- /dev/null +++ b/RemotingNG/REST/testsuite/src/PathSerializerTest.cpp @@ -0,0 +1,118 @@ +// +// PathSerializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "PathSerializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/PathSerializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include + + +using namespace Poco::RemotingNG::REST; +using namespace std::string_literals; + + +PathSerializerTest::PathSerializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +PathSerializerTest::~PathSerializerTest() +{ +} + + +void PathSerializerTest::testParams() +{ + Poco::Net::HTTPRequest request; + PathSerializer serializer("/api/object/{id}/child/{childId}"s, request); + serializer.serialize("id"s, 1234); + serializer.serialize("childId"s, "foo"s); + serializer.close(); + assert (request.getURI() == "/api/object/1234/child/foo"); +} + + +void PathSerializerTest::testParamsPreserveQuery() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/?query=bar"s); + PathSerializer serializer("/api/object/{id}/child/{childId}"s, request); + serializer.serialize("id"s, 1234); + serializer.serialize("childId"s, "foo"s); + serializer.close(); + assert (request.getURI() == "/api/object/1234/child/foo?query=bar"); +} + + +void PathSerializerTest::testParamsMissing() +{ + Poco::Net::HTTPRequest request; + PathSerializer serializer("/api/object/{id}/child/{childId}"s, request); + serializer.serialize("childId"s, "foo"s); + try + { + serializer.close(); + fail("missing param - must throw"); + } + catch (Poco::RemotingNG::SerializerException&) + { + } +} + + +void PathSerializerTest::testTypes() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/"s); + PathSerializer serializer("/{string}/{int}/{bool}/{double}"s, request); + serializer.serialize("string"s, "foo"s); + serializer.serialize("int"s, static_cast(42)); + serializer.serialize("bool"s, false); + serializer.serialize("double"s, 3.5); + serializer.close(); + assert (request.getURI() == "/foo/42/false/3.5"); +} + + +void PathSerializerTest::testEscaping() +{ + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/"s); + PathSerializer serializer("/{string1}/{string2}"s, request); + serializer.serialize("string1"s, "foo/bar"s); + serializer.serialize("string2"s, "a+b+c%d"s); + serializer.close(); + assert (request.getURI() == "/foo/bar/a+b+c%25d"); +} + + +void PathSerializerTest::setUp() +{ +} + + +void PathSerializerTest::tearDown() +{ +} + + +CppUnit::Test* PathSerializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("PathSerializerTest"); + + CppUnit_addTest(pSuite, PathSerializerTest, testParams); + CppUnit_addTest(pSuite, PathSerializerTest, testParamsPreserveQuery); + CppUnit_addTest(pSuite, PathSerializerTest, testParamsMissing); + CppUnit_addTest(pSuite, PathSerializerTest, testTypes); + CppUnit_addTest(pSuite, PathSerializerTest, testEscaping); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/PathSerializerTest.h b/RemotingNG/REST/testsuite/src/PathSerializerTest.h new file mode 100644 index 0000000000..84e76402e8 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/PathSerializerTest.h @@ -0,0 +1,44 @@ +// +// PathSerializerTest.h +// +// Definition of the PathSerializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef PathSerializerTest_INCLUDED +#define PathSerializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class PathSerializerTest: public CppUnit::TestCase +{ +public: + PathSerializerTest(const std::string& name); + ~PathSerializerTest(); + + void testParams(); + void testParamsPreserveQuery(); + void testParamsMissing(); + void testTypes(); + void testEscaping(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // PathSerializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/RESTTestSuite.cpp b/RemotingNG/REST/testsuite/src/RESTTestSuite.cpp new file mode 100644 index 0000000000..e56ef6af47 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/RESTTestSuite.cpp @@ -0,0 +1,55 @@ +// +// RESTTestSuite.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "RESTTestSuite.h" +#include "JSONParserTest.h" +#include "JSONSerializerTest.h" +#include "JSONDeserializerTest.h" +#include "PathSerializerTest.h" +#include "PathDeserializerTest.h" +#include "HeaderSerializerTest.h" +#include "HeaderDeserializerTest.h" +#include "FormSerializerTest.h" +#include "FormDeserializerTest.h" +#include "RawSerializerTest.h" +#include "RawDeserializerTest.h" +#include "SerializerTest.h" +#include "DeserializerTest.h" +#include "RemotingTest.h" + + +CppUnit::Test* RESTTestSuite::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RESTTestSuite"); + + pSuite->addTest(JSONParserTest::suite()); + pSuite->addTest(JSONSerializerTest::suite()); + pSuite->addTest(JSONDeserializerTest::suite()); + pSuite->addTest(PathSerializerTest::suite()); + pSuite->addTest(PathDeserializerTest::suite()); + pSuite->addTest(HeaderSerializerTest::suite()); + pSuite->addTest(HeaderDeserializerTest::suite()); + pSuite->addTest(FormSerializerTest::suite()); + pSuite->addTest(FormDeserializerTest::suite()); + pSuite->addTest(RawSerializerTest::suite()); + pSuite->addTest(RawDeserializerTest::suite()); + pSuite->addTest(SerializerTest::suite()); + pSuite->addTest(DeserializerTest::suite()); + pSuite->addTest(RemotingTestREST::suite()); + pSuite->addTest(RemotingTestRESTChunked::suite()); + pSuite->addTest(RemotingTestRESTCompressed::suite()); + pSuite->addTest(RemotingTestRESTChunkedCompressed::suite()); + pSuite->addTest(RemotingTestRESTAuth::suite()); + pSuite->addTest(RemotingTestAuth::suite()); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/RESTTestSuite.h b/RemotingNG/REST/testsuite/src/RESTTestSuite.h new file mode 100644 index 0000000000..a84f09c9ce --- /dev/null +++ b/RemotingNG/REST/testsuite/src/RESTTestSuite.h @@ -0,0 +1,29 @@ +// +// RESTTestSuite.h +// +// Definition of the RESTTestSuite class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RESTTestSuite_INCLUDED +#define RESTTestSuite_INCLUDED + + +#include "CppUnit/TestSuite.h" + + +class RESTTestSuite +{ +public: + static CppUnit::Test* suite(); +}; + + +#endif // RESTTestSuite_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/RawDeserializerTest.cpp b/RemotingNG/REST/testsuite/src/RawDeserializerTest.cpp new file mode 100644 index 0000000000..ca2f3cc5b3 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/RawDeserializerTest.cpp @@ -0,0 +1,97 @@ +// +// RawDeserializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "RawDeserializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/RawDeserializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/StreamCopier.h" +#include + + +using namespace Poco::RemotingNG::REST; + + +RawDeserializerTest::RawDeserializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +RawDeserializerTest::~RawDeserializerTest() +{ +} + + +void RawDeserializerTest::testInt() +{ + int id = 1234; + std::stringstream stream; + stream << id; + RawDeserializer deserializer(stream); + + int i; + bool ok = deserializer.deserialize("id", true, i); + assert (ok); + assert (i == id); +} + + +void RawDeserializerTest::testString() +{ + std::string text = "The quick brown fox jumps over the lazy dog."; + std::stringstream stream; + stream << text; + RawDeserializer deserializer(stream); + + std::string s; + bool ok = deserializer.deserialize("text", true, s); + assert (ok); + assert (s == text); +} + + +void RawDeserializerTest::testBinary() +{ + std::vector binary; + for (char c = 0; c < 127; c++) binary.push_back(c); + std::stringstream stream; + stream.write(&binary[0], static_cast(binary.size())); + RawDeserializer deserializer(stream); + + std::vector v; + bool ok = deserializer.deserialize("binary", true, v); + assert (ok); + assert (v == binary); +} + + +void RawDeserializerTest::setUp() +{ +} + + +void RawDeserializerTest::tearDown() +{ +} + + +CppUnit::Test* RawDeserializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RawDeserializerTest"); + + CppUnit_addTest(pSuite, RawDeserializerTest, testInt); + CppUnit_addTest(pSuite, RawDeserializerTest, testString); + CppUnit_addTest(pSuite, RawDeserializerTest, testBinary); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/RawDeserializerTest.h b/RemotingNG/REST/testsuite/src/RawDeserializerTest.h new file mode 100644 index 0000000000..e3207533df --- /dev/null +++ b/RemotingNG/REST/testsuite/src/RawDeserializerTest.h @@ -0,0 +1,42 @@ +// +// RawDeserializerTest.h +// +// Definition of the RawDeserializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RawDeserializerTest_INCLUDED +#define RawDeserializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class RawDeserializerTest: public CppUnit::TestCase +{ +public: + RawDeserializerTest(const std::string& name); + ~RawDeserializerTest(); + + void testInt(); + void testString(); + void testBinary(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // RawDeserializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/RawSerializerTest.cpp b/RemotingNG/REST/testsuite/src/RawSerializerTest.cpp new file mode 100644 index 0000000000..56813062a5 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/RawSerializerTest.cpp @@ -0,0 +1,97 @@ +// +// RawSerializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "RawSerializerTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/RawSerializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/StreamCopier.h" +#include + + +using namespace Poco::RemotingNG::REST; +using namespace std::string_literals; + + +RawSerializerTest::RawSerializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +RawSerializerTest::~RawSerializerTest() +{ +} + + +void RawSerializerTest::testInt() +{ + int id = 1234; + std::stringstream stream; + RawSerializer serializer(stream); + serializer.serialize("id"s, id); + int i = 0; + stream >> i; + assert (i == id); +} + + +void RawSerializerTest::testString() +{ + std::string text = "The quick brown fox jumps over the lazy dog."; + std::stringstream stream; + RawSerializer serializer(stream); + serializer.serialize("text"s, text); + std::string s; + Poco::StreamCopier::copyToString(stream, s); + assert (s == text); +} + + +void RawSerializerTest::testBinary() +{ + std::vector binary; + for (char c = 0; c < 127; c++) binary.push_back(c); + std::stringstream stream; + RawSerializer serializer(stream); + serializer.serialize("binary"s, binary); + std::vector v; + int ch = stream.get(); + while (ch != -1) + { + v.push_back(static_cast(ch)); + ch = stream.get(); + } + assert (v == binary); +} + + +void RawSerializerTest::setUp() +{ +} + + +void RawSerializerTest::tearDown() +{ +} + + +CppUnit::Test* RawSerializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RawSerializerTest"); + + CppUnit_addTest(pSuite, RawSerializerTest, testInt); + CppUnit_addTest(pSuite, RawSerializerTest, testString); + CppUnit_addTest(pSuite, RawSerializerTest, testBinary); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/RawSerializerTest.h b/RemotingNG/REST/testsuite/src/RawSerializerTest.h new file mode 100644 index 0000000000..39e41f0509 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/RawSerializerTest.h @@ -0,0 +1,42 @@ +// +// RawSerializerTest.h +// +// Definition of the RawSerializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RawSerializerTest_INCLUDED +#define RawSerializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class RawSerializerTest: public CppUnit::TestCase +{ +public: + RawSerializerTest(const std::string& name); + ~RawSerializerTest(); + + void testInt(); + void testString(); + void testBinary(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // RawSerializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/RemotingTest.cpp b/RemotingNG/REST/testsuite/src/RemotingTest.cpp new file mode 100644 index 0000000000..3dcb0a82a1 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/RemotingTest.cpp @@ -0,0 +1,762 @@ +// +// RemotingTest.cpp +// +// Copyright (c) 2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "RemotingTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/Transport.h" +#include "Poco/RemotingNG/TransportFactory.h" +#include "Poco/RemotingNG/TransportFactoryManager.h" +#include "Poco/RemotingNG/Skeleton.h" +#include "Poco/RemotingNG/ORB.h" +#include "Poco/RemotingNG/Context.h" +#include "Poco/RemotingNG/REST/Transport.h" +#include "Poco/RemotingNG/REST/TransportFactory.h" +#include "Poco/RemotingNG/REST/Listener.h" +#include "Poco/RemotingNG/REST/RESTRequestHandler.h" +#include "Poco/RemotingNG/REST/RESTServerException.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Net/HTTPServerResponse.h" +#include "Poco/Net/HTTPRequestHandlerFactory.h" +#include "Poco/Net/HTTPBasicCredentials.h" +#include "Poco/NullStream.h" +#include "Poco/StreamCopier.h" +#include "Tester.h" +#include "TesterServerHelper.h" +#include "TesterClientHelper.h" +#include "TesterRemoteObject.h" +#include "TesterProxy.h" +#include "AuthTesterServerHelper.h" +#include "AuthTesterClientHelper.h" +#include "AuthTesterRemoteObject.h" +#include "AuthTesterProxy.h" + + +namespace +{ + class NoAuthRequestHandler: public Poco::Net::HTTPRequestHandler + { + public: + void handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) + { + Poco::NullOutputStream nullStream; + Poco::StreamCopier::copyStream(request.stream(), nullStream); + response.requireAuthentication("REST"); + response.setContentLength(0); + response.send(); + } + }; + + + class RESTAuthRequestHandlerFactory: public Poco::Net::HTTPRequestHandlerFactory + { + public: + RESTAuthRequestHandlerFactory(Poco::RemotingNG::REST::Listener& listener): + _listener(listener) + { + } + + Poco::Net::HTTPRequestHandler* createRequestHandler(const Poco::Net::HTTPServerRequest& request) + { + if (request.hasCredentials()) + { + Poco::Net::HTTPBasicCredentials creds(request); + if (creds.getUsername() == "user" && creds.getPassword() == "s3cr3t") + { + return new Poco::RemotingNG::REST::RESTRequestHandler(_listener); + } + } + return new NoAuthRequestHandler; + } + + private: + Poco::RemotingNG::REST::Listener& _listener; + }; + + + class MockAuthenticator: public Poco::RemotingNG::Authenticator + { + public: + typedef Poco::AutoPtr Ptr; + + Poco::RemotingNG::AuthenticateResult authenticate(const Poco::RemotingNG::Credentials& creds, Poco::UInt32) + { + std::string username = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, ""); + std::string password = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, ""); + + _lastUsername = username; + + if ((username == "user" && password == "pass") || (username == "admin" && password == "s3cr3t")) + return Poco::RemotingNG::AuthenticateResult(Poco::RemotingNG::AuthenticateResult::AUTH_DONE, creds); + else + return Poco::RemotingNG::AuthenticateResult(Poco::RemotingNG::AuthenticateResult::AUTH_FAILED); + } + + const std::string& lastUsername() const + { + return _lastUsername; + } + + private: + std::string _lastUsername; + }; + + + class MockOAuthenticator: public Poco::RemotingNG::Authenticator + { + public: + typedef Poco::AutoPtr Ptr; + + Poco::RemotingNG::AuthenticateResult authenticate(const Poco::RemotingNG::Credentials& creds, Poco::UInt32) + { + std::string token = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_TOKEN); + if (token == "t0k3n") + return Poco::RemotingNG::AuthenticateResult(Poco::RemotingNG::AuthenticateResult::AUTH_DONE, creds); + else + return Poco::RemotingNG::AuthenticateResult(Poco::RemotingNG::AuthenticateResult::AUTH_FAILED); + } + }; + + + class MockAuthorizer: public Poco::RemotingNG::Authorizer + { + public: + bool authorize(const std::string& method, const std::string& permission) + { + Poco::RemotingNG::Context::Ptr pContext = Poco::RemotingNG::Context::get(); + + const Poco::RemotingNG::Credentials& creds = pContext->getCredentials(); + + std::string username = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_USERNAME, ""); + std::string password = creds.getAttribute(Poco::RemotingNG::Credentials::ATTR_PASSWORD, ""); + + return username == "admin"; + } + }; +} + + +RemotingTest::RemotingTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +RemotingTest::~RemotingTest() +{ +} + + +void RemotingTest::setUp() +{ + _publicURI = "http://127.0.0.1:2280/tester/{id}"; + _pListener = new Poco::RemotingNG::REST::Listener("127.0.0.1:2280"); + _pListener->enableChunkedTransferEncoding(false); + _listener = Poco::RemotingNG::ORB::instance().registerListener(_pListener); + Poco::RemotingNG::REST::TransportFactory::registerFactory(); + Poco::SharedPtr pTester = new Tester; + Poco::AutoPtr pTesterRemoteObject = TesterServerHelper::createRemoteObject(pTester, "TheTester"); + pTesterRemoteObject->remoting__setURI(Poco::URI(_publicURI)); + _objectURI = TesterServerHelper::registerRemoteObject(pTesterRemoteObject, _listener); +} + + +void RemotingTest::tearDown() +{ + TesterServerHelper::unregisterObject(_objectURI); + Poco::RemotingNG::REST::TransportFactory::unregisterFactory(); + Poco::RemotingNG::ORB::instance().unregisterListener(_listener); + _pListener = 0; +} + + +void RemotingTest::testRegistration() +{ + assert (_objectURI == "http://127.0.0.1:2280/rest/Tester/TheTester"); +} + + +void RemotingTest::testPost() +{ + ITester::Ptr pTester = createProxy(_publicURI); + + Object object; + object.data = "Object 1"; + Object result = pTester->post(1, object); + assert (result.data == object.data); +} + + +void RemotingTest::testPut() +{ + ITester::Ptr pTester = createProxy(_publicURI); + + Object object; + object.data = "Object 1"; + Object result = pTester->put(1, object); + assert (result.data == object.data); +} + + +void RemotingTest::testGet() +{ + ITester::Ptr pTester = createProxy(_publicURI); + + Object object; + object.data = "Object 1"; + Object result = pTester->put(1, object); + assert (result.data == object.data); + + Object result2 = pTester->get(1); + assert (result2.data == object.data); +} + + +void RemotingTest::testGetNotFound() +{ + ITester::Ptr pTester = createProxy(_publicURI); + + try + { + Object result2 = pTester->get(1); + fail("object not found - must throw"); + } + catch (Poco::RemotingNG::REST::RESTServerException& exc) + { + assert (exc.displayText() == "REST Server Error: Not Found: Not found"); + assert (exc.code() == 404); + + assert (exc.reason() == "Not Found"); + assert (exc.status() == 404); + assert (exc.error() == "Not found"); + assert (exc.detail() == ""); + } + catch (Poco::RemotingNG::RemoteException&) + { + fail("must throw RESTServerException"); + } +} + + +void RemotingTest::testCookie() +{ + ITester::Ptr pTester = createProxy(_publicURI); + + Object object; + pTester->put(Tester::ID_SET_COOKIE, object); + + Object result = pTester->put(Tester::ID_VERIFY_COOKIE, object); + assert (result.data == "OK"); + + Poco::Thread::sleep(6000); + result = pTester->put(Tester::ID_VERIFY_COOKIE, object); + assert (result.data == "FAIL"); +} + + +void RemotingTest::testFault() +{ + ITester::Ptr pTester = createProxy(_publicURI); + + try + { + Object object; + pTester->put(Tester::ID_FAULT, object); + fail("must throw"); + } + catch (Poco::RemotingNG::REST::RESTServerException& exc) + { + assert (exc.displayText() == "REST Server Error: Internal Server Error: Application exception: Something went wrong"); + + assert (exc.reason() == "Internal Server Error"); + assert (exc.status() == 500); + assert (exc.error() == "Application exception"); + assert (exc.detail() == "Something went wrong"); + } + catch (Poco::RemotingNG::RemoteException&) + { + fail("must throw RESTException"); + } +} + + +ITester::Ptr RemotingTest::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("rest", uri); + static_cast(pProxy->remoting__transport()).enableCompression(false); + return pProxy; +} + + +RemotingTestREST::RemotingTestREST(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestREST::~RemotingTestREST() +{ +} + + +void RemotingTestREST::setUp() +{ + RemotingTest::setUp(); + _pListener->enableCompression(false); +} + + +CppUnit::Test* RemotingTestREST::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestREST"); + + CppUnit_addTest(pSuite, RemotingTestREST, testRegistration); + CppUnit_addTest(pSuite, RemotingTestREST, testPost); + CppUnit_addTest(pSuite, RemotingTestREST, testPut); + CppUnit_addTest(pSuite, RemotingTestREST, testGet); + CppUnit_addTest(pSuite, RemotingTestREST, testGetNotFound); + CppUnit_addTest(pSuite, RemotingTestREST, testCookie); + CppUnit_addTest(pSuite, RemotingTestREST, testFault); + + return pSuite; +} + + +RemotingTestRESTCompressed::RemotingTestRESTCompressed(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestRESTCompressed::~RemotingTestRESTCompressed() +{ +} + + +void RemotingTestRESTCompressed::setUp() +{ + RemotingTest::setUp(); + _pListener->enableCompression(true); + _pListener->enableChunkedTransferEncoding(false); +} + + +ITester::Ptr RemotingTestRESTCompressed::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("rest", uri); + static_cast(pProxy->remoting__transport()).enableCompression(true); + return pProxy; +} + + +CppUnit::Test* RemotingTestRESTCompressed::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestRESTCompressed"); + + CppUnit_addTest(pSuite, RemotingTestRESTCompressed, testRegistration); + CppUnit_addTest(pSuite, RemotingTestRESTCompressed, testPost); + CppUnit_addTest(pSuite, RemotingTestRESTCompressed, testPut); + CppUnit_addTest(pSuite, RemotingTestRESTCompressed, testGet); + CppUnit_addTest(pSuite, RemotingTestRESTCompressed, testGetNotFound); + CppUnit_addTest(pSuite, RemotingTestRESTCompressed, testCookie); + CppUnit_addTest(pSuite, RemotingTestRESTCompressed, testFault); + + return pSuite; +} + + +RemotingTestRESTChunked::RemotingTestRESTChunked(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestRESTChunked::~RemotingTestRESTChunked() +{ +} + + +void RemotingTestRESTChunked::setUp() +{ + RemotingTest::setUp(); + _pListener->enableCompression(false); + _pListener->enableChunkedTransferEncoding(true); +} + + +ITester::Ptr RemotingTestRESTChunked::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("rest", uri); + static_cast(pProxy->remoting__transport()).enableCompression(true); + return pProxy; +} + + +CppUnit::Test* RemotingTestRESTChunked::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestRESTChunked"); + + CppUnit_addTest(pSuite, RemotingTestRESTChunked, testRegistration); + CppUnit_addTest(pSuite, RemotingTestRESTChunked, testPost); + CppUnit_addTest(pSuite, RemotingTestRESTChunked, testPut); + CppUnit_addTest(pSuite, RemotingTestRESTChunked, testGet); + CppUnit_addTest(pSuite, RemotingTestRESTChunked, testGetNotFound); + CppUnit_addTest(pSuite, RemotingTestRESTChunked, testCookie); + CppUnit_addTest(pSuite, RemotingTestRESTChunked, testFault); + + return pSuite; +} + + +RemotingTestRESTChunkedCompressed::RemotingTestRESTChunkedCompressed(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestRESTChunkedCompressed::~RemotingTestRESTChunkedCompressed() +{ +} + + +void RemotingTestRESTChunkedCompressed::setUp() +{ + RemotingTest::setUp(); + _pListener->enableCompression(true); + _pListener->enableChunkedTransferEncoding(true); +} + + +ITester::Ptr RemotingTestRESTChunkedCompressed::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("rest", uri); + static_cast(pProxy->remoting__transport()).enableCompression(true); + return pProxy; +} + + +CppUnit::Test* RemotingTestRESTChunkedCompressed::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestRESTChunkedCompressed"); + + CppUnit_addTest(pSuite, RemotingTestRESTChunkedCompressed, testRegistration); + CppUnit_addTest(pSuite, RemotingTestRESTChunkedCompressed, testPost); + CppUnit_addTest(pSuite, RemotingTestRESTChunkedCompressed, testPut); + CppUnit_addTest(pSuite, RemotingTestRESTChunkedCompressed, testGet); + CppUnit_addTest(pSuite, RemotingTestRESTChunkedCompressed, testGetNotFound); + CppUnit_addTest(pSuite, RemotingTestRESTChunkedCompressed, testCookie); + CppUnit_addTest(pSuite, RemotingTestRESTChunkedCompressed, testFault); + + return pSuite; +} + + +RemotingTestRESTAuth::RemotingTestRESTAuth(const std::string& name): RemotingTest(name) +{ +} + + +RemotingTestRESTAuth::~RemotingTestRESTAuth() +{ +} + + +void RemotingTestRESTAuth::setUp() +{ + _publicURI = "http://127.0.0.1:2280/tester/{id}"; + _pListener = new Poco::RemotingNG::REST::Listener("127.0.0.1:2280", Poco::RemotingNG::REST::Listener::PROTO_HTTP); + _listener = Poco::RemotingNG::ORB::instance().registerListener(_pListener); + Poco::RemotingNG::REST::TransportFactory::registerFactory(); + Poco::SharedPtr pTester = new Tester; + Poco::AutoPtr pTesterRemoteObject = TesterServerHelper::createRemoteObject(pTester, "TheTester"); + pTesterRemoteObject->remoting__setURI(Poco::URI(_publicURI)); + _objectURI = TesterServerHelper::registerRemoteObject(pTesterRemoteObject, _listener); + + Poco::Net::ServerSocket ss(2280); + _pHTTPServer = new Poco::Net::HTTPServer(new RESTAuthRequestHandlerFactory(*_pListener), ss, new Poco::Net::HTTPServerParams); + _pHTTPServer->start(); +} + + +void RemotingTestRESTAuth::tearDown() +{ + RemotingTest::tearDown(); + _pHTTPServer->stop(); + _pHTTPServer = 0; +} + + +void RemotingTestRESTAuth::testUnauthorized() +{ + ITester::Ptr pTester = createUnauthorizedProxy(_publicURI); + + try + { + pTester->get(0); + fail("Unauthorized - must throw"); + } + catch (Poco::Exception& exc) + { + assert (exc.message() == "HTTP Error: Unauthorized"); + assert (exc.code() == 401); + } +} + + +ITester::Ptr RemotingTestRESTAuth::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("rest", uri); + static_cast(pProxy->remoting__transport()).setAuthentication(Poco::RemotingNG::REST::Transport::AUTH_ANY); + static_cast(pProxy->remoting__transport()).setUsername("user"); + static_cast(pProxy->remoting__transport()).setPassword("s3cr3t"); + return pProxy; +} + + +ITester::Ptr RemotingTestRESTAuth::createUnauthorizedProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new TesterProxy("TheTester"); + pProxy->remoting__connect("rest", uri); + + return pProxy; +} + + +CppUnit::Test* RemotingTestRESTAuth::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestRESTAuth"); + + CppUnit_addTest(pSuite, RemotingTestRESTAuth, testRegistration); + CppUnit_addTest(pSuite, RemotingTestRESTAuth, testPost); + CppUnit_addTest(pSuite, RemotingTestRESTAuth, testPut); + CppUnit_addTest(pSuite, RemotingTestRESTAuth, testGet); + CppUnit_addTest(pSuite, RemotingTestRESTAuth, testGetNotFound); + CppUnit_addTest(pSuite, RemotingTestRESTAuth, testCookie); + CppUnit_addTest(pSuite, RemotingTestRESTAuth, testFault); + CppUnit_addTest(pSuite, RemotingTestRESTAuth, testUnauthorized); + + return pSuite; +} + + +RemotingTestAuth::RemotingTestAuth(const std::string& name): CppUnit::TestCase(name) +{ +} + + +RemotingTestAuth::~RemotingTestAuth() +{ +} + + +void RemotingTestAuth::setUp() +{ + _publicURI = "http://127.0.0.1:2280/authtester/{id}"; + _pListener = new Poco::RemotingNG::REST::Listener("127.0.0.1:2280"); + _pListener->enableChunkedTransferEncoding(false); + _listener = Poco::RemotingNG::ORB::instance().registerListener(_pListener); + Poco::RemotingNG::REST::TransportFactory::registerFactory(); + Poco::SharedPtr pAuthTester = new AuthTester; + Poco::AutoPtr pAuthTesterRemoteObject = AuthTesterServerHelper::createRemoteObject(pAuthTester, "TheAuthTester"); + pAuthTesterRemoteObject->remoting__setURI(Poco::URI(_publicURI)); + _objectURI = AuthTesterServerHelper::registerRemoteObject(pAuthTesterRemoteObject, _listener); +} + + +void RemotingTestAuth::tearDown() +{ + AuthTesterServerHelper::unregisterObject(_objectURI); + Poco::RemotingNG::REST::TransportFactory::unregisterFactory(); + Poco::RemotingNG::ORB::instance().unregisterListener(_listener); + _pListener = 0; +} + + +IAuthTester::Ptr RemotingTestAuth::createProxy(const std::string& uri) +{ + Poco::AutoPtr pProxy = new AuthTesterProxy("TheAuthTester"); + pProxy->remoting__connect("rest", uri); + return pProxy; +} + + +void RemotingTestAuth::testAuthenticatedGoodCredentials() +{ + IAuthTester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::REST::Transport& trans = static_cast(pProxy->remoting__transport()); + + trans.setUsername("user"); + trans.setPassword("pass"); + trans.setAuthentication(Poco::RemotingNG::REST::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + + pTester->get(1); +} + + +void RemotingTestAuth::testAuthenticatedNoCredentials() +{ + IAuthTester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + + _pListener->setAuthenticator(new MockAuthenticator); + + try + { + pTester->get(1); + fail("no credentials - must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "Unauthorized: Authentication failed"); + } +} + + +void RemotingTestAuth::testAuthenticatedBadCredentials() +{ + IAuthTester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::REST::Transport& trans = static_cast(pProxy->remoting__transport()); + + trans.setUsername("user"); + trans.setPassword("bAd!"); + trans.setAuthentication(Poco::RemotingNG::REST::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + + try + { + pTester->get(1); + fail("bad credentials - must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "Unauthorized: Authentication failed"); + } +} + + +void RemotingTestAuth::testAuthenticatedGoodOAuthCredentials() +{ + IAuthTester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::REST::Transport& trans = static_cast(pProxy->remoting__transport()); + + Poco::RemotingNG::Credentials creds; + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_TOKEN, "t0k3n"); + trans.setCredentials(creds); + trans.setAuthentication(Poco::RemotingNG::REST::Transport::AUTH_BEARER); + + _pListener->setAuthenticator(new MockOAuthenticator); + + pTester->get(1); +} + + +void RemotingTestAuth::testAuthenticatedBadOAuthCredentials() +{ + IAuthTester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::REST::Transport& trans = static_cast(pProxy->remoting__transport()); + + Poco::RemotingNG::Credentials creds; + creds.setAttribute(Poco::RemotingNG::Credentials::ATTR_TOKEN, "b@dt0k3n"); + trans.setCredentials(creds); + trans.setAuthentication(Poco::RemotingNG::REST::Transport::AUTH_BEARER); + + _pListener->setAuthenticator(new MockOAuthenticator); + + try + { + pTester->get(1); + fail("bad credentials - must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "Unauthorized: Authentication failed"); + } +} + + +void RemotingTestAuth::testPermission() +{ + IAuthTester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::REST::Transport& trans = static_cast(pProxy->remoting__transport()); + + trans.setUsername("admin"); + trans.setPassword("s3cr3t"); + trans.setAuthentication(Poco::RemotingNG::REST::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + _pListener->setAuthorizer(new MockAuthorizer); + + Object object; + object.data = "Object 1"; + Object result = pTester->post(1, object); + assert (result.data == object.data); +} + + +void RemotingTestAuth::testNoPermission() +{ + IAuthTester::Ptr pTester = createProxy(_objectURI); + + Poco::AutoPtr pProxy = pTester.cast(); + Poco::RemotingNG::REST::Transport& trans = static_cast(pProxy->remoting__transport()); + + trans.setUsername("user"); + trans.setPassword("pass"); + trans.setAuthentication(Poco::RemotingNG::REST::Transport::AUTH_BASIC); + + _pListener->setAuthenticator(new MockAuthenticator); + _pListener->setAuthorizer(new MockAuthorizer); + + try + { + Object object; + object.data = "Object 1"; + Object result = pTester->post(1, object); + fail("no permission - must throw"); + } + catch (Poco::RemotingNG::RemoteException& exc) + { + assert (exc.message() == "Forbidden: No permission: perm1"); + } +} + + +CppUnit::Test* RemotingTestAuth::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("RemotingTestREST"); + + CppUnit_addTest(pSuite, RemotingTestAuth, testAuthenticatedGoodCredentials); + CppUnit_addTest(pSuite, RemotingTestAuth, testAuthenticatedNoCredentials); + CppUnit_addTest(pSuite, RemotingTestAuth, testAuthenticatedBadCredentials); + CppUnit_addTest(pSuite, RemotingTestAuth, testAuthenticatedGoodOAuthCredentials); + CppUnit_addTest(pSuite, RemotingTestAuth, testAuthenticatedBadOAuthCredentials); + CppUnit_addTest(pSuite, RemotingTestAuth, testPermission); + CppUnit_addTest(pSuite, RemotingTestAuth, testNoPermission); + + return pSuite; +} + + diff --git a/RemotingNG/REST/testsuite/src/RemotingTest.h b/RemotingNG/REST/testsuite/src/RemotingTest.h new file mode 100644 index 0000000000..a3a1c77463 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/RemotingTest.h @@ -0,0 +1,165 @@ +// +// RemotingTest.h +// +// Definition of the RemotingTest class. +// +// Copyright (c) 2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef RemotingTest_INCLUDED +#define RemotingTest_INCLUDED + + +#include "Poco/RemotingNG/RemotingNG.h" +#include "CppUnit/TestCase.h" +#include "ITester.h" +#include "IAuthTester.h" +#include "Poco/RemotingNG/REST/Listener.h" +#include "Poco/Net/HTTPServer.h" +#include "Poco/SharedPtr.h" + + +class RemotingTest: public CppUnit::TestCase +{ +public: + RemotingTest(const std::string& name); + ~RemotingTest(); + + void testRegistration(); + void testPost(); + void testPut(); + void testGet(); + void testGetNotFound(); + void testCookie(); + void testFault(); + + void setUp(); + void tearDown(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); + +protected: + std::string _listener; + std::string _objectURI; + std::string _publicURI; + Poco::RemotingNG::REST::Listener::Ptr _pListener; +}; + + +class RemotingTestREST: public RemotingTest +{ +public: + RemotingTestREST(const std::string& name); + ~RemotingTestREST(); + + void setUp(); + + static CppUnit::Test* suite(); +}; + + +class RemotingTestRESTCompressed: public RemotingTest +{ +public: + RemotingTestRESTCompressed(const std::string& name); + ~RemotingTestRESTCompressed(); + + void setUp(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); +}; + + +class RemotingTestRESTChunked: public RemotingTest +{ +public: + RemotingTestRESTChunked(const std::string& name); + ~RemotingTestRESTChunked(); + + void setUp(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); +}; + + +class RemotingTestRESTChunkedCompressed: public RemotingTest +{ +public: + RemotingTestRESTChunkedCompressed(const std::string& name); + ~RemotingTestRESTChunkedCompressed(); + + void setUp(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); +}; + + +class RemotingTestRESTAuth: public RemotingTest +{ +public: + RemotingTestRESTAuth(const std::string& name); + ~RemotingTestRESTAuth(); + + void setUp(); + void tearDown(); + + void testUnauthorized(); + + static CppUnit::Test* suite(); + +protected: + virtual ITester::Ptr createProxy(const std::string& uri); + ITester::Ptr createUnauthorizedProxy(const std::string& uri); + +private: + Poco::SharedPtr _pHTTPServer; +}; + + +class RemotingTestAuth: public CppUnit::TestCase +{ +public: + RemotingTestAuth(const std::string& name); + ~RemotingTestAuth(); + + void testAuthenticatedGoodCredentials(); + void testAuthenticatedNoCredentials(); + void testAuthenticatedBadCredentials(); + void testAuthenticatedGoodOAuthCredentials(); + void testAuthenticatedBadOAuthCredentials(); + void testPermission(); + void testNoPermission(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +protected: + IAuthTester::Ptr createProxy(const std::string& uri); + +protected: + std::string _listener; + std::string _objectURI; + std::string _publicURI; + Poco::RemotingNG::REST::Listener::Ptr _pListener; +}; + + +#endif // RemotingTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/SerializerTest.cpp b/RemotingNG/REST/testsuite/src/SerializerTest.cpp new file mode 100644 index 0000000000..506fa2e94f --- /dev/null +++ b/RemotingNG/REST/testsuite/src/SerializerTest.cpp @@ -0,0 +1,271 @@ +// +// SerializerTest.cpp +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "SerializerTest.h" +#include "ObjectSerializer.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/RemotingNG/REST/Serializer.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Poco/Net/HTTPRequest.h" +#include "Poco/StreamCopier.h" +#include + + +using namespace Poco::RemotingNG::REST; +using namespace std::string_literals; + + +SerializerTest::SerializerTest(const std::string& name): CppUnit::TestCase(name) +{ +} + + +SerializerTest::~SerializerTest() +{ +} + + +void SerializerTest::testGet() +{ + Serializer ser; + std::stringstream stream; + ser.setup(stream); + Poco::Net::HTTPRequest request; + ser.setRequest(request); + + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + ser.serializeMessageBegin("get"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize("id"s, 1234, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "query"s); + Poco::RemotingNG::TypeSerializer::serialize("options"s, "test"s, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + ser.serializeMessageEnd("get"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + std::string uri = request.getURI(); + assert (uri == "/tester/1234?options=test"); +} + + +void SerializerTest::testPostForm() +{ + Serializer ser; + std::stringstream stream; + ser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"s); + ser.setRequest(request); + + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + ser.serializeMessageBegin("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize("id"s, 1234, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "form"s); + Poco::RemotingNG::TypeSerializer::serialize("string", "foo bar"s, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + ser.serializeMessageEnd("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + std::string uri = request.getURI(); + assert (uri == "/tester/1234"); + + std::string form = stream.str(); + assert (form == "string=foo%20bar"); +} + + +void SerializerTest::testPostFormMultiPart() +{ + Serializer ser; + std::stringstream stream; + ser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"s); + request.setContentType("multipart/form-data"s); + ser.setRequest(request); + + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + ser.serializeMessageBegin("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize("id"s, 1234, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "form"s); + Poco::RemotingNG::TypeSerializer::serialize("string"s, "foo bar"s, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + ser.serializeMessageEnd("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + std::string uri = request.getURI(); + assert (uri == "/tester/1234"); + + std::string form = stream.str(); + assert (form.substr(0, 16) == "--MIME_boundary_"); + assert (form.find("Content-Disposition: form-data; name=\"string\"\r\n\r\n") != std::string::npos); + assert (form.find("foo bar\r\n") != std::string::npos); +} + + +void SerializerTest::testPostJSONObject() +{ + Serializer ser; + std::stringstream stream; + ser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"s); + ser.setRequest(request); + + Object object; + object.data = "foo\036bar"; + + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + ser.serializeMessageBegin("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize("id"s, 1234, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + Poco::RemotingNG::TypeSerializer::serialize("object"s, object, ser); + ser.serializeMessageEnd("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + std::string uri = request.getURI(); + assert (uri == "/tester/1234"); + + std::string json = stream.str(); + assert (json == + "{\n" + "\t\"data\": \"foo\\u001Ebar\"\n" + "}"); +} + + +void SerializerTest::testPostJSONArray() +{ + Serializer ser; + std::stringstream stream; + ser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"s); + ser.setRequest(request); + + std::vector array; + array.push_back("foo"s); + array.push_back("bar"s); + + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + ser.serializeMessageBegin("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize("id", 1234, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + Poco::RemotingNG::TypeSerializer >::serialize("array"s, array, ser); + ser.serializeMessageEnd("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + std::string uri = request.getURI(); + assert (uri == "/tester/1234"); + + std::string json = stream.str(); + assert (json == + "[\n" + "\t\"foo\",\n" + "\t\"bar\"\n" + "]"); +} + + +void SerializerTest::testPostRaw() +{ + Serializer ser; + std::stringstream stream; + ser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"s); + ser.setRequest(request); + + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + ser.serializeMessageBegin("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize("id"s, 1234, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "body"s); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT, "raw"s); + Poco::RemotingNG::TypeSerializer::serialize("string"s, "foo bar"s, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + ser.serializeMessageEnd("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + std::string uri = request.getURI(); + assert (uri == "/tester/1234"); + + std::string form = stream.str(); + assert (form == "foo bar"); +} + + +void SerializerTest::testPostRawHeader() +{ + Serializer ser; + std::stringstream stream; + ser.setup(stream); + Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/"s); + ser.setRequest(request); + + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + ser.serializeMessageBegin("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize("id"s, 1234, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "body"s); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT, "raw"s); + Poco::RemotingNG::TypeSerializer::serialize("string"s, "foo bar"s, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "header"s); + Poco::RemotingNG::TypeSerializer::serialize("X-Header"s, "Foo Bar"s, ser); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + ser.serializeMessageEnd("post"s, Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + + std::string uri = request.getURI(); + assert (uri == "/tester/1234"); + + std::string form = stream.str(); + assert (form == "foo bar"); + + std::string header = request.get("X-Header"); + assert (header == "Foo Bar"); +} + + +void SerializerTest::setUp() +{ +} + + +void SerializerTest::tearDown() +{ +} + + +CppUnit::Test* SerializerTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SerializerTest"); + + CppUnit_addTest(pSuite, SerializerTest, testGet); + CppUnit_addTest(pSuite, SerializerTest, testPostForm); + CppUnit_addTest(pSuite, SerializerTest, testPostFormMultiPart); + CppUnit_addTest(pSuite, SerializerTest, testPostJSONObject); + CppUnit_addTest(pSuite, SerializerTest, testPostJSONArray); + CppUnit_addTest(pSuite, SerializerTest, testPostRaw); + CppUnit_addTest(pSuite, SerializerTest, testPostRawHeader); + + return pSuite; +} diff --git a/RemotingNG/REST/testsuite/src/SerializerTest.h b/RemotingNG/REST/testsuite/src/SerializerTest.h new file mode 100644 index 0000000000..961e3e8a3b --- /dev/null +++ b/RemotingNG/REST/testsuite/src/SerializerTest.h @@ -0,0 +1,46 @@ +// +// SerializerTest.h +// +// Definition of the SerializerTest class. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef SerializerTest_INCLUDED +#define SerializerTest_INCLUDED + + +#include "Poco/RemotingNG/REST/REST.h" +#include "CppUnit/TestCase.h" + + +class SerializerTest: public CppUnit::TestCase +{ +public: + SerializerTest(const std::string& name); + ~SerializerTest(); + + void testGet(); + void testPostForm(); + void testPostFormMultiPart(); + void testPostJSONObject(); + void testPostJSONArray(); + void testPostRaw(); + void testPostRawHeader(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); + +private: +}; + + +#endif // SerializerTest_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/Tester.cpp b/RemotingNG/REST/testsuite/src/Tester.cpp new file mode 100644 index 0000000000..07a52e89d8 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/Tester.cpp @@ -0,0 +1,104 @@ +// +// Tester.cpp +// +// Copyright (c) 2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "Tester.h" +#include "Poco/Exception.h" +#include "Poco/RemotingNG/Context.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Net/HTTPServerResponse.h" +#include "Poco/Net/HTTPCookie.h" + + +Object Tester::put(int id, const Object& object) +{ + Object result; + switch (id) + { + case ID_SET_COOKIE: + setCookie(); + break; + case ID_VERIFY_COOKIE: + result.data = verifyCookie() ? "OK" : "FAIL"; + break; + case ID_FAULT: + throw Poco::ApplicationException("Something went wrong"); + default: + _data[id] = object.data; + result = object; + break; + } + return result; +} + + +Object Tester::post(int id, const Object& object) +{ + _data[id] = object.data; + return object; +} + + +Object Tester::get(int id, const std::string& options) +{ + std::map::const_iterator it = _data.find(id); + if (it != _data.end()) + { + Object result; + result.data = it->second; + return result; + } + else throw Poco::NotFoundException(); +} + + +void Tester::delete_(int id) +{ + std::map::iterator it = _data.find(id); + if (it != _data.end()) + { + _data.erase(it); + } + else throw Poco::NotFoundException(); +} + + +void Tester::setCookie() +{ + Poco::RemotingNG::Context::Ptr pContext = Poco::RemotingNG::Context::get(); + Poco::Net::HTTPServerResponse* pResponse = pContext->getValue("httpResponse"); + Poco::Net::HTTPCookie cookie("testcookie", "testvalue"); + cookie.setMaxAge(5); + pResponse->addCookie(cookie); +} + + +bool Tester::verifyCookie() +{ + Poco::RemotingNG::Context::Ptr pContext = Poco::RemotingNG::Context::get(); + Poco::Net::HTTPServerRequest* pRequest = pContext->getValue("httpRequest"); + Poco::Net::NameValueCollection cookies; + pRequest->getCookies(cookies); + return cookies.get("testcookie", "") == "testvalue"; +} + + +Object AuthTester::post(int id, const Object& object) +{ + return object; +} + + +Object AuthTester::get(int id, const std::string& options) +{ + Object result; + return result; +} diff --git a/RemotingNG/REST/testsuite/src/Tester.h b/RemotingNG/REST/testsuite/src/Tester.h new file mode 100644 index 0000000000..99cfb6e9a6 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/Tester.h @@ -0,0 +1,80 @@ +// +// Tester.h +// +// Definition of the Tester class. +// +// Copyright (c) 2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#ifndef Tester_INCLUDED +#define Tester_INCLUDED + + +#include "Poco/Poco.h" +#include + + +//@ serialize +struct Object +{ + std::string data; +}; + + +//@ remote +//@ path="/tester/{id}" +class Tester +{ +public: + enum SpecialID + { + ID_SET_COOKIE = 0x0C00C1E, + ID_VERIFY_COOKIE = 0x1C00C1E, + ID_FAULT = 0x0BADBEEF + }; + + //@ $id={in=path} + Object put(int id, const Object& object); + + //@ $id={in=path} + Object post(int id, const Object& object); + + //@ $id={in=path} + //@ $options={in=query, mandatory=false} + Object get(int id, const std::string& options = "none"); + + //@ $id={in=path} + void delete_(int id); + +protected: + void setCookie(); + bool verifyCookie(); + +private: + std::map _data; +}; + + +//@ remote +//@ path="/authtester/{id}" +//@ authenticated +class AuthTester +{ +public: + //@ $id={in=path} + //@ permission="perm1" + Object post(int id, const Object& object); + + //@ $id={in=path} + //@ $options={in=query, mandatory=false} + Object get(int id, const std::string& options = "none"); +}; + + +#endif // Tester_INCLUDED diff --git a/RemotingNG/REST/testsuite/src/TesterClientHelper.cpp b/RemotingNG/REST/testsuite/src/TesterClientHelper.cpp new file mode 100644 index 0000000000..3a7ddd7169 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterClientHelper.cpp @@ -0,0 +1,55 @@ +// +// TesterClientHelper.cpp +// +// Package: Generated +// Module: TesterClientHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterClientHelper.h" +#include "Poco/SingletonHolder.h" +#include "TesterProxyFactory.h" + + +namespace +{ + Poco::SingletonHolder shTesterClientHelper; +} + + +TesterClientHelper::TesterClientHelper(): + _pORB(0) +{ + _pORB = &Poco::RemotingNG::ORB::instance(); + _pORB->registerProxyFactory("Tester", new TesterProxyFactory); +} + + +TesterClientHelper::~TesterClientHelper() +{ +} + + +ITester::Ptr TesterClientHelper::findImpl(const std::string& uri) +{ + Poco::RemotingNG::Identifiable::Ptr pInterface = _pORB->findObject(uri); + return pInterface.cast(); +} + + +ITester::Ptr TesterClientHelper::findImpl(const std::string& uri, const std::string& protocol) +{ + Poco::RemotingNG::Identifiable::Ptr pInterface = _pORB->findObject(uri, ITester::remoting__typeId(), protocol); + return pInterface.cast(); +} + + +TesterClientHelper& TesterClientHelper::instance() +{ + return *shTesterClientHelper.get(); +} + + diff --git a/RemotingNG/REST/testsuite/src/TesterClientHelper.h b/RemotingNG/REST/testsuite/src/TesterClientHelper.h new file mode 100644 index 0000000000..2c1614728c --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterClientHelper.h @@ -0,0 +1,72 @@ +// +// TesterClientHelper.h +// +// Package: Generated +// Module: TesterClientHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterClientHelper_INCLUDED +#define TesterClientHelper_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/ORB.h" + + +class TesterClientHelper +{ +public: + TesterClientHelper(); + /// Creates a TesterClientHelper. + + ~TesterClientHelper(); + /// Destroys the TesterClientHelper. + + static ITester::Ptr find(const std::string& uri); + /// Return an interface for the service object identified by the given URI. + /// + /// Depending on whether the service object has been registered on the same ORB, or not, + /// the ORB will either return a RemoteObject (with forwards calls locally, without the + /// need for serialization/deserialization), or a Proxy. + /// + /// The URI must have the following format: :///// + + static ITester::Ptr find(const std::string& uri, const std::string& protocol); + /// Return a Proxy for the service object identified by the given URI. + /// + /// The given protocol name is used to determine the Transport used by + /// the Proxy. This is used for objects identified by URIs that do not + /// follow the standard Remoting URI structure. + +private: + ITester::Ptr findImpl(const std::string& uri); + + ITester::Ptr findImpl(const std::string& uri, const std::string& protocol); + + static TesterClientHelper& instance(); + + Poco::RemotingNG::ORB* _pORB; +}; + + +inline ITester::Ptr TesterClientHelper::find(const std::string& uri) +{ + return TesterClientHelper::instance().findImpl(uri); +} + + +inline ITester::Ptr TesterClientHelper::find(const std::string& uri, const std::string& protocol) +{ + return TesterClientHelper::instance().findImpl(uri, protocol); +} + + + + +#endif // TesterClientHelper_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/TesterProxy.cpp b/RemotingNG/REST/testsuite/src/TesterProxy.cpp new file mode 100644 index 0000000000..d2f34e73ab --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterProxy.cpp @@ -0,0 +1,136 @@ +// +// TesterProxy.cpp +// +// Package: Generated +// Module: TesterProxy +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterProxy.h" +#include "ObjectDeserializer.h" +#include "ObjectSerializer.h" +#include "Poco/RemotingNG/Deserializer.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Poco/RemotingNG/URIUtility.h" + + +TesterProxy::TesterProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid): + ITester(), + Poco::RemotingNG::Proxy(oid), + _getRet(), + _postRet(), + _putRet() +{ +} + + +TesterProxy::~TesterProxy() +{ +} + + +void TesterProxy::delete_(int id) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"delete_"s,"id"s}; + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], id, remoting__ser); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + static const std::string REMOTING__REPLY_NAME("delete_Reply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__trans.endRequest(); +} + + +Object TesterProxy::get(int id, const std::string& options) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"get"s,"id"s,"options"s}; + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], id, remoting__ser); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "query"s); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], options, remoting__ser); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + static const std::string REMOTING__REPLY_NAME("getReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _getRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__trans.endRequest(); + return _getRet; +} + + +Object TesterProxy::post(int id, const Object& object) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"post"s,"id"s,"object"s}; + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], id, remoting__ser); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], object, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + static const std::string REMOTING__REPLY_NAME("postReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _postRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__trans.endRequest(); + return _postRet; +} + + +Object TesterProxy::put(int id, const Object& object) +{ + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"put"s,"id"s,"object"s}; + Poco::RemotingNG::Transport& remoting__trans = remoting__transport(); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[1], id, remoting__ser); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + Poco::RemotingNG::TypeSerializer::serialize(REMOTING__NAMES[2], object, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + static const std::string REMOTING__REPLY_NAME("putReply"); + remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeDeserializer::deserialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, true, remoting__deser, _putRet); + remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__trans.endRequest(); + return _putRet; +} + + +const std::string TesterProxy::DEFAULT_NS; diff --git a/RemotingNG/REST/testsuite/src/TesterProxy.h b/RemotingNG/REST/testsuite/src/TesterProxy.h new file mode 100644 index 0000000000..d7b7a22323 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterProxy.h @@ -0,0 +1,58 @@ +// +// TesterProxy.h +// +// Package: Generated +// Module: TesterProxy +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterProxy_INCLUDED +#define TesterProxy_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Proxy.h" + + +class TesterProxy: public ITester, public Poco::RemotingNG::Proxy +{ +public: + using Ptr = Poco::AutoPtr; + + TesterProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid); + /// Creates a TesterProxy. + + virtual ~TesterProxy(); + /// Destroys the TesterProxy. + + void delete_(int id); + + Object get(int id, const std::string& options = std::string("none")); + + Object post(int id, const Object& object); + + Object put(int id, const Object& object); + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + +private: + static const std::string DEFAULT_NS; + mutable Object _getRet; + mutable Object _postRet; + mutable Object _putRet; +}; + + +inline const Poco::RemotingNG::Identifiable::TypeId& TesterProxy::remoting__typeId() const +{ + return ITester::remoting__typeId(); +} + + + + +#endif // TesterProxy_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/TesterProxyFactory.cpp b/RemotingNG/REST/testsuite/src/TesterProxyFactory.cpp new file mode 100644 index 0000000000..17b514427d --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterProxyFactory.cpp @@ -0,0 +1,32 @@ +// +// TesterProxyFactory.cpp +// +// Package: Generated +// Module: TesterProxyFactory +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterProxyFactory.h" + + +TesterProxyFactory::TesterProxyFactory(): + Poco::RemotingNG::ProxyFactory() + +{ +} + + +TesterProxyFactory::~TesterProxyFactory() +{ +} + + +Poco::RemotingNG::Proxy* TesterProxyFactory::createProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid) const +{ + return new TesterProxy(oid); +} + + diff --git a/RemotingNG/REST/testsuite/src/TesterProxyFactory.h b/RemotingNG/REST/testsuite/src/TesterProxyFactory.h new file mode 100644 index 0000000000..0f84b4e4ca --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterProxyFactory.h @@ -0,0 +1,38 @@ +// +// TesterProxyFactory.h +// +// Package: Generated +// Module: TesterProxyFactory +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterProxyFactory_INCLUDED +#define TesterProxyFactory_INCLUDED + + +#include "Poco/RemotingNG/ProxyFactory.h" +#include "TesterProxy.h" + + +class TesterProxyFactory: public Poco::RemotingNG::ProxyFactory +{ +public: + TesterProxyFactory(); + /// Creates a TesterProxyFactory. + + ~TesterProxyFactory(); + /// Destroys the TesterProxyFactory. + + Poco::RemotingNG::Proxy* createProxy(const Poco::RemotingNG::Identifiable::ObjectId& oid) const; + /// Creates and returns a new Proxy object. + +}; + + + + +#endif // TesterProxyFactory_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/TesterRemoteObject.cpp b/RemotingNG/REST/testsuite/src/TesterRemoteObject.cpp new file mode 100644 index 0000000000..3bf1fb48d8 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterRemoteObject.cpp @@ -0,0 +1,34 @@ +// +// TesterRemoteObject.cpp +// +// Package: Generated +// Module: TesterRemoteObject +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterRemoteObject.h" + + +TesterRemoteObject::TesterRemoteObject(const Poco::RemotingNG::Identifiable::ObjectId& oid, Poco::SharedPtr pServiceObject): + ITester(), + Poco::RemotingNG::RemoteObject(oid), + _pServiceObject(pServiceObject) +{ +} + + +TesterRemoteObject::~TesterRemoteObject() +{ + try + { + } + catch (...) + { + poco_unexpected(); + } +} + + diff --git a/RemotingNG/REST/testsuite/src/TesterRemoteObject.h b/RemotingNG/REST/testsuite/src/TesterRemoteObject.h new file mode 100644 index 0000000000..ad52b30f06 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterRemoteObject.h @@ -0,0 +1,81 @@ +// +// TesterRemoteObject.h +// +// Package: Generated +// Module: TesterRemoteObject +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterRemoteObject_INCLUDED +#define TesterRemoteObject_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/RemoteObject.h" +#include "Poco/SharedPtr.h" + + +class TesterRemoteObject: public ITester, public Poco::RemotingNG::RemoteObject +{ +public: + using Ptr = Poco::AutoPtr; + + TesterRemoteObject(const Poco::RemotingNG::Identifiable::ObjectId& oid, Poco::SharedPtr pServiceObject); + /// Creates a TesterRemoteObject. + + virtual ~TesterRemoteObject(); + /// Destroys the TesterRemoteObject. + + void delete_(int id); + + Object get(int id, const std::string& options = std::string("none")); + + Object post(int id, const Object& object); + + Object put(int id, const Object& object); + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + +private: + Poco::SharedPtr _pServiceObject; +}; + + +inline void TesterRemoteObject::delete_(int id) +{ + _pServiceObject->delete_(id); +} + + +inline Object TesterRemoteObject::get(int id, const std::string& options) +{ + return _pServiceObject->get(id, options); +} + + +inline Object TesterRemoteObject::post(int id, const Object& object) +{ + return _pServiceObject->post(id, object); +} + + +inline Object TesterRemoteObject::put(int id, const Object& object) +{ + return _pServiceObject->put(id, object); +} + + +inline const Poco::RemotingNG::Identifiable::TypeId& TesterRemoteObject::remoting__typeId() const +{ + return ITester::remoting__typeId(); +} + + + + +#endif // TesterRemoteObject_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/TesterServerHelper.cpp b/RemotingNG/REST/testsuite/src/TesterServerHelper.cpp new file mode 100644 index 0000000000..0aef202809 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterServerHelper.cpp @@ -0,0 +1,81 @@ +// +// TesterServerHelper.cpp +// +// Package: Generated +// Module: TesterServerHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterServerHelper.h" +#include "Poco/RemotingNG/URIUtility.h" +#include "Poco/SingletonHolder.h" +#include "TesterSkeleton.h" + + +namespace +{ + Poco::SingletonHolder shTesterServerHelper; +} + + +TesterServerHelper::TesterServerHelper(): + _pORB(0) +{ + _pORB = &Poco::RemotingNG::ORB::instance(); + registerSkeleton(); +} + + +TesterServerHelper::~TesterServerHelper() +{ +} + + +void TesterServerHelper::shutdown() +{ + TesterServerHelper::instance().unregisterSkeleton(); + shTesterServerHelper.reset(); +} + + +Poco::AutoPtr TesterServerHelper::createRemoteObjectImpl(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid) +{ + Poco::AutoPtr pRemoteObject = new TesterRemoteObject(oid, pServiceObject); + pRemoteObject->remoting__setURI(Poco::URI("/tester/{id}")); + return pRemoteObject; +} + + +TesterServerHelper& TesterServerHelper::instance() +{ + return *shTesterServerHelper.get(); +} + + +std::string TesterServerHelper::registerObjectImpl(Poco::AutoPtr pRemoteObject, const std::string& listenerId) +{ + return _pORB->registerObject(pRemoteObject, listenerId); +} + + +void TesterServerHelper::registerSkeleton() +{ + _pORB->registerSkeleton("Tester", new TesterSkeleton); +} + + +void TesterServerHelper::unregisterObjectImpl(const std::string& uri) +{ + _pORB->unregisterObject(uri); +} + + +void TesterServerHelper::unregisterSkeleton() +{ + _pORB->unregisterSkeleton("Tester", true); +} + + diff --git a/RemotingNG/REST/testsuite/src/TesterServerHelper.h b/RemotingNG/REST/testsuite/src/TesterServerHelper.h new file mode 100644 index 0000000000..797468b939 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterServerHelper.h @@ -0,0 +1,105 @@ +// +// TesterServerHelper.h +// +// Package: Generated +// Module: TesterServerHelper +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterServerHelper_INCLUDED +#define TesterServerHelper_INCLUDED + + +#include "ITester.h" +#include "Poco/RemotingNG/Identifiable.h" +#include "Poco/RemotingNG/ORB.h" +#include "Poco/RemotingNG/ServerHelper.h" +#include "Tester.h" +#include "TesterRemoteObject.h" + + +class TesterServerHelper +{ +public: + using Service = Tester; + + TesterServerHelper(); + /// Creates a TesterServerHelper. + + ~TesterServerHelper(); + /// Destroys the TesterServerHelper. + + static Poco::AutoPtr createRemoteObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid); + /// Creates and returns a RemoteObject wrapper for the given Tester instance. + + static std::string registerObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid, const std::string& listenerId); + /// Creates a RemoteObject wrapper for the given Tester instance + /// and registers it with the ORB and the Listener instance + /// uniquely identified by the Listener's ID. + /// + /// Returns the URI created for the object. + + static std::string registerRemoteObject(Poco::AutoPtr pRemoteObject, const std::string& listenerId); + /// Registers the given RemoteObject with the ORB and the Listener instance + /// uniquely identified by the Listener's ID. + /// + /// Returns the URI created for the object. + + static void shutdown(); + /// Removes the Skeleton for Tester from the ORB. + + static void unregisterObject(const std::string& uri); + /// Unregisters a service object identified by URI from the ORB. + +private: + static Poco::AutoPtr createRemoteObjectImpl(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid); + + static TesterServerHelper& instance(); + /// Returns a static instance of the helper class. + + std::string registerObjectImpl(Poco::AutoPtr pRemoteObject, const std::string& listenerId); + + void registerSkeleton(); + + void unregisterObjectImpl(const std::string& uri); + + void unregisterSkeleton(); + + Poco::RemotingNG::ORB* _pORB; +}; + + +inline Poco::AutoPtr TesterServerHelper::createRemoteObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid) +{ + return TesterServerHelper::instance().createRemoteObjectImpl(pServiceObject, oid); +} + + +inline std::string TesterServerHelper::registerObject(Poco::SharedPtr pServiceObject, const Poco::RemotingNG::Identifiable::ObjectId& oid, const std::string& listenerId) +{ + return TesterServerHelper::instance().registerObjectImpl(createRemoteObject(pServiceObject, oid), listenerId); +} + + +inline std::string TesterServerHelper::registerRemoteObject(Poco::AutoPtr pRemoteObject, const std::string& listenerId) +{ + return TesterServerHelper::instance().registerObjectImpl(pRemoteObject, listenerId); +} + + +inline void TesterServerHelper::unregisterObject(const std::string& uri) +{ + TesterServerHelper::instance().unregisterObjectImpl(uri); +} + + + + +REMOTING_SPECIALIZE_SERVER_HELPER(, Tester) + + +#endif // TesterServerHelper_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/TesterSkeleton.cpp b/RemotingNG/REST/testsuite/src/TesterSkeleton.cpp new file mode 100644 index 0000000000..88ea6fb2e5 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterSkeleton.cpp @@ -0,0 +1,298 @@ +// +// TesterSkeleton.cpp +// +// Package: Generated +// Module: TesterSkeleton +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#include "TesterSkeleton.h" +#include "ObjectDeserializer.h" +#include "ObjectSerializer.h" +#include "Poco/RemotingNG/Deserializer.h" +#include "Poco/RemotingNG/MethodHandler.h" +#include "Poco/RemotingNG/RemotingException.h" +#include "Poco/RemotingNG/Serializer.h" +#include "Poco/RemotingNG/ServerTransport.h" +#include "Poco/RemotingNG/TypeDeserializer.h" +#include "Poco/RemotingNG/TypeSerializer.h" +#include "Poco/SharedPtr.h" + + +class TesterDelete_MethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"delete_"s,"id"s}; + bool remoting__requestSucceeded = false; + try + { + int id; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, id); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + remoting__pCastedRO->delete_(id); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + static const std::string REMOTING__REPLY_NAME("delete_Reply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::delete_"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::delete_"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::delete_"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterGetMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"get"s,"id"s,"options"s}; + bool remoting__requestSucceeded = false; + try + { + int id; + std::string options("none"); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, id); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "query"s); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], false, remoting__deser, options); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Object remoting__return = remoting__pCastedRO->get(id, options); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + static const std::string REMOTING__REPLY_NAME("getReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::get"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::get"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::get"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterPostMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"post"s,"id"s,"object"s}; + bool remoting__requestSucceeded = false; + try + { + int id; + Object object; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, id); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, object); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Object remoting__return = remoting__pCastedRO->post(id, object); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + static const std::string REMOTING__REPLY_NAME("postReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::post"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::post"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::post"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +class TesterPutMethodHandler: public Poco::RemotingNG::MethodHandler +{ +public: + void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Deserializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + { + using namespace std::string_literals; + + static const std::string REMOTING__NAMES[] = {"put"s,"id"s,"object"s}; + bool remoting__requestSucceeded = false; + try + { + int id; + Object object; + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, "/tester/{id}"s); + remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, "path"s); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[1], true, remoting__deser, id); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION); + Poco::RemotingNG::TypeDeserializer::deserialize(REMOTING__NAMES[2], true, remoting__deser, object); + remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST); + remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH); + TesterRemoteObject* remoting__pCastedRO = static_cast(remoting__pRemoteObject.get()); + Object remoting__return = remoting__pCastedRO->put(id, object); + remoting__requestSucceeded = true; + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + static const std::string REMOTING__REPLY_NAME("putReply"); + remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + Poco::RemotingNG::TypeSerializer::serialize(Poco::RemotingNG::SerializerBase::RETURN_PARAM, remoting__return, remoting__ser); + remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_REPLY); + } + catch (const Poco::Exception& e) + { + if (!remoting__requestSucceeded) + { + remoting__trans.reportException("Tester::put"s, e); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e); + } + } + catch (const std::exception& e) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc(e.what()); + remoting__trans.reportException("Tester::put"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + catch (...) + { + if (!remoting__requestSucceeded) + { + const Poco::Exception exc("Unknown Exception"s); + remoting__trans.reportException("Tester::put"s, exc); + Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT); + remoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc); + } + } + } + +}; + + +TesterSkeleton::TesterSkeleton(): + Poco::RemotingNG::Skeleton() + +{ + using namespace std::string_literals; + + addMethodHandler("delete_"s, new TesterDelete_MethodHandler); + addMethodHandler("get"s, new TesterGetMethodHandler); + addMethodHandler("post"s, new TesterPostMethodHandler); + addMethodHandler("put"s, new TesterPutMethodHandler); +} + + +TesterSkeleton::~TesterSkeleton() +{ +} + + +const std::string TesterSkeleton::DEFAULT_NS; diff --git a/RemotingNG/REST/testsuite/src/TesterSkeleton.h b/RemotingNG/REST/testsuite/src/TesterSkeleton.h new file mode 100644 index 0000000000..5f5f5fecf0 --- /dev/null +++ b/RemotingNG/REST/testsuite/src/TesterSkeleton.h @@ -0,0 +1,44 @@ +// +// TesterSkeleton.h +// +// Package: Generated +// Module: TesterSkeleton +// +// This file has been generated. +// Warning: All changes to this will be lost when the file is re-generated. +// + + +#ifndef TesterSkeleton_INCLUDED +#define TesterSkeleton_INCLUDED + + +#include "Poco/RemotingNG/Skeleton.h" +#include "TesterRemoteObject.h" + + +class TesterSkeleton: public Poco::RemotingNG::Skeleton +{ +public: + TesterSkeleton(); + /// Creates a TesterSkeleton. + + virtual ~TesterSkeleton(); + /// Destroys a TesterSkeleton. + + virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const; + + static const std::string DEFAULT_NS; +}; + + +inline const Poco::RemotingNG::Identifiable::TypeId& TesterSkeleton::remoting__typeId() const +{ + return ITester::remoting__typeId(); +} + + + + +#endif // TesterSkeleton_INCLUDED + diff --git a/RemotingNG/REST/testsuite/src/WinDriver.cpp b/RemotingNG/REST/testsuite/src/WinDriver.cpp new file mode 100644 index 0000000000..3c3d24e84a --- /dev/null +++ b/RemotingNG/REST/testsuite/src/WinDriver.cpp @@ -0,0 +1,30 @@ +// +// WinDriver.cpp +// +// Windows test driver for Poco RemotingNG REST. +// +// Copyright (c) 2010-2016, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// This is unpublished proprietary source code of Applied Informatics. +// The contents of this file may not be disclosed to third parties, +// copied or duplicated in any form, in whole or in part. +// + + +#include "WinTestRunner/WinTestRunner.h" +#include "RESTTestSuite.h" + + +class TestDriver: public CppUnit::WinTestRunnerApp +{ + void TestMain() + { + CppUnit::WinTestRunner runner; + runner.addTest(RESTTestSuite::suite()); + runner.run(); + } +}; + + +TestDriver theDriver; diff --git a/RemotingNG/RemoteGen/CMakeLists.txt b/RemotingNG/RemoteGen/CMakeLists.txt new file mode 100644 index 0000000000..bddc6d4799 --- /dev/null +++ b/RemotingNG/RemoteGen/CMakeLists.txt @@ -0,0 +1,46 @@ +# Sources +file(GLOB SRCS_GEN_G "src/*.cpp") +POCO_SOURCES_AUTO(SRCS_GEN ${SRCS_GEN_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "src/*.h") +POCO_HEADERS_AUTO(SRCS_GEN ${HDRS_G}) + +# Version Resource +if(MSVC) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) + list(APPEND SRCS_GEN ${PROJECT_SOURCE_DIR}/ProDLLVersion.rc) +endif() + +add_executable(RemoteGenNG ${SRCS_GEN}) +set_target_properties(RemoteGenNG + PROPERTIES + OUTPUT_NAME RemoteGenNG +) + +configure_file(RemoteGenNG.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COPYONLY) + +target_link_libraries(RemoteGenNG + PUBLIC + Poco::Foundation Poco::Util Poco::XML Poco::JSON + Poco::RemotingNG Poco::CodeGeneration Poco::CppParser +) + +if(WIN32) + set(PocoConfigPackageLocation "cmake") +else() + set(PocoConfigPackageLocation "${CMAKE_INSTALL_LIBDIR}/") +endif() + +install( + TARGETS RemoteGenNG EXPORT RemoteGenNGTargets + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + RUNTIME DESTINATION bin + INCLUDES DESTINATION include +) + +install( + FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/RemoteGenNG.xml + TYPE BIN +) diff --git a/RemotingNG/RemoteGen/Makefile b/RemotingNG/RemoteGen/Makefile new file mode 100644 index 0000000000..8630587fdb --- /dev/null +++ b/RemotingNG/RemoteGen/Makefile @@ -0,0 +1,21 @@ +# +# Makefile +# +# Makefile for RemoteGenNG +# + +include $(POCO_BASE)/build/rules/global + +objects = AbstractGenerator ProxyFactoryGenerator SerializerGenerator XSDGenerator \ + ClientHelperGenerator ProxyGenerator ServerHelperGenerator \ + BundleActivatorGenerator ExtensionsGenerator \ + DeserializerGenerator RemoteGen SkeletonGenerator \ + InterfaceGenerator RemoteObjectGenerator RemoteBridgeGenerator WSDLGenerator GenUtility \ + EventDispatcherGenerator EventSubscriberGenerator \ + SwaggerGenerator + +target = RemoteGenNG +target_version = 1 +target_libs = PocoRemotingNG PocoCodeGeneration PocoNet PocoUtil PocoCppParser PocoXML PocoJSON PocoFoundation $(POCO_LICENSING) + +include $(POCO_BASE)/build/rules/exec diff --git a/RemotingNG/RemoteGen/RemoteGenNG.xml b/RemotingNG/RemoteGen/RemoteGenNG.xml new file mode 100644 index 0000000000..6caf77693a --- /dev/null +++ b/RemotingNG/RemoteGen/RemoteGenNG.xml @@ -0,0 +1,64 @@ + + + + + ${POCOPLUS_BASE}/RemotingNG/include/Poco/RemotingNG/RemoteObject.h + ${POCOPLUS_BASE}/RemotingNG/include/Poco/RemotingNG/Proxy.h + ${POCOPLUS_BASE}/RemotingNG/include/Poco/RemotingNG/Skeleton.h + ${POCOPLUS_BASE}/RemotingNG/include/Poco/RemotingNG/EventDispatcher.h + ${POCOPLUS_BASE}/RemotingNG/include/Poco/RemotingNG/EventSubscriber.h + + + + + + -I + ${POCO_BASE}/Foundation/include + -I + ${POCO_BASE}/dependencies/tessil/include + -I + ${POCOPLUS_BASE}/RemotingNG/include + -I + ${POCOPLUS_BASE}/OSP/include + + + + g++ + + ${RemoteGen.internal.commonIncludes} + ${RemoteGen.internal.gcc.includes} + -E + -C + -DPOCO_NO_GCC_API_ATTRIBUTE + -DPOCO_REMOTEGEN + -o%.i + + + + clang++ + + ${RemoteGen.internal.commonIncludes} + ${RemoteGen.internal.gcc.includes} + -E + -C + -DPOCO_NO_GCC_API_ATTRIBUTE + -DPOCO_REMOTEGEN + -xc++ + -o%.i + + + + cl + + ${RemoteGen.internal.commonIncludes} + ${RemoteGen.internal.msvc.includes} + -DPOCO_REMOTEGEN + /nologo + /C + /P + /TP + + + + diff --git a/RemotingNG/RemoteGen/RemoteGenNG.xml.install b/RemotingNG/RemoteGen/RemoteGenNG.xml.install new file mode 100644 index 0000000000..ef16d7ba3a --- /dev/null +++ b/RemotingNG/RemoteGen/RemoteGenNG.xml.install @@ -0,0 +1,54 @@ + + ${application.dir}/.. + + + + ${POCO_BASE}/include/Poco/RemotingNG/RemoteObject.h + ${POCO_BASE}/include/Poco/RemotingNG/Proxy.h + ${POCO_BASE}/include/Poco/RemotingNG/Skeleton.h + ${POCO_BASE}/include/Poco/RemotingNG/EventDispatcher.h + ${POCO_BASE}/include/Poco/RemotingNG/EventSubscriber.h + + + + g++ + + -I + ${POCO_BASE}/include + ${RemoteGen.internal.gcc.includes} + -E + -C + -DPOCO_NO_GCC_API_ATTRIBUTE + -DPOCO_REMOTEGEN + -o%.i + + + + clang++ + + -I + ${POCO_BASE}/include + ${RemoteGen.internal.gcc.includes} + -E + -C + -DPOCO_NO_GCC_API_ATTRIBUTE + -DPOCO_REMOTEGEN + -xc++ + -o%.i + + + + cl + + /I + ${POCO_BASE}\include + ${RemoteGen.internal.msvc.includes} + -DPOCO_REMOTEGEN + /nologo + /C + /P + /TP + + + + diff --git a/RemotingNG/RemoteGen/dependencies b/RemotingNG/RemoteGen/dependencies new file mode 100644 index 0000000000..846294c3b1 --- /dev/null +++ b/RemotingNG/RemoteGen/dependencies @@ -0,0 +1,7 @@ +RemotingNG +CodeGeneration +Net +Util +CppParser +XML +Foundation diff --git a/RemotingNG/RemoteGen/src/AbstractGenerator.cpp b/RemotingNG/RemoteGen/src/AbstractGenerator.cpp new file mode 100644 index 0000000000..a832420549 --- /dev/null +++ b/RemotingNG/RemoteGen/src/AbstractGenerator.cpp @@ -0,0 +1,759 @@ +// +// AbstractGenerator.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "AbstractGenerator.h" +#include "InterfaceGenerator.h" +#include "SerializerGenerator.h" +#include "DeserializerGenerator.h" +#include "GenUtility.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CodeGeneration/CppGenerator.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CppParser/Symbol.h" +#include "Poco/CppParser/TypeDef.h" +#include "Poco/CppParser/Enum.h" +#include "Poco/Exception.h" +#include "Poco/Path.h" +#include "Poco/StringTokenizer.h" +#include "Poco/String.h" +#include "Poco/Util/Application.h" +#include "Poco/Util/Option.h" +#include "Poco/Util/OptionSet.h" +#include "Poco/Util/HelpFormatter.h" +#include "Poco/Util/AbstractConfiguration.h" +#include +#if defined(POCO_REQUIRE_LICENSE) +#include "Poco/Licensing/License.h" +#endif + + +using Poco::CodeGeneration::Utility; + + +Poco::BasicEvent AbstractGenerator::EError; +const std::set AbstractGenerator::BUILTIN_TYPES(initBuiltinTypes()); + + +AbstractGenerator::AbstractGenerator(Poco::CodeGeneration::CppGenerator& cppGen): + Poco::CodeGeneration::CodeGenerator(cppGen.nameSpace(), cppGen.libraryName(), cppGen.usePocoIncludeStyle(), cppGen.copyright()), + _cppGen(cppGen), + _pStruct(0), + _pStructIn(0), + _pNs(0) +{ +#if defined(POCO_REQUIRE_LICENSE) + poco_verify_license(RemoteGen); +#endif + Poco::CppParser::Symbol* pS = Poco::CppParser::NameSpace::root(); + if (!_cppGen.nameSpace().empty()) + { + pS = Poco::CppParser::NameSpace::root()->lookup(_cppGen.nameSpace()); + if (!pS) + throw CodeGenerationException("Missing information for namespace " + _cppGen.nameSpace() + ". No class included from that namespace?"); + } + //root namespace must always exist + poco_assert (pS); + poco_assert (pS->kind() == pS->SYM_NAMESPACE); + _pNs = static_cast(pS); + Poco::Util::LayeredConfiguration& cfg = Poco::Util::Application::instance().config(); + if (cfg.hasProperty("RemoteGen.output.alwaysInclude")) + { + std::string incFile = cfg.getString("RemoteGen.output.alwaysInclude"); + if (!incFile.empty()) + { + _cppGen.addIncludeFile(incFile); + } + } + else if (cfg.hasProperty("RemoteGen.output.namespacedeclfile")) + { + std::string incFile = cfg.getString("RemoteGen.output.namespacedeclfile"); + if (!incFile.empty()) + { + _cppGen.addIncludeFile(incFile); + } + } +} + + +AbstractGenerator::~AbstractGenerator() +{ +} + + +void AbstractGenerator::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + poco_assert_dbg(_pStruct == 0); + poco_assert_dbg(_pStructIn == 0); + _pStructIn = pStruct; + _pStruct = structClone(pStruct, newClassName(pStruct), newBaseClasses(pStruct)); +} + + +void AbstractGenerator::structEnd() +{ + Poco::CodeGeneration::GeneratorEngine e; + registerCallbacks(e); + e.generate(_pStruct, _cppGen, reinterpret_cast(this)); + _pStruct = 0; + _pStructIn = 0; +} + + +Poco::CppParser::Function* AbstractGenerator::methodClone(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& properties) +{ + poco_assert_dbg (_pStruct && _pStructIn); + + // simply copy the method signature, just update docu + // note that a decl contains only the string up to method, no params! + std::string decl; + std::string resRetType = Utility::resolveType(_pStructIn, pFuncOld->getReturnParameter()); + + if (resRetType != pFuncOld->getReturnParameter()) + { + const std::string& oldRet = pFuncOld->getReturnParameter(); + if (!oldRet.empty()) + { + const std::string& oldDecl = pFuncOld->declaration(); + std::size_t pos = oldDecl.find(oldRet); + if (pos != std::string::npos) + { + pos += oldRet.size(); + decl.append(resRetType); + decl.append(oldDecl.substr(pos)); + } + else + decl.append(oldDecl); + } + else + decl.append(pFuncOld->declaration()); + } + else + { + decl.append(pFuncOld->declaration()); + } + + Poco::CppParser::Function* pFunc = new Poco::CppParser::Function(decl, _pStruct); + pFunc->setAccess (pFuncOld->getAccess()); + addDocumentation(pFuncOld, pFunc); + pFunc->setAttributes(pFuncOld->getAttributes()); + if (pFuncOld->isConst()) + pFunc->makeConst(); + + Poco::CppParser::Function::Iterator it = pFuncOld->begin(); + Poco::CppParser::Function::Iterator itEnd = pFuncOld->end(); + + for (; it != itEnd; ++it) + { + std::string decl = Poco::CodeGeneration::Utility::resolveParamDecl(_pStructIn, *it); + if ((*it)->hasDefaultValue()) + { + decl.append(" = "); + std::string type = Poco::CodeGeneration::Utility::resolveType(_pStructIn, (*it)->declType()); + Poco::CppParser::Symbol* pSym = Poco::CppParser::NameSpace::root()->lookup(type); + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_ENUM) + { + Poco::CppParser::Enum* pEnum = static_cast(pSym); + if (pEnum->flags() & Poco::CppParser::Enum::ENUM_IS_CLASS) + decl.append(pEnum->fullName()); + else + decl.append(pEnum->nameSpace()->fullName()); + decl.append("::"); + std::string defaultValue((*it)->defaultValue()); + std::string::size_type scpos = defaultValue.find_last_of("::"); + if (scpos != std::string::npos) + { + defaultValue.erase(0, scpos + 1); + } + decl.append(defaultValue); + } + else + { + decl.append(type); + decl.append("("); + decl.append((*it)->defaultValue()); + decl.append(")"); + } + } + if ((*it)->isPointer()) + throw Poco::InvalidArgumentException("Pointer parameters are not supported: " + pFuncOld->nameSpace()->fullName() + "::" + pFuncOld->name() + "::" + (*it)->name()); + + Poco::CppParser::Parameter* pParam = new Poco::CppParser::Parameter(decl, pFunc); + + pFunc->addParameter(pParam); + } + + return pFunc; +} + + +Poco::CppParser::Struct* AbstractGenerator::structClone(const Poco::CppParser::Struct* aStruct, const std::string& newClassName, const std::vector& baseClasses) +{ + poco_assert_dbg (_pStruct == 0); + poco_assert_dbg (aStruct != 0); + + // generate the decl: class NS_API newClassName: public BaseNS::IbaseClass + std::string decl("class "); + if (!_cppGen.libraryName().empty()) + { + decl.append(_cppGen.libraryName()); + decl.append("_API "); + } + else + decl.append(" "); + + decl.append(newClassName); + + Poco::CppParser::Struct* pStruct = new Poco::CppParser::Struct(decl, true, _pNs); + std::vector::const_iterator it = baseClasses.begin(); + std::vector::const_iterator itEnd = baseClasses.end(); + for (; it != itEnd; ++it) + pStruct->addBase(*it, Poco::CppParser::Symbol::ACC_PUBLIC, false); + + pStruct->fixupBases(); + + Poco::Path aPath(aStruct->getFile()); + Poco::Util::LayeredConfiguration& cfg = Poco::Util::Application::instance().config(); + std::string incFile = includePath(cfg, aStruct); + if (!incFile.empty()) + { + aPath = Poco::Path(incFile); + aPath.makeDirectory(); + } + addDocumentation(aStruct, pStruct); + pStruct->setAttributes(aStruct->getAttributes()); + pStruct->attrs().remove("remote"); + aPath.setFileName(newClassName+".h"); + pStruct->setFile(aPath.toString()); + pStruct->setLibrary(aStruct->getLibrary()); + pStruct->setPackage("Generated"); + return pStruct; +} + + +void AbstractGenerator::handleParentFunctions(const Poco::CppParser::Struct* pStruct) +{ + std::set methodSigs; + bool root = true; + handleParentFunctionsImpl(pStruct, methodSigs, root); +} + + +void AbstractGenerator::handleParentFunctionsImpl(const Poco::CppParser::Struct* pStruct, std::set& methodSigs, bool root) +{ + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + for (; itB != itBEnd; ++itB) + { + const Poco::CppParser::Struct* pParent = itB->pClass; + if (pParent && Utility::hasAnyRemoteProperty(pParent)) + { + handleParentFunctionsImpl(pParent, methodSigs, false); + } + } + + Poco::CodeGeneration::CodeGenerator::Properties classProperties; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pStruct, classProperties); + + if (!root) + { + Poco::CppParser::Struct::Functions functions; + // we only handle public functions, others cannot be called remote + pStruct->methods(Poco::CppParser::Symbol::ACC_PUBLIC, functions); + Poco::CppParser::Struct::Functions::const_iterator it = functions.begin(); + Poco::CppParser::Struct::Functions::const_iterator itEnd = functions.end(); + + for (; it != itEnd; ++it) + { + CodeGenerator::Properties methodProperties(classProperties); + Poco::CodeGeneration::GeneratorEngine::parseProperties(*it, methodProperties); + std::string signature = (*it)->signature(); + if (methodSigs.find(signature) == methodSigs.end()) + { + methodSigs.insert(signature); + methodStart(*it, methodProperties); + methodEnd(*it, methodProperties); + } + } + } +} + + +void AbstractGenerator::addDocumentation(const Poco::CppParser::Symbol* pSymOld,Poco::CppParser::Symbol* pNew) +{ + if (pSymOld != 0 && !pSymOld->getDocumentation().empty()) + { + pNew->addDocumentation(pSymOld->getDocumentation()); + } + if (pSymOld != 0 && pNew != 0) + { + pNew->setAttributes(pSymOld->getAttributes()); + } +} + + +void AbstractGenerator::addParamDocu(Poco::CppParser::Parameter* pParam, const CodeGenerator::Properties& props) +{ + Poco::CodeGeneration::CodeGenerator::Properties::const_iterator it = props.find("$" + pParam->name()); + if (it != props.end()) + pParam->setDocumentation(it->second); +} + + +void AbstractGenerator::typeIdCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pGen = reinterpret_cast(addParam); + + gen.writeMethodImplementation("return " + InterfaceGenerator::generateClassName(pGen->_pStructIn) + "::remoting__typeId();"); +} + + +void AbstractGenerator::includeTypeSerializers(const Poco::CppParser::Function* pFunc, bool toHFile, bool writeDirectly) +{ + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + for (; it != itEnd; ++it) + { + std::string resType = Utility::resolveType(pFunc->nameSpace(), (*it)->declType()); + Poco::CppParser::Symbol* pS = pFunc->nameSpace()->lookup(resType); + if (pS) + { + if (pS->kind() != Poco::CppParser::Symbol::SYM_ENUM) + handleIncludeTypeSerializers(*it, toHFile, writeDirectly); + } + else + handleIncludeTypeSerializers(*it, toHFile, writeDirectly); + } + if (!pFunc->getReturnParameter().empty() && pFunc->getReturnParameter() != Poco::CodeGeneration::Utility::TYPE_VOID) + { + Poco::CppParser::Parameter ret(pFunc->getReturnParameter() + " dummy", 0); + std::string resType = Utility::resolveType(pFunc->nameSpace(), ret.declType()); + Poco::CppParser::Symbol* pS = pFunc->nameSpace()->lookup(resType); + if (pS) + { + if (pS->kind() != Poco::CppParser::Symbol::SYM_ENUM) + handleIncludeTypeSerializers(&ret, toHFile, writeDirectly); + } + else + handleIncludeTypeSerializers(&ret, toHFile, writeDirectly); + } +} + + +void AbstractGenerator::includeTypes(const Poco::CppParser::Function* pFunc, bool toHFile, bool writeDirectly) +{ + if (pFunc->isConstructor() || pFunc->isDestructor()) + return; + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + for (; it != itEnd; ++it) + { + handleIncludeTypes(*it, toHFile, writeDirectly); + } + if (!pFunc->getReturnParameter().empty() && pFunc->getReturnParameter() != Poco::CodeGeneration::Utility::TYPE_VOID) + { + Poco::CppParser::Parameter ret(pFunc->getReturnParameter() + " dummy", 0); + handleIncludeTypes(&ret, toHFile, writeDirectly); + } +} + + +void AbstractGenerator::handleIncludeTypeSerializers(const Poco::CppParser::Parameter* pParam, bool toHFile, bool writeDirectly) +{ + if (pParam->kind() == Poco::CppParser::Symbol::SYM_ENUM) + return; + std::string resType(resolveType(pParam->declType())); + Poco::trimInPlace(resType); + handleIncludeTypeSerializersImpl(resType, toHFile, writeDirectly); +} + + +void AbstractGenerator::handleIncludeTypeSerializers(const Poco::CppParser::Variable* pVar, bool toHFile, bool writeDirectly) +{ + const std::string& declType = pVar->declType(); + std::string resType(resolveType(declType)); + Poco::trimInPlace(resType); + handleIncludeTypeSerializersImpl(resType, toHFile, writeDirectly); +} + + +void AbstractGenerator::handleIncludeTypeSerializersImpl(const std::string& complexResolvedType, bool toHFile, bool writeDirectly) +{ + std::stack notIncludedTypes; + notIncludedTypes.push(complexResolvedType); + while (!notIncludedTypes.empty()) + { + std::string aType = notIncludedTypes.top(); + notIncludedTypes.pop(); + + if (GenUtility::isTemplateType(aType)) + { + std::vector innerTypes = GenUtility::getInnerTemplateTypes(aType); + for (std::size_t i = 0; i < innerTypes.size(); ++i) + { + notIncludedTypes.push(innerTypes[i]); + } + } + else + handleIncludeTypeSerializers(aType, toHFile, writeDirectly); + } +} + + +void AbstractGenerator::handleIncludeTypeSerializers(const std::string& simpleType, bool toHFile, bool writeDirectly) +{ + std::string resType(simpleType); + Poco::Util::LayeredConfiguration& cfg = Poco::Util::Application::instance().config(); + if (resType.find("std::") != 0 && + (BUILTIN_TYPES.find(resType) == BUILTIN_TYPES.end())) + { + resType = resType.substr(0, resType.find("<")); + Poco::CppParser::Symbol* pSym = Poco::CppParser::NameSpace::root()->lookup(resType); + if (!pSym) + pSym = _pStructIn->lookup(resType); + if (cfg.hasProperty("RemoteGen.output.includeRoot")) + { + std::string nameSpace; + if (pSym) + { + nameSpace = pSym->nameSpace()->fullName(); + } + else + { + std::string::size_type pos = resType.rfind("::"); + if (pos != std::string::npos) + { + nameSpace.assign(resType, 0, pos); + } + } + std::string includeBase = cfg.getString(Poco::format("RemoteGen.output.includePrefix[@namespace=%s]", nameSpace), ""); + if (includeBase.empty()) + { + Poco::Path incDir(includePath(cfg, nameSpace)); + Poco::Path rootDir(cfg.getString("RemoteGen.output.includeRoot")); + incDir.makeDirectory(); + rootDir.makeDirectory(); + incDir.makeAbsolute(); + rootDir.makeAbsolute(); + std::string incl = incDir.toString(Poco::Path::PATH_UNIX); + std::string root = rootDir.toString(Poco::Path::PATH_UNIX); + if (root.size() > incl.size() || root.compare(0, root.size(), incl, 0, root.size()) != 0) + throw Poco::InvalidArgumentException("The path specified in must be a parent of the one in ", root); + includeBase = incl.substr(root.size()); + } + else + { + if (includeBase.back() != '/') + { + includeBase += '/'; + } + } + std::string serType; + std::string deserType; + Poco::CppParser::Struct* pStruct = dynamic_cast(pSym); + if (pStruct) + { + serType = SerializerGenerator::generateClassName(pStruct); + deserType = DeserializerGenerator::generateClassName(pStruct); + } + else if (!pSym || pSym->kind() != Poco::CppParser::Symbol::SYM_ENUM) + { + Poco::StringTokenizer tok(resType, "::", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); + if (tok.count() == 1) + { + serType = *tok.begin()+"Serializer"; + deserType = *tok.begin()+"Deserializer"; + } + else + { + Poco::StringTokenizer::Iterator itClass = tok.end(); + --itClass; + Poco::StringTokenizer::Iterator itNS = itClass; + --itNS; + std::string tmp = *itNS; + if (*itClass != "AutoPtr" && *itClass != "SharedPtr" && *itNS != "Poco") + { + serType = *itClass+"Serializer"; + deserType = *itClass+"Deserializer"; + } + } + } + if (!serType.empty()) + handleIncludeFile(includeBase+serType+Utility::HFILEEXTENSION, toHFile, writeDirectly); + if (!deserType.empty()) + handleIncludeFile(includeBase+deserType+Utility::HFILEEXTENSION, toHFile, writeDirectly); + return; + } + Poco::CppParser::Struct* pStruct = dynamic_cast(pSym); + if (pStruct) + { + std::string serType = SerializerGenerator::generateClassName(pStruct); + std::string deserType = DeserializerGenerator::generateClassName(pStruct); + handleIncludeFile(serType+Utility::HFILEEXTENSION, toHFile, writeDirectly); + handleIncludeFile(deserType+Utility::HFILEEXTENSION, toHFile, writeDirectly); + return; + } + + // Note: the serializer class will probably not exist yet, so don't search in CppParser root namespace + Poco::StringTokenizer tok(resType, "::", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); + if (tok.count() == 1) + { + handleIncludeFile(*tok.begin()+"Serializer"+Utility::HFILEEXTENSION, toHFile, writeDirectly); + handleIncludeFile(*tok.begin()+"Deserializer"+Utility::HFILEEXTENSION, toHFile, writeDirectly); + } + else + { + Poco::StringTokenizer::Iterator itClass = tok.end(); + --itClass; + Poco::StringTokenizer::Iterator itNS = itClass; + --itNS; + std::string tmp = *itNS; + std::string fullNS = Poco::cat(std::string("::"), tok.begin(),itNS); + if (*itClass != "AutoPtr" && *itClass != "SharedPtr" && *itNS != "Poco") + { + std::string incDir = includePath(cfg, fullNS); + if (!incDir.empty()) + { + Poco::Path aPath(incDir); + aPath.makeDirectory(); + if (aPath.depth() > 0 && aPath.directory(aPath.depth() - 1).find("include") != std::string::npos) + { + tmp.clear(); + } + else if (aPath.depth() > 0) + { + tmp.clear(); + while (aPath.depth() > 0 && aPath.directory(aPath.depth() - 1).find("include") == std::string::npos) + { + if (!tmp.empty()) + tmp = aPath.directory(aPath.depth() - 1) + "/" + tmp; + else + tmp = aPath.directory(aPath.depth() - 1); + aPath = aPath.parent(); + } + } + else + tmp.clear(); + } + if (tmp.empty()) + { + handleIncludeFile((*itClass)+"Serializer"+Utility::HFILEEXTENSION, toHFile, writeDirectly); + handleIncludeFile((*itClass)+"Deserializer"+Utility::HFILEEXTENSION, toHFile, writeDirectly); + } + else + { + handleIncludeFile(tmp+"/"+(*itClass)+"Serializer"+Utility::HFILEEXTENSION, toHFile, writeDirectly); + handleIncludeFile(tmp+"/"+(*itClass)+"Deserializer"+Utility::HFILEEXTENSION, toHFile, writeDirectly); + } + } + } + } +} + + +void AbstractGenerator::handleIncludeTypes(const Poco::CppParser::Parameter* pParam, bool toHFile, bool writeDirectly) +{ + std::string resType(resolveType(pParam->declType())); + + size_t posVec = resType.find("vector"); + if (posVec != std::string::npos) + { + if (writeDirectly) + _cppGen.writeSystemInclude("vector"); + else + _cppGen.addSystemIncludeFile("vector"); + } + std::vector templType = GenUtility::getResolvedInnerTemplateTypes(_pStructIn, resType); + if (!templType.empty()) + { + for (int i = 0; i < templType.size(); ++i) + { + resType = templType[i]; + if (resType.find("std::") != 0 && + (BUILTIN_TYPES.find(resType) == BUILTIN_TYPES.end())) + { + Poco::StringTokenizer tok(resType, "::"); + if (tok.count() == 1) + handleIncludeFile(*tok.begin()+Utility::HFILEEXTENSION, toHFile, writeDirectly); + else + { + Poco::StringTokenizer::Iterator itClass = tok.end(); + --itClass; + Poco::StringTokenizer::Iterator itNS = itClass; + --itNS; + handleIncludeFile((*itNS)+"/"+(*itClass)+Utility::HFILEEXTENSION, toHFile, writeDirectly); + } + } + } + } + else + { + if (resType.find("std::") != 0 && + (BUILTIN_TYPES.find(resType) == BUILTIN_TYPES.end())) + { + Poco::StringTokenizer tok(resType, "::"); + if (tok.count() == 1) + handleIncludeFile(*tok.begin()+Utility::HFILEEXTENSION, toHFile, writeDirectly); + else + { + Poco::StringTokenizer::Iterator itClass = tok.end(); + --itClass; + Poco::StringTokenizer::Iterator itNS = itClass; + --itNS; + handleIncludeFile((*itNS)+"/"+(*itClass)+Utility::HFILEEXTENSION, toHFile, writeDirectly); + } + } + } +} + + +void AbstractGenerator::handleIncludeFile(const std::string& iFile, bool toHFile, bool writeDirectly) +{ + std::string incFile = iFile; + Poco::Util::LayeredConfiguration& cfg = Poco::Util::Application::instance().config(); + bool flat = cfg.getBool("RemoteGen.output.flatIncludes", false); + if (flat) + { + incFile = Poco::CodeGeneration::Utility::createInclude(iFile, true); + } + if (toHFile) + { + if (writeDirectly) + _cppGen.writeInclude(incFile, toHFile); + else + _cppGen.addIncludeFile(incFile); + } + else + { + if (writeDirectly) + _cppGen.writeSrcInclude(incFile); + else + _cppGen.addSrcIncludeFile(incFile); + } +} + + +std::string AbstractGenerator::resolveType(const std::string& in) +{ + static int recursionCount = 0; + Poco::CodeGeneration::RecursionGuard recursionGuard(recursionCount, Poco::RuntimeException("Recursion limit reached resolving type", in)); + + std::string decl(in); + Poco::CppParser::Symbol* pSym = _pStructIn->lookup(in); + if (pSym) + { + if (pSym->kind() == Poco::CppParser::Symbol::SYM_TYPEDEF) + { + Poco::CppParser::TypeDef* pType = static_cast(pSym); + decl = pType->baseType(); + return resolveType(decl); + } + else if (pSym->kind() == Poco::CppParser::Symbol::SYM_TYPEALIAS) + { + Poco::CppParser::TypeAlias* pType = static_cast(pSym); + decl = pType->baseType(); + return resolveType(decl); + } + } + return Utility::resolveType(_pStructIn, decl); +} + + +std::string AbstractGenerator::includePath(const Poco::Util::AbstractConfiguration& config, const std::string& nameSpace) +{ + return config.getString( + Poco::format("RemoteGen.output.include[@namespace=%s]", nameSpace), + config.getString("RemoteGen.output.include", "") + ); +} + + +std::string AbstractGenerator::includePath(const Poco::Util::AbstractConfiguration& config, const Poco::CppParser::Struct* pStruct) +{ + if (pStruct && pStruct->nameSpace()) + return includePath(config, pStruct->nameSpace()->fullName()); + else + return includePath(config, std::string()); +} + + +const std::set AbstractGenerator::initBuiltinTypes() +{ + std::set builtins; + + builtins.insert("long long"); + builtins.insert("unsigned long long"); + builtins.insert("signed long long"); + builtins.insert("long long int"); + builtins.insert("unsigned long long int"); + builtins.insert("signed long long int"); + builtins.insert("long"); + builtins.insert("unsigned long"); + builtins.insert("signed long"); + builtins.insert("long int"); + builtins.insert("unsigned long int"); + builtins.insert("signed long int"); + builtins.insert("int"); + builtins.insert("unsigned int"); + builtins.insert("signed int"); + builtins.insert("signed"); + builtins.insert("unsigned"); + builtins.insert("short"); + builtins.insert("unsigned short"); + builtins.insert("signed short"); + builtins.insert("short int"); + builtins.insert("unsigned short int"); + builtins.insert("signed short int"); + builtins.insert("char"); + builtins.insert("unsigned char"); + builtins.insert("signed char"); + builtins.insert("bool"); + builtins.insert("long double"); + builtins.insert("double"); + builtins.insert("float"); + builtins.insert("Poco::UInt8"); + builtins.insert("Poco::UInt16"); + builtins.insert("Poco::UInt32"); + builtins.insert("Poco::UInt64"); + builtins.insert("Poco::UIntPtr"); + builtins.insert("Poco::Int8"); + builtins.insert("Poco::Int16"); + builtins.insert("Poco::Int32"); + builtins.insert("Poco::Int64"); + builtins.insert("Poco::IntPtr"); + builtins.insert("UInt8"); + builtins.insert("UInt16"); + builtins.insert("UInt32"); + builtins.insert("UInt64"); + builtins.insert("UIntPtr"); + builtins.insert("Int8"); + builtins.insert("Int16"); + builtins.insert("Int32"); + builtins.insert("Int64"); + builtins.insert("IntPtr"); + builtins.insert("string"); + builtins.insert("std::string"); + builtins.insert("Poco::DateTime"); + builtins.insert("DateTime"); + builtins.insert("Poco::LocalDateTime"); + builtins.insert("LocalDateTime"); + builtins.insert("Poco::Timespan"); + builtins.insert("Timespan"); + builtins.insert("Poco::Timestamp"); + builtins.insert("Timestamp"); + builtins.insert("URI"); + builtins.insert("Poco::URI"); + builtins.insert("UUID"); + builtins.insert("Poco::UUID"); + + return builtins; +} diff --git a/RemotingNG/RemoteGen/src/AbstractGenerator.h b/RemotingNG/RemoteGen/src/AbstractGenerator.h new file mode 100644 index 0000000000..a6de0ff8d7 --- /dev/null +++ b/RemotingNG/RemoteGen/src/AbstractGenerator.h @@ -0,0 +1,253 @@ +// +// AbstractGenerator.h +// +// Definition of the AbstractGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef RemoteGen_AbstractGenerator_INCLUDED +#define RemoteGen_AbstractGenerator_INCLUDED + + +#include "Poco/CodeGeneration/CodeGenerator.h" +#include "Poco/CppParser/Parameter.h" +#include "Poco/Util/AbstractConfiguration.h" +#include "Poco/BasicEvent.h" +#include + + +namespace Poco { +namespace CodeGeneration { + + +class GeneratorEngine; +class CppGenerator; + + +} } + + +class AbstractGenerator: public Poco::CodeGeneration::CodeGenerator + /// AbstractGenerator generates a remote interface for a given class definition. C++ specific. + /// Has no members, a default constructor/destructor and only virtual = 0; methods +{ +public: + static const std::set BUILTIN_TYPES; + + static Poco::BasicEvent EError; + + AbstractGenerator(Poco::CodeGeneration::CppGenerator& cppGen); + /// Creates the AbstractGenerator. + + virtual ~AbstractGenerator(); + /// Destroys the AbstractGenerator. + + void writeDefaultHeader(const Poco::CppParser::Struct* pStruct, const std::string& className, const std::string& libraryName, const std::string& package); + /// Writes the default header, e.g. copyright notice, no include namespace open or anything else is written + /// This is always the first method that is called! + + void writeInclude(const std::string& include, bool toHeader); + + void writeSystemInclude(const std::string& include); + + void writeNameSpaceBegin(const std::string& namespacePrefix); + /// Writes the namespacePrefix+"_BEGIN" + + void writeFwdDecls(const CodeGenerator::FwdDecls& decl); + + void writeNameSpaceEnd(const std::string& namespacePrefix); + /// Writes the namespacePrefix+"_END" + + virtual void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// The default impl simply clones the incoming struct. Override this method. + + virtual void structEnd(); + /// Must not write the namespace + + virtual Poco::CppParser::Function* methodClone(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Clones the function + + virtual Poco::CppParser::Struct* structClone(const Poco::CppParser::Struct* pStructIn, const std::string& newClassName, const std::vector& baseClasses = std::vector()); + /// Clones the struct without any methods or member variables! + + virtual void registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e) = 0; + + virtual std::string newClassName(const Poco::CppParser::Struct* pStruct) = 0; + /// generates the new class name based on the old one + + virtual std::vector newBaseClasses(const Poco::CppParser::Struct* pStruct) = 0; + /// generates the new base classes + + void writeMethodImplementation(const std::string& code); + /// Only valid when inside a method. Simply forwards the code lines to the implementation file. + + void writeImplementation(const std::string& code); + + virtual void methodEnd(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Closes the method + + void variablesStart(); + + void variable(const Poco::CppParser::Variable* pVar); + + void variablesEnd(); + + void endFile(); + + void writeTypeDef(const Poco::CppParser::TypeDef*); + + void writeUsing(const Poco::CppParser::TypeAlias*); + + static void addDocumentation(const Poco::CppParser::Symbol* pSymOld,Poco::CppParser::Symbol* pNew); + /// Takes the docu from the old symbol and adds it to the new one removing the remote property, + /// but adding the generated property. + + static void addParamDocu(Poco::CppParser::Parameter* pParam, const CodeGenerator::Properties& functionProperties); + /// Searches the docu for the parameter specific properties and sets them as docu at pParam + + static std::string includePath(const Poco::Util::AbstractConfiguration& config, const std::string& nameSpace); + /// Returns the include file output path for the given namespace. + + static std::string includePath(const Poco::Util::AbstractConfiguration& config, const Poco::CppParser::Struct* pStruct); + +protected: + void handleParentFunctions(const Poco::CppParser::Struct* pStruct); + /// fwds all the methods of all parents to the methodStart method of the generator. + + void handleParentFunctionsImpl(const Poco::CppParser::Struct* pStruct, std::set& methodSigs, bool root = true); + /// fwds all the methods of all parents to the methodStart method of the generator. + + void includeTypeSerializers(const Poco::CppParser::Function* pFunc, bool toHFile, bool writeDirectly); + /// Includes serializers/deserializers for the parameters of a function. + + void handleIncludeTypeSerializers(const Poco::CppParser::Variable* pVar, bool toHFile, bool writeDirectly); + /// Includes serializers/deserializers for a member variable + + void handleIncludeTypeSerializersImpl(const std::string& complexResolvedType, bool toHFile, bool writeDirectly); + /// Includes serializers/deserializers for a complex type + + void includeTypes(const Poco::CppParser::Function* pFunc, bool toHFile, bool writeDirectly); + /// Includes files for data types. Catches cases where data is only fwd declared and the generated code is using it + + static void typeIdCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + /// Code generator for the getTypeId method + + std::string resolveType(const std::string& decl); + /// Resolves typedefs. + + Poco::CodeGeneration::CppGenerator& cppGen(); + /// Returns the cpp code generator + +private: + static const std::set initBuiltinTypes(); + + void handleIncludeTypeSerializers(const Poco::CppParser::Parameter* pParam, bool toHFile, bool writeDirectly); + /// Includes serializers/deserializers for the parameters of a function. + + void handleIncludeTypeSerializers(const std::string& simpleType, bool toHFile, bool writeDirectly); + /// Includes serializers/deserializers for simple types + + void handleIncludeTypes(const Poco::CppParser::Parameter* pParam, bool toHFile, bool writeDirectly); + /// Includes files for data types. Catches cases where data is only fwd declared and the generated code is using it + + void handleIncludeFile(const std::string& incFile, bool toHFile, bool writeDirectly); + + +protected: + Poco::CodeGeneration::CppGenerator& _cppGen; + Poco::CppParser::Struct* _pStruct; + const Poco::CppParser::Struct* _pStructIn; + Poco::CppParser::NameSpace* _pNs; +}; + + +// +// inlines +// +inline void AbstractGenerator::writeDefaultHeader(const Poco::CppParser::Struct* pStruct, const std::string& className, const std::string& libraryName, const std::string& package) +{ +} + + +inline void AbstractGenerator::writeInclude(const std::string& include, bool) +{ +} + + +inline void AbstractGenerator::writeSystemInclude(const std::string& include) +{ +} + + +inline void AbstractGenerator::writeNameSpaceBegin(const std::string& namespacePrefix) +{ +} + + +inline void AbstractGenerator::writeFwdDecls(const CodeGenerator::FwdDecls& decl) +{ +} + + +inline void AbstractGenerator::writeNameSpaceEnd(const std::string& namespacePrefix) +{ +} + + +inline void AbstractGenerator::writeMethodImplementation(const std::string& code) +{ +} + + +inline void AbstractGenerator::writeImplementation(const std::string& code) +{ +} + + +inline void AbstractGenerator::methodEnd(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties) +{ +} + + +inline void AbstractGenerator::variablesStart() +{ +} + + +inline void AbstractGenerator::variable(const Poco::CppParser::Variable*) +{ +} + + +inline void AbstractGenerator::variablesEnd() +{ +} + + +inline void AbstractGenerator::endFile() +{ +} + + +inline void AbstractGenerator::writeTypeDef(const Poco::CppParser::TypeDef*) +{ +} + + +inline void AbstractGenerator::writeUsing(const Poco::CppParser::TypeAlias*) +{ +} + + +inline Poco::CodeGeneration::CppGenerator& AbstractGenerator::cppGen() +{ + return _cppGen; +} + + +#endif // RemoteGen_AbstractGenerator_INCLUDED diff --git a/RemotingNG/RemoteGen/src/BundleActivatorGenerator.cpp b/RemotingNG/RemoteGen/src/BundleActivatorGenerator.cpp new file mode 100644 index 0000000000..889d26d7a2 --- /dev/null +++ b/RemotingNG/RemoteGen/src/BundleActivatorGenerator.cpp @@ -0,0 +1,653 @@ +// +// BundleActivatorGenerator.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "BundleActivatorGenerator.h" +#include "ProxyFactoryGenerator.h" +#include "RemoteObjectGenerator.h" +#include "InterfaceGenerator.h" +#include "SkeletonGenerator.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CodeGeneration/CppGenerator.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/Exception.h" +#include "Poco/Path.h" +#include "Poco/NumberFormatter.h" +#include + + +using Poco::CodeGeneration::Utility; +using Poco::CodeGeneration::CppGenerator; + + +BundleActivatorGenerator::BundleActivatorGenerator( + Poco::CodeGeneration::CppGenerator& cppGen, + std::ostream* pImplOut, + const std::string& className, + const std::vector& services): + AbstractGenerator(cppGen), + _pImplOut(pImplOut), + _clientMode(requiresClientCode(services)), + _serverMode(requiresServerCode(services)), + _className(className), + _services(services) +{ +} + + +BundleActivatorGenerator::~BundleActivatorGenerator() +{ +} + + +void BundleActivatorGenerator::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + // we don't care about pStruct, we only care about our service members! + _pStruct = structClone(pStruct, _className, newBaseClasses(pStruct)); + // member variables + + Poco::CppParser::Variable* pVar = new Poco::CppParser::Variable("std::vector _services", _pStruct); + pVar->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + Poco::CppParser::Variable* pVar2 = new Poco::CppParser::Variable("std::set _uris", _pStruct); + pVar2->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + Poco::CppParser::Variable* pVar3 = new Poco::CppParser::Variable("Poco::RemotingNG::ORB* _pORB", _pStruct); + pVar3->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + Poco::CppParser::Variable* pVar4 = new Poco::CppParser::Variable("std::set _listeners", _pStruct); + pVar4->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + + // methods + // constructor + { + Poco::CppParser::Function* pConstr = new Poco::CppParser::Function(_pStruct->name(), _pStruct); + pConstr->setAccess(Poco::CppParser::Symbol::ACC_PUBLIC); + pConstr->addDocumentation(" Creates a " + _pStruct->name() + ". Initializes the bundle."); + } + //destructor + { + Poco::CppParser::Function* pDestr = new Poco::CppParser::Function(std::string("~")+_pStruct->name(), _pStruct); + pDestr->setAccess(Poco::CppParser::Symbol::ACC_PUBLIC); + pDestr->addDocumentation(" Destroys the " + _pStruct->name() + "."); + } + + // void start(BundleContext::Ptr pContext) + { + Poco::CppParser::Function* pStart = new Poco::CppParser::Function("void start", _pStruct); + pStart->addDocumentation(" Starts the services inside the bundle."); + Poco::CppParser::Parameter* pParam1= new Poco::CppParser::Parameter("Poco::OSP::BundleContext::Ptr pContext", 0); + pStart->addParameter(pParam1); + } + + // void stop(BundleContext::Ptr pContext) + { + Poco::CppParser::Function* pStop = new Poco::CppParser::Function("void stop", _pStruct); + pStop->addDocumentation(" Stops the services inside the bundle."); + Poco::CppParser::Parameter* pParam1= new Poco::CppParser::Parameter("Poco::OSP::BundleContext::Ptr pContext", 0); + pStop->addParameter(pParam1); + } + + // Poco::RemotingNG::ORB& orb() + { + Poco::CppParser::Function* pORB = new Poco::CppParser::Function("Poco::RemotingNG::ORB& orb", _pStruct); + pORB->addDocumentation(" Returns a reference to the Remoting ORB."); + } + + //protected: + //server methods: add always + { + // std::pair + // registerRemoteService(BundleContext::Ptr pContext, Poco::OSP::Service::Ptr pService, const std::string& listener, const std::string& serviceName, Poco::OSP::Properties props = Poco::OSP::Properties()) + { + Poco::CppParser::Function* pReg = new Poco::CppParser::Function("std::pair registerRemoteService", _pStruct); + pReg->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + pReg->addDocumentation(" Registers the service with the ORB and at the ServiceRegistry the bundle. Returns the Remoting URI and the serviceRef."); + Poco::CppParser::Parameter* pParam0= new Poco::CppParser::Parameter("Poco::OSP::BundleContext::Ptr pContext", 0); + Poco::CppParser::Parameter* pParam1= new Poco::CppParser::Parameter("Poco::OSP::Service::Ptr pService", 0); + Poco::CppParser::Parameter* pParam2= new Poco::CppParser::Parameter("const std::string& listener", 0); + Poco::CppParser::Parameter* pParam3= new Poco::CppParser::Parameter("const std::string& serviceName", 0); + Poco::CppParser::Parameter* pParam4= new Poco::CppParser::Parameter("Poco::OSP::Properties props = Poco::OSP::Properties()", 0); + + pReg->addParameter(pParam0); + pReg->addParameter(pParam1); + pReg->addParameter(pParam2); + pReg->addParameter(pParam3); + pReg->addParameter(pParam4); + } + + // std::string registerRemoteObject(Poco::RemotingNG::RemoteObject::Ptr pObj, const std::string& listener) + { + Poco::CppParser::Function* pReg = new Poco::CppParser::Function("std::string registerRemoteObject", _pStruct); + pReg->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + pReg->addDocumentation(" Registers the service with the ORB only. Returns the Remoting URI for the remote object."); + Poco::CppParser::Parameter* pParam1= new Poco::CppParser::Parameter("Poco::RemotingNG::RemoteObject::Ptr pObj", 0); + Poco::CppParser::Parameter* pParam2= new Poco::CppParser::Parameter("const std::string& listener", 0); + + pReg->addParameter(pParam1); + pReg->addParameter(pParam2); + } + + // std::string registerListener(Listener::Ptr pListener) + { + Poco::CppParser::Function* pReg = new Poco::CppParser::Function("std::string registerListener", _pStruct); + pReg->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + pReg->addDocumentation(" Registers the listener at the ORB. Returns the id of the endpoint. listener will be automatically unregistered with bundle stop"); + Poco::CppParser::Parameter* pParam1 = new Poco::CppParser::Parameter("Poco::RemotingNG::Listener::Ptr pListener", 0); + pReg->addParameter(pParam1); + } + + // Poco::OSP::ServiceRef::Ptr registerService(Poco::OSP::BundleContext::Ptr pContext, const std::string& serviceName, Poco::OSP::Service::Ptr pService, Poco::OSP::Properties props = Poco::OSP::Properties()) + { + Poco::CppParser::Function* pReg = new Poco::CppParser::Function("Poco::OSP::ServiceRef::Ptr registerService", _pStruct); + pReg->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + pReg->addDocumentation(" Registers the service at the serviceRegistry only. Stores the serviceRef for auto unregister"); + + Poco::CppParser::Parameter* pParam0= new Poco::CppParser::Parameter("Poco::OSP::BundleContext::Ptr pContext", 0); + Poco::CppParser::Parameter* pParam1= new Poco::CppParser::Parameter("const std::string& serviceName", 0); + Poco::CppParser::Parameter* pParam2= new Poco::CppParser::Parameter("Poco::OSP::Service::Ptr pService", 0); + Poco::CppParser::Parameter* pParam3= new Poco::CppParser::Parameter("Poco::OSP::Properties props = Poco::OSP::Properties()", 0); + + pReg->addParameter(pParam0); + pReg->addParameter(pParam1); + pReg->addParameter(pParam2); + pReg->addParameter(pParam3); + } + + // void unregisterRemoteService(Poco::OSP::BundleContext::Ptr pContext, const std::string& uri, Poco::OSP::ServiceRef::Ptr pService) + { + Poco::CppParser::Function* pReg = new Poco::CppParser::Function("void unregisterRemoteService", _pStruct); + pReg->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + pReg->addDocumentation(" Unregisters the service at the ORB and at the ServiceRegistry."); + + Poco::CppParser::Parameter* pParam0= new Poco::CppParser::Parameter("Poco::OSP::BundleContext::Ptr pContext", 0); + Poco::CppParser::Parameter* pParam1= new Poco::CppParser::Parameter("const std::string& uri", 0); + Poco::CppParser::Parameter* pParam2= new Poco::CppParser::Parameter("Poco::OSP::ServiceRef::Ptr pService", 0); + + pReg->addParameter(pParam0); + pReg->addParameter(pParam1); + pReg->addParameter(pParam2); + } + + // void unregisterRemoteObject(const std::string& uri) + { + Poco::CppParser::Function* pReg = new Poco::CppParser::Function("void unregisterRemoteObject", _pStruct); + pReg->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + pReg->addDocumentation(" Unregisters the service at the ORB only."); + + Poco::CppParser::Parameter* pParam1= new Poco::CppParser::Parameter("const std::string& uri", 0); + + pReg->addParameter(pParam1); + } + + // void unregisterService(Poco::OSP::BundleContext::Ptr pContext, Poco::OSP::ServiceRef::Ptr pService) + { + Poco::CppParser::Function* pReg = new Poco::CppParser::Function("void unregisterService", _pStruct); + pReg->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + pReg->addDocumentation(" Unregisters the service at the serviceRegistry only."); + + Poco::CppParser::Parameter* pParam0= new Poco::CppParser::Parameter("Poco::OSP::BundleContext::Ptr pContext", 0); + Poco::CppParser::Parameter* pParam1= new Poco::CppParser::Parameter("Poco::OSP::ServiceRef::Ptr pService", 0); + + pReg->addParameter(pParam0); + pReg->addParameter(pParam1); + } + + // void unregisterListener(const std::string& listener) + { + Poco::CppParser::Function* pReg = new Poco::CppParser::Function("void unregisterListener", _pStruct); + pReg->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + pReg->addDocumentation(" Unregisters the listener at the ORB."); + Poco::CppParser::Parameter* pParam1 = new Poco::CppParser::Parameter("const std::string& listener", 0); + pReg->addParameter(pParam1); + } + + // void unregisterAll(BundleContext::Ptr pContext) + { + Poco::CppParser::Function* pReg = new Poco::CppParser::Function("void unregisterAll", _pStruct); + pReg->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + pReg->addDocumentation(" Unregisters all services and remoteobjects. Automatically called by stop method."); + Poco::CppParser::Parameter* pParam1= new Poco::CppParser::Parameter("Poco::OSP::BundleContext::Ptr pContext", 0); + pReg->addParameter(pParam1); + } + + //void setupRemotingOSP() + { + Poco::CppParser::Function* pReg = new Poco::CppParser::Function("void setupRemotingOSP", _pStruct); + pReg->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + pReg->addDocumentation(" Initializes skeletons, proxyfactories and servicefactories."); + Poco::CppParser::Parameter* pParam0= new Poco::CppParser::Parameter("Poco::OSP::BundleContext::Ptr pContext", 0); + pReg->addParameter(pParam0); + } + + //void shutdownRemotingOSP() + { + Poco::CppParser::Function* pReg = new Poco::CppParser::Function("void shutdownRemotingOSP", _pStruct); + pReg->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + pReg->addDocumentation(" Deinitializes skeletons, proxyfactories and servicefactories for this bundle."); + Poco::CppParser::Parameter* pParam0= new Poco::CppParser::Parameter("Poco::OSP::BundleContext::Ptr pContext", 0); + pReg->addParameter(pParam0); + } + + // includes + _cppGen.addIncludeFile("Poco/OSP/ServiceRef.h"); + _cppGen.addIncludeFile("Poco/RemotingNG/ORB.h"); + _cppGen.addSystemIncludeFile("vector"); + _cppGen.addSystemIncludeFile("set"); + _cppGen.addSystemIncludeFile("algorithm"); + } // _serverMode + + + // includes + _cppGen.addIncludeFile("Poco/OSP/BundleActivator.h"); + _cppGen.addIncludeFile("Poco/OSP/ServiceRef.h"); + + _cppGen.addIncludeFile("Poco/RemotingNG/Identifiable.h"); + + // src includes + + // we need to register the proxyfactories for all structs + std::vector::const_iterator it = _services.begin(); + Poco::CppParser::NameSpace* pRoot = Poco::CppParser::NameSpace::root(); + for (; it != _services.end(); ++it) + { + if (it->clientCode) + { + std::string fullName = ProxyFactoryGenerator::generateQualifiedClassName(nameSpace(), it->pStruct); + const Poco::CppParser::Struct* pF = dynamic_cast (pRoot->lookup(fullName)); + if (!pF) + throw Poco::NotFoundException("didn't find proxyfactory for class " + it->pStruct->fullName()); + Poco::CodeGeneration::Utility::handleSrcInclude(pF, _cppGen); + } + if (it->serverCode) + { + std::string fullName = SkeletonGenerator::generateQualifiedClassName(nameSpace(), it->pStruct); + const Poco::CppParser::Struct* pF = dynamic_cast (pRoot->lookup(fullName)); + if (!pF) + throw Poco::NotFoundException("didn't find skeleton for class " + it->pStruct->fullName()); + Poco::CodeGeneration::Utility::handleSrcInclude(pF, _cppGen); + } + } + + _cppGen.addSrcIncludeFile("Poco/RemotingNG/URIUtility.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/RemoteObject.h"); + _cppGen.addSrcIncludeFile("Poco/OSP/OSPException.h"); + _cppGen.addSrcIncludeFile("Poco/OSP/ServiceRegistry.h"); + _cppGen.addSrcIncludeFile("Poco/ClassLibrary.h"); +} + + +void BundleActivatorGenerator::structEnd() +{ + std::string className = _pStruct->name(); + std::string fullClassName = _pStruct->fullName(); + AbstractGenerator::structEnd(); // clears _pStruct! + cppGen().writeImplementation("POCO_BEGIN_MANIFEST(Poco::OSP::BundleActivator)"); + cppGen().writeImplementation("\tPOCO_EXPORT_CLASS(" + fullClassName + ")"); + cppGen().writeImplementation("POCO_END_MANIFEST"); + cppGen().writeImplementation(""); +} + + +void BundleActivatorGenerator::methodStart(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& properties) +{ +} + + +void BundleActivatorGenerator::registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e) +{ + e.registerCallback(_pStruct->name(), &BundleActivatorGenerator::constructorCodeGen); + e.registerCallback("~"+_pStruct->name(), &Poco::CodeGeneration::GeneratorEngine::emptyCodeGen); + e.registerCallback("start", &BundleActivatorGenerator::startCodeGen); + e.registerCallback("stop", &BundleActivatorGenerator::stopCodeGen); + e.registerCallback("registerRemoteService", &BundleActivatorGenerator::registerRemoteServiceCodeGen); + e.registerCallback("registerRemoteObject", &BundleActivatorGenerator::registerRemoteObjectCodeGen); + e.registerCallback("registerService", &BundleActivatorGenerator::registerServiceCodeGen); + e.registerCallback("registerListener", &BundleActivatorGenerator::registerListenerCodeGen); + e.registerCallback("unregisterRemoteService", &BundleActivatorGenerator::unregisterRemoteServiceCodeGen); + e.registerCallback("unregisterRemoteObject", &BundleActivatorGenerator::unregisterRemoteObjectCodeGen); + e.registerCallback("unregisterService", &BundleActivatorGenerator::unregisterServiceCodeGen); + e.registerCallback("unregisterListener", &BundleActivatorGenerator::unregisterListenerCodeGen); + e.registerCallback("unregisterAll", &BundleActivatorGenerator::unregisterAllCodeGen); + e.registerCallback("setupRemotingOSP", &BundleActivatorGenerator::setupRemotingOSPCodeGen); + e.registerCallback("shutdownRemotingOSP", &BundleActivatorGenerator::shutdownRemotingOSPCodeGen); + e.registerCallback("orb", &BundleActivatorGenerator::orbCodeGen); +} + + +std::vector BundleActivatorGenerator::newBaseClasses(const Poco::CppParser::Struct* pStruct) +{ + // Poco::OSP::BundleActivator + std::vector bases; + bases.push_back("Poco::OSP::BundleActivator"); + return bases; +} + + +void BundleActivatorGenerator::constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("_pORB = &Poco::RemotingNG::ORB::instance();"); +} + + +void BundleActivatorGenerator::startCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("setupRemotingOSP(pContext);"); + gen.writeMethodImplementation("startImpl(pContext);"); + // create service here + createServicesCodeGen(pFunc, pStruct, gen, addParam); +} + + +void BundleActivatorGenerator::stopCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("stopImpl(pContext);"); + gen.writeMethodImplementation("unregisterAll(pContext);"); + gen.writeMethodImplementation("shutdownRemotingOSP(pContext);"); +} + + +void BundleActivatorGenerator::registerRemoteServiceCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + BundleActivatorGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + // std::pair + // registerRemoteService(BundleContext::Ptr pContext, + // Poco::OSP::Service::Ptr pService, + // const std::string& listener + // const std::string& serviceName + // Poco::OSP::Properties props) + gen.writeMethodImplementation("Poco::RemotingNG::RemoteObject::Ptr pObj = pService.cast();"); + gen.writeMethodImplementation("std::string uri = registerRemoteObject(pObj, listener);"); + gen.writeMethodImplementation("props.set(\"uri\", uri);"); + gen.writeMethodImplementation("Poco::OSP::ServiceRef::Ptr pRef;"); + gen.writeMethodImplementation("try"); + gen.writeMethodImplementation("{"); + gen.writeMethodImplementation("\tpRef = registerService(pContext, serviceName, pService, props);"); + gen.writeMethodImplementation("\tif (!pRef)"); + gen.writeMethodImplementation("\t\tthrow Poco::OSP::OSPException(\"Failed to register service \" + serviceName);"); + gen.writeMethodImplementation("}"); + gen.writeMethodImplementation("catch (...)"); + gen.writeMethodImplementation("{"); + gen.writeMethodImplementation("\tunregisterRemoteObject(uri);"); + gen.writeMethodImplementation("\tthrow;"); + gen.writeMethodImplementation("}"); + gen.writeMethodImplementation("return std::make_pair(uri, pRef);"); + + CppGenerator* pCppGen = dynamic_cast(&gen); + if (pCppGen) + { + pCppGen->writeToHeader("\tvirtual void startImpl(Poco::OSP::BundleContext::Ptr pContext);"); + pCppGen->writeToHeader("\t\t/// Implement this method in the Impl file to create all the services/listeners and register them via registerService"); + pCppGen->writeToHeader(""); + pCppGen->writeToHeader("\tvirtual void stopImpl(Poco::OSP::BundleContext::Ptr pContext);"); + pCppGen->writeToHeader("\t\t/// Implement this method in the Impl file for custom stop functionality."); + pCppGen->writeToHeader(""); + } +} + + +void BundleActivatorGenerator::unregisterRemoteServiceCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + BundleActivatorGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + //void unregisterRemoteService(const std::string& uri, Poco::OSP::ServiceRef::Ptr pService) + gen.writeMethodImplementation("unregisterService(pContext, pService);"); + gen.writeMethodImplementation("unregisterRemoteObject(uri);"); +} + + +void BundleActivatorGenerator::registerRemoteObjectCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + BundleActivatorGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + gen.writeMethodImplementation("std::string uri = _pORB->registerObject(pObj, listener);"); + gen.writeMethodImplementation("_uris.insert(uri);"); + gen.writeMethodImplementation("return uri;"); +} + + +void BundleActivatorGenerator::unregisterRemoteObjectCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("_uris.erase(uri);"); + gen.writeMethodImplementation("_pORB->unregisterObject(uri);"); +} + + +void BundleActivatorGenerator::registerServiceCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("Poco::OSP::ServiceRef::Ptr pRef = pContext->registry().registerService(serviceName, pService, props);"); + gen.writeMethodImplementation("_services.push_back(pRef);"); + gen.writeMethodImplementation("return pRef;"); +} + + +void BundleActivatorGenerator::unregisterServiceCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("std::vector::iterator it = std::find(_services.begin(), _services.end(), pService);"); + gen.writeMethodImplementation("if (it != _services.end())"); + gen.writeMethodImplementation("{"); + gen.writeMethodImplementation("\t_services.erase(it);"); + gen.writeMethodImplementation("\tpContext->registry().unregisterService(pService);"); + gen.writeMethodImplementation("}"); +} + + +void BundleActivatorGenerator::registerListenerCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("std::string listener = _pORB->registerListener(pListener);"); + gen.writeMethodImplementation("_listeners.insert(listener);"); + gen.writeMethodImplementation("return listener;"); +} + + +void BundleActivatorGenerator::unregisterListenerCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("_listeners.erase(listener);"); + gen.writeMethodImplementation("_pORB->unregisterListener(listener);"); +} + + +void BundleActivatorGenerator::unregisterAllCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + BundleActivatorGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + + gen.writeMethodImplementation("for (std::vector::reverse_iterator it = _services.rbegin(); it != _services.rend(); ++it)"); + gen.writeMethodImplementation("{"); + gen.writeMethodImplementation("\ttry"); + gen.writeMethodImplementation("\t{"); + gen.writeMethodImplementation("\t\tunregisterService(pContext, *it);"); + gen.writeMethodImplementation("\t}"); + gen.writeMethodImplementation("\tcatch (...)"); + gen.writeMethodImplementation("\t{"); + gen.writeMethodImplementation("\t\tpContext->logger().error(\"Failed to unregister service \" + (*it)->name());"); + gen.writeMethodImplementation("\t}"); + gen.writeMethodImplementation("}"); + + gen.writeMethodImplementation("for (std::set::iterator it = _uris.begin(); it != _uris.end(); ++it)"); + gen.writeMethodImplementation("{"); + gen.writeMethodImplementation("\ttry"); + gen.writeMethodImplementation("\t{"); + gen.writeMethodImplementation("\t\tunregisterRemoteObject(*it);"); + gen.writeMethodImplementation("\t}"); + gen.writeMethodImplementation("\tcatch (...)"); + gen.writeMethodImplementation("\t{"); + gen.writeMethodImplementation("\t\tpContext->logger().error(\"Failed to unregister RemoteObject \" + (*it));"); + gen.writeMethodImplementation("\t}"); + gen.writeMethodImplementation("}"); + gen.writeMethodImplementation("for (std::set::iterator it = _listeners.begin(); it != _listeners.end(); ++it)"); + gen.writeMethodImplementation("{"); + gen.writeMethodImplementation("\ttry"); + gen.writeMethodImplementation("\t{"); + gen.writeMethodImplementation("\t\tunregisterListener(*it);"); + gen.writeMethodImplementation("\t}"); + gen.writeMethodImplementation("\tcatch (...)"); + gen.writeMethodImplementation("\t{"); + gen.writeMethodImplementation("\t\tpContext->logger().error(\"Failed to unregister listener \" + (*it));"); + gen.writeMethodImplementation("\t}"); + gen.writeMethodImplementation("}"); + gen.writeMethodImplementation("_services.clear();"); + gen.writeMethodImplementation("_uris.clear();"); + gen.writeMethodImplementation("_listeners.clear();"); +} + + +void BundleActivatorGenerator::createServicesCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + BundleActivatorGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + if (pGen->_pImplOut) + { + std::string incl = Poco::CodeGeneration::Utility::createInclude(pGen->_pStruct, gen.usePocoIncludeStyle()); + + std::ostream& out = *(pGen->_pImplOut); + out << "#include \"" << incl << "\"\n\n"<< std::endl; + + Poco::CodeGeneration::Utility::writeNameSpaceBegin(out, pGen->nameSpace()); + + out << "\n" << std::endl; + out << "void " << pGen->_className << "::startImpl(Poco::OSP::BundleContext::Ptr pContext)" << std::endl; + out << "{" << std::endl; + out << "\t// Create your services here. You can add them via the various register" << std::endl; + out << "\t// functions. Services will be automatically unregistered in the stop function." << std::endl; + out << "\t// Changes made to this function are safe and will not be lost when regenerating." << std::endl; + out << "}" << std::endl << std::endl << std::endl; + + out << "void " << pGen->_className << "::stopImpl(Poco::OSP::BundleContext::Ptr pContext)" << std::endl; + out << "{" << std::endl; + out << "\t// Add custom shutdown code here. You do not need to unregister listeners, services or remote objects." << std::endl; + out << "\t// This will all happen automatically after returning from this method." << std::endl; + out << "\t// Changes made to this function are safe and will not be lost when regenerating." << std::endl; + out << "}" << std::endl << std::endl << std::endl; + + Poco::CodeGeneration::Utility::writeNameSpaceEnd(out, pGen->nameSpace()); + } +} + + +void BundleActivatorGenerator::orbCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("return *_pORB;"); +} + + +void BundleActivatorGenerator::setupRemotingOSPCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + BundleActivatorGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + + // in clientMode we register ProxyFactories + // in serverMode we register skeletons + + std::vector::const_iterator it = pGen->_services.begin(); + for (; it != pGen->_services.end(); ++it) + { + const Poco::CppParser::Struct* pStructIn = it->pStruct; + Poco::CodeGeneration::CodeGenerator::Properties props; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pStructIn, props); + if (it->clientCode) + { + // simply call ORB::instance().registerProxyFactory(className, new ProxyFactory()); + std::string codeLine("_pORB->registerProxyFactory(\""); + codeLine.append(pStructIn->name()); + codeLine.append("\", new "); + codeLine.append(ProxyFactoryGenerator::generateClassName(pStructIn)); + codeLine.append("());"); + gen.writeMethodImplementation(codeLine); + } + if (it->serverCode) + { + std::string codeLine("_pORB->registerSkeleton(\""); + codeLine.append(pStructIn->name()); + codeLine.append("\", new "); + codeLine.append(SkeletonGenerator::generateClassName(pStructIn)); + codeLine.append("());"); + gen.writeMethodImplementation(codeLine); + } + } +} + + +void BundleActivatorGenerator::shutdownRemotingOSPCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + BundleActivatorGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + + // we never unregister namespace + // in clientMode we unregister ProxyFactories + // in serverMode we unregister skeletons + + std::vector::const_iterator it = pGen->_services.begin(); + for (; it != pGen->_services.end(); ++it) + { + const Poco::CppParser::Struct* pStructIn = it->pStruct; + + if (it->clientCode) + { + // simply call ORB::instance().registerProxyFactory(className, new ProxyFactory()); + std::string codeLine("_pORB->unregisterProxyFactory(\""); + codeLine.append(pStructIn->name()); + codeLine.append("\");"); + gen.writeMethodImplementation(codeLine); + } + if (it->serverCode) + { + std::string codeLine("_pORB->unregisterSkeleton(\""); + codeLine.append(pStructIn->name()); + codeLine.append("\");"); + gen.writeMethodImplementation(codeLine); + } + } +} + + +bool BundleActivatorGenerator::requiresClientCode(const std::vector& services) +{ + bool req = false; + std::vector::const_iterator it = services.begin(); + for (; it != services.end() && !req; ++it) + { + req |= it->clientCode; + } + return req; +} + + +bool BundleActivatorGenerator::requiresServerCode(const std::vector& services) +{ + bool req = false; + std::vector::const_iterator it = services.begin(); + for (; it != services.end() && !req; ++it) + { + req |= it->serverCode; + } + return req; +} + + +BundleActivatorGenerator::BundleService::BundleService(const Poco::CppParser::Struct* pS, bool cc, bool sc): + pStruct(pS), + clientCode(cc), + serverCode(sc) +{ +} diff --git a/RemotingNG/RemoteGen/src/BundleActivatorGenerator.h b/RemotingNG/RemoteGen/src/BundleActivatorGenerator.h new file mode 100644 index 0000000000..4f39f83129 --- /dev/null +++ b/RemotingNG/RemoteGen/src/BundleActivatorGenerator.h @@ -0,0 +1,98 @@ +// +// BundleActivatorGenerator.h +// +// Definition of the BundleActivatorGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef RemoteGen_BundleActivatorGenerator_INCLUDED +#define RemoteGen_BundleActivatorGenerator_INCLUDED + + +#include "AbstractGenerator.h" +#include "Poco/CodeGeneration/CppGenerator.h" +#include +#include + + +class BundleActivatorGenerator: public AbstractGenerator + /// BundleActivatorGenerator generates a proxy for a given class definition. C++ specific. +{ +public: + struct BundleService + { + const Poco::CppParser::Struct* pStruct; + bool clientCode; + bool serverCode; + BundleService(const Poco::CppParser::Struct* pStruct, bool clientCode, bool serverCode); + }; + + BundleActivatorGenerator(Poco::CodeGeneration::CppGenerator& cppGen, std::ostream* pImplOut, const std::string& className, const std::vector& services); + /// Creates the BundleActivatorGenerator. + + ~BundleActivatorGenerator(); + /// Destroys the BundleActivatorGenerator. + + void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// Must not write the namespace + + void structEnd(); + /// generates the class + + void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Writes the method header. Properties contains the properties found in the functions docuementation and in the class documentation. + + void registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e); + + std::vector newBaseClasses(const Poco::CppParser::Struct* pStruct); + + std::string newClassName(const Poco::CppParser::Struct* pStruct); + +private: + static void constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void startCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void stopCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void registerRemoteServiceCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void unregisterRemoteServiceCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void registerRemoteObjectCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void unregisterRemoteObjectCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void registerServiceCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void unregisterServiceCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void unregisterAllCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void createServicesCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void orbCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static void setupRemotingOSPCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void shutdownRemotingOSPCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static void registerListenerCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void unregisterListenerCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static bool requiresClientCode(const std::vector& services); + + static bool requiresServerCode(const std::vector& services); + +private: + std::ostream* _pImplOut; + bool _clientMode; + bool _serverMode; + std::string _className; + std::vector _services; +}; + + +// +// inlines +// +inline std::string BundleActivatorGenerator::newClassName(const Poco::CppParser::Struct* pStruct) +{ + throw Poco::NotImplementedException("Should never be called"); +} + + +#endif // RemoteGen_BundleActivatorGenerator_INCLUDED diff --git a/RemotingNG/RemoteGen/src/ClientHelperGenerator.cpp b/RemotingNG/RemoteGen/src/ClientHelperGenerator.cpp new file mode 100644 index 0000000000..ac2be86781 --- /dev/null +++ b/RemotingNG/RemoteGen/src/ClientHelperGenerator.cpp @@ -0,0 +1,230 @@ +// +// ClientHelperGenerator.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "ClientHelperGenerator.h" +#include "ProxyFactoryGenerator.h" +#include "RemoteObjectGenerator.h" +#include "InterfaceGenerator.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/Exception.h" +#include "Poco/Path.h" +#include "Poco/NumberFormatter.h" +#include "Poco/String.h" +#include + + +using Poco::CodeGeneration::Utility; + + +ClientHelperGenerator::ClientHelperGenerator(Poco::CodeGeneration::CppGenerator& cppGen): AbstractGenerator(cppGen) +{ +} + + +ClientHelperGenerator::~ClientHelperGenerator() +{ +} + + +std::string ClientHelperGenerator::generateClassName(const Poco::CppParser::Struct* pStruct) +{ + poco_assert_dbg (pStruct); + std::string newClassName(pStruct->name()); + newClassName.append("ClientHelper"); + return newClassName; +} + + +std::string ClientHelperGenerator::generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct) +{ + if (ns.empty()) + return ClientHelperGenerator::generateClassName(pStruct); + + return ns + "::" + ClientHelperGenerator::generateClassName(pStruct); +} + + +void ClientHelperGenerator::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + AbstractGenerator::structStart(pStruct, properties); + // add constructor/destructor + Poco::CppParser::Function* pConstr = new Poco::CppParser::Function(_pStruct->name(), _pStruct); + pConstr->setAccess(Poco::CppParser::Symbol::ACC_PUBLIC); + pConstr->addDocumentation( " Creates a " + _pStruct->name() + "."); + + Poco::CppParser::Function* pDestr = new Poco::CppParser::Function(std::string("~")+_pStruct->name(), _pStruct); + pDestr->setAccess(Poco::CppParser::Symbol::ACC_PUBLIC); + pDestr->addDocumentation( " Destroys the " + _pStruct->name() + "."); + + // add a method TestProject::IMyClass::Ptr find(const std::string& uri) + std::string iName (InterfaceGenerator::generateClassName(pStruct)); + Poco::CppParser::Function* pFind = new Poco::CppParser::Function("static " + iName + "::Ptr find", _pStruct); + pFind->makeInline(); + pFind->addDocumentation(" Return an interface for the service object identified by the given URI."); + pFind->addDocumentation(""); + pFind->addDocumentation(" Depending on whether the service object has been registered on the same ORB, or not,"); + pFind->addDocumentation(" the ORB will either return a RemoteObject (with forwards calls locally, without the"); + pFind->addDocumentation(" need for serialization/deserialization), or a Proxy."); + pFind->addDocumentation(""); + pFind->addDocumentation(" The URI must have the following format: ://///"); + Poco::CppParser::Parameter* pParam1= new Poco::CppParser::Parameter("const std::string& uri", 0); + pFind->addParameter(pParam1); + + pFind = new Poco::CppParser::Function(iName + "::Ptr findImpl", _pStruct); + pFind->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + pParam1= new Poco::CppParser::Parameter("const std::string& uri", 0); + pFind->addParameter(pParam1); + + pFind = new Poco::CppParser::Function("static " + iName + "::Ptr find", _pStruct); + pFind->makeInline(); + pFind->addDocumentation(" Return a Proxy for the service object identified by the given URI."); + pFind->addDocumentation(""); + pFind->addDocumentation(" The given protocol name is used to determine the Transport used by"); + pFind->addDocumentation(" the Proxy. This is used for objects identified by URIs that do not"); + pFind->addDocumentation(" follow the standard Remoting URI structure."); + pParam1= new Poco::CppParser::Parameter("const std::string& uri", 0); + Poco::CppParser::Parameter* pParam2= new Poco::CppParser::Parameter("const std::string& protocol", 0); + pFind->addParameter(pParam1); + pFind->addParameter(pParam2); + + pFind = new Poco::CppParser::Function(iName + "::Ptr findImpl", _pStruct); + pFind->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + pParam1= new Poco::CppParser::Parameter("const std::string& uri", 0); + pParam2= new Poco::CppParser::Parameter("const std::string& protocol", 0); + pFind->addParameter(pParam1); + pFind->addParameter(pParam2); + + _cppGen.addIncludeFile("Poco/RemotingNG/Identifiable.h"); + _cppGen.addIncludeFile("Poco/RemotingNG/ORB.h"); + Poco::CppParser::Variable* pVar = new Poco::CppParser::Variable("Poco::RemotingNG::ORB* _pORB", _pStruct); + pVar->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + + // the src file will need most includes: for generated RemoteObject+ ProxyFactory, + "Net/DNS.h" + std::string proxyFactName = ProxyFactoryGenerator::generateQualifiedClassName(nameSpace(), pStruct); + std::string iFullName (InterfaceGenerator::generateQualifiedClassName(nameSpace(), pStruct)); + Poco::CppParser::NameSpace* pRoot = Poco::CppParser::NameSpace::root(); + const Poco::CppParser::Struct* pPF = dynamic_cast (pRoot->lookup(proxyFactName)); + const Poco::CppParser::Struct* pI = dynamic_cast (pRoot->lookup(iFullName)); + poco_check_ptr (pPF); + poco_check_ptr (pI); + + Poco::CodeGeneration::Utility::handleInclude(pI, _cppGen); + Poco::CodeGeneration::Utility::handleSrcInclude(pPF, _cppGen); + _cppGen.addSrcIncludeFile("Poco/SingletonHolder.h"); + + // add a method static ClassNameHelper& instance(); + Poco::CppParser::Function* pInstance = new Poco::CppParser::Function("static "+_pStruct->name()+"& instance", _pStruct); + pInstance->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); +} + + + +void ClientHelperGenerator::methodStart(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& properties) +{ +} + + +void ClientHelperGenerator::registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e) +{ + //we don't want any code for constructor and destructor + e.registerCallback(_pStruct->name(), &ClientHelperGenerator::constructorCodeGen); + e.registerCallback("~"+_pStruct->name(), &Poco::CodeGeneration::GeneratorEngine::emptyCodeGen); + e.registerCallback("instance", &ClientHelperGenerator::instanceCodeGen); + e.registerCallback("findImpl", &ClientHelperGenerator::findImplCodeGen); + e.registerCallback("find", &ClientHelperGenerator::findCodeGen); + e.registerPreClassCallback(&ClientHelperGenerator::singletonHolder); +} + + +std::vector ClientHelperGenerator::newBaseClasses(const Poco::CppParser::Struct* pStruct) +{ + // no base classes for this one + std::vector bases; + + return bases; +} + + +void ClientHelperGenerator::singletonHolder(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + std::string code("namespace\n"); + code.append("{\n"); + code.append("\tPoco::SingletonHolder<"); + code.append(pStruct->name()); + code.append("> sh"); + code.append(pStruct->name()); + code.append(";\n"); + code.append("}\n\n"); + gen.writeImplementation(code); +} + + +void ClientHelperGenerator::constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + ClientHelperGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + const Poco::CppParser::Struct* pStructIn = pGen->_pStructIn; + // register namespace (if necessary) + Poco::CodeGeneration::CodeGenerator::Properties props; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pStructIn, props); + std::string ns; + Poco::CodeGeneration::GeneratorEngine::getStringProperty(props, Poco::CodeGeneration::Utility::NAMESPACE, ns); + + gen.writeMethodImplementation("_pORB = &Poco::RemotingNG::ORB::instance();"); + // simply call ORB::instance().registerProxyFactory(className, new ProxyFactory); + std::string codeLine("_pORB->registerProxyFactory(\""); + codeLine.append(Poco::replace(pStructIn->fullName(), "::", ".")); + codeLine.append("\", new "); + codeLine.append(ProxyFactoryGenerator::generateClassName(pStructIn)); + codeLine.append(");"); + gen.writeMethodImplementation(codeLine); +} + + +void ClientHelperGenerator::instanceCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("return *sh" + pStruct->name() + ".get();"); +} + + +void ClientHelperGenerator::findCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + if (pFunc->countParameters() == 1) + gen.writeMethodImplementation("return " + pStruct->name() + "::instance().findImpl(uri);"); + else + gen.writeMethodImplementation("return " + pStruct->name() + "::instance().findImpl(uri, protocol);"); +} + + +void ClientHelperGenerator::findImplCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + ClientHelperGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + const Poco::CppParser::Struct* pStructIn = pGen->_pStructIn; + std::string iName (InterfaceGenerator::generateClassName(pStructIn)); + if (pFunc->countParameters() == 1) + gen.writeMethodImplementation("Poco::RemotingNG::Identifiable::Ptr pInterface = _pORB->findObject(uri);"); + else + { + std::string codeLine("Poco::RemotingNG::Identifiable::Ptr pInterface = _pORB->findObject(uri, "); + codeLine.append(iName); + codeLine.append("::remoting__typeId(), "); + codeLine.append("protocol);"); + gen.writeMethodImplementation(codeLine); + } + gen.writeMethodImplementation("return pInterface.cast<" + iName + ">();"); +} diff --git a/RemotingNG/RemoteGen/src/ClientHelperGenerator.h b/RemotingNG/RemoteGen/src/ClientHelperGenerator.h new file mode 100644 index 0000000000..f8e3a5a67b --- /dev/null +++ b/RemotingNG/RemoteGen/src/ClientHelperGenerator.h @@ -0,0 +1,69 @@ +// +// ClientHelperGenerator.h +// +// Definition of the ClientHelperGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef RemoteGen_ClientHelperGenerator_INCLUDED +#define RemoteGen_ClientHelperGenerator_INCLUDED + + +#include "AbstractGenerator.h" +#include "Poco/CodeGeneration/CppGenerator.h" + + +class ClientHelperGenerator: public AbstractGenerator + /// ClientHelperGenerator generates a proxy for a given class definition. C++ specific. +{ +public: + + ClientHelperGenerator(Poco::CodeGeneration::CppGenerator& cppGen); + /// Creates the ClientHelperGenerator. + + ~ClientHelperGenerator(); + /// Destroys the ClientHelperGenerator. + + static std::string generateClassName(const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + static std::string generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// Must not write the namespace + + void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Writes the method header. Properties contains the properties found in the functions docuementation and in the class documentation. + + void registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e); + + std::string newClassName(const Poco::CppParser::Struct* pStruct); + /// generates the new class name based on the old one + + std::vector newBaseClasses(const Poco::CppParser::Struct* pStruct); + +private: + static void constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void instanceCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void findCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void findImplCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void singletonHolder(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); +}; + + +// +// inlines +// +inline std::string ClientHelperGenerator::newClassName(const Poco::CppParser::Struct* pStruct) +{ + return ClientHelperGenerator::generateClassName(pStruct); +} + + +#endif // RemoteGen_ClientHelperGenerator_INCLUDED diff --git a/RemotingNG/RemoteGen/src/DeserializerGenerator.cpp b/RemotingNG/RemoteGen/src/DeserializerGenerator.cpp new file mode 100644 index 0000000000..c12d2da47d --- /dev/null +++ b/RemotingNG/RemoteGen/src/DeserializerGenerator.cpp @@ -0,0 +1,837 @@ +// +// DeserializerGenerator.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "DeserializerGenerator.h" +#include "SerializerGenerator.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/CppGenerator.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Struct.h" +#include "Poco/CppParser/Parameter.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CppParser/Variable.h" +#include "Poco/CppParser/Enum.h" +#include "Poco/NumberFormatter.h" +#include "Poco/NullStream.h" +#include "Poco/Exception.h" +#include "Poco/String.h" +#include "Poco/Format.h" +#include "Poco/Path.h" +#include "Poco/Util/Application.h" +#include "Poco/Util/LayeredConfiguration.h" +#include + + +using namespace Poco::CodeGeneration; + + +DeserializerGenerator::DeserializerGenerator(Poco::CodeGeneration::CppGenerator& cppGen): AbstractGenerator(cppGen) +{ +} + + +DeserializerGenerator::~DeserializerGenerator() +{ +} + + +std::string DeserializerGenerator::generateClassName(const Poco::CppParser::Struct* pStruct) +{ + poco_assert_dbg (pStruct); + std::string newClassName(pStruct->name()); + Poco::CppParser::NameSpace* pNS = pStruct->nameSpace(); + while (pNS) + { + Poco::CppParser::Struct* pOuter = dynamic_cast(pNS); + if (pOuter) + { + newClassName = pOuter->name() + newClassName; + pNS = pOuter->nameSpace(); + } + else + pNS = 0; + } + + newClassName.append("Deserializer"); + return newClassName; +} + + +std::string DeserializerGenerator::generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct) +{ + if (ns.empty()) + return DeserializerGenerator::generateClassName(pStruct); + return ns + "::" + DeserializerGenerator::generateClassName(pStruct); +} + + +void DeserializerGenerator::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + _pStructIn = pStruct; + std::string newClassName (DeserializerGenerator::generateClassName(pStruct)); + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + for (; itB != itBEnd; ++itB) + { + if (!itB->pClass) + { + if (GenUtility::mustBeSerializable(itB->name)) + { + throw CodeGenerationException("Cannot create deserializer for class/struct which has a non serializable base", itB->name); + } + } + } + + // we create the following class: template <> TypeSerializer + std::string decl("template <>\nclass TypeDeserializer<"); + decl.append(pStruct->fullName()); + decl.append(">"); + + _pStruct = new Poco::CppParser::Struct(decl, true, _pNs); + + Poco::CppParser::Function* pFuncRef = new Poco::CppParser::Function("static bool deserialize", _pStruct); + addParameters(pFuncRef, pStruct->fullName()); + Poco::CppParser::Function* pFuncRef2 = new Poco::CppParser::Function("static void deserializeImpl", _pStruct); + addImplParameters(pFuncRef2, pStruct->fullName()); + + // if we have attributes, we must add two additional methods + if (hasAttributes(pStruct)) + { + // static void serializeAttributes(const Element& elem, const T& value, Serializer& ser) + // static void prepareSerializeAttributes(const Element& elem, const T& value, Serializer& ser) + Poco::CppParser::Function* pFuncRef3 = new Poco::CppParser::Function("static void deserializeAttributes", _pStruct); + addImplParameters(pFuncRef3, pStruct->fullName()); + Poco::CppParser::Function* pFuncRef4 = new Poco::CppParser::Function("static void prepareDeserializeAttributes", _pStruct); + pFuncRef4->addParameter(new Poco::CppParser::Parameter("Deserializer& deser", 0)); + } + + // we must include TypeSerializer, and the file of the struct we serialize + _cppGen.addIncludeFile("Poco/RemotingNG/TypeDeserializer.h"); + Poco::CodeGeneration::Utility::handleInclude(pStruct, _cppGen); + + Poco::Path aPath(pStruct->getFile()); + Poco::Util::LayeredConfiguration& cfg = Poco::Util::Application::instance().config(); + std::string incFile = includePath(cfg, pStruct->nameSpace()->fullName()); + if (!incFile.empty()) + { + aPath = Poco::Path(incFile); + aPath.makeDirectory(); + } + setDocumentation(pStruct, _pStruct); + aPath.setFileName(newClassName+".h"); + _pStruct->setFile(aPath.toString()); + _pStruct->setPackage("Generated"); + + // now include typeserializers for variables (public) + Poco::CppParser::NameSpace::SymbolTable tbl; + pStruct->variables(tbl); + Poco::CppParser::NameSpace::SymbolTable::const_iterator it = tbl.begin(); + Poco::CppParser::NameSpace::SymbolTable::const_iterator itEnd = tbl.end(); + for (; it != itEnd; ++it) + { + Poco::CppParser::Variable* pVar = static_cast(it->second); + // just a precaution: only include serializers for public types + if (pVar->getAccess() == Poco::CppParser::Variable::ACC_PUBLIC) + { + std::string varType = Utility::resolveType(pVar->nameSpace(), pVar->declType()); + Poco::CppParser::Symbol* pS = pVar->nameSpace()->lookup(varType); + if (pS) + { + if (pS->kind() != Poco::CppParser::Symbol::SYM_ENUM) + handleIncludeTypeSerializers(pVar, true, false); + } + else handleIncludeTypeSerializers(pVar, true, false); + } + } + + SerializerGenerator::VarGet matches; + matchVarsWithFunctionsRecursive(pStruct, matches); + for (SerializerGenerator::VarGet::iterator it = matches.begin(); it != matches.end(); ++it) + { + handleIncludeTypeSerializers(it->second.first, true, false); + } +} + + +std::vector DeserializerGenerator::newBaseClasses(const Poco::CppParser::Struct* pStruct) +{ + // we extend from Skeleton or from a superclass skeleton + std::vector bases; + return bases; +} + + +void DeserializerGenerator::registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e) +{ + //we don't want any code for constructor and destructor + e.registerCallback(_pStruct->name(), &Poco::CodeGeneration::GeneratorEngine::emptyCodeGen); + e.registerCallback("~"+_pStruct->name(), &Poco::CodeGeneration::GeneratorEngine::emptyCodeGen); + e.registerCallback("deserialize", &DeserializerGenerator::deserializeCodeGen); + e.registerCallback("deserializeImpl", &DeserializerGenerator::deserializeImplCodeGen); + e.registerCallback("deserializeAttributes", &DeserializerGenerator::deserializeAttributesCodeGen); + e.registerCallback("prepareDeserializeAttributes", &DeserializerGenerator::prepareDeserializeAttributesCodeGen); +} + + +void DeserializerGenerator::methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties) +{ +} + + +void DeserializerGenerator::addParameters(Poco::CppParser::Function* pFunc, const std::string& typeName) +{ + //deserialize(const std::string& name, bool isMandatory, Deserializer& deser, T& value) + pFunc->addParameter(new Poco::CppParser::Parameter("const std::string& name", 0)); + pFunc->addParameter(new Poco::CppParser::Parameter("bool isMandatory", 0)); + pFunc->addParameter(new Poco::CppParser::Parameter("Deserializer& deser", 0)); + std::string type(typeName); + type.append("&"); + type.append(" value"); + pFunc->addParameter(new Poco::CppParser::Parameter(type, 0)); +} + + +void DeserializerGenerator::addImplParameters(Poco::CppParser::Function* pFunc, const std::string& typeName) +{ + //deserialize(const std::string& name, bool isMandatory, Deserializer& deser, T& value) + pFunc->addParameter(new Poco::CppParser::Parameter("Deserializer& deser", 0)); + std::string type(typeName); + type.append("&"); + type.append(" value"); + pFunc->addParameter(new Poco::CppParser::Parameter(type, 0)); +} + + +void DeserializerGenerator::deserializeCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + if (addParam == 0) + return; + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + DeserializerGenerator* pDeser = dynamic_cast(pAGen); + if (pDeser == 0) + return; + + const Poco::CppParser::Struct* pDataType = pDeser->_pStructIn; // returns the data type for which pStruct was generated + poco_assert(pDataType); + + gen.writeMethodImplementation("using namespace std::string_literals;\n"); + + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pDataType, structProps); + std::string defaultNS; + bool hasDefaultNS = GeneratorEngine::getStringProperty(structProps, Utility::NAMESPACE, defaultNS); + if (hasDefaultNS && !defaultNS.empty()) + { + std::string code("static const std::string REMOTING__NAMESPACE(\""); + code.append(defaultNS); + code.append("\"s);"); + gen.writeMethodImplementation(code); + } + + bool hasAttr = hasAttributes(pDataType); + if (hasAttr) + gen.writeMethodImplementation("prepareDeserializeAttributes(deser);"); + gen.writeMethodImplementation("bool ret = deser.deserializeStructBegin(name, isMandatory);"); + if (hasDefaultNS && !defaultNS.empty()) + { + gen.writeMethodImplementation("deser.pushProperty(SerializerBase::PROP_NAMESPACE, REMOTING__NAMESPACE);"); + } + gen.writeMethodImplementation("if (ret)"); + gen.writeMethodImplementation("{"); + if (hasAttr) + gen.writeMethodImplementation("\tdeserializeAttributes(deser, value);"); + gen.writeMethodImplementation("\tdeserializeImpl(deser, value);"); + if (hasDefaultNS && !defaultNS.empty()) + gen.writeMethodImplementation("\tdeser.popProperty(SerializerBase::PROP_NAMESPACE);"); + gen.writeMethodImplementation("\tdeser.deserializeStructEnd(name);"); + gen.writeMethodImplementation("}"); + if (hasDefaultNS && !defaultNS.empty()) + gen.writeMethodImplementation("else deser.popProperty(SerializerBase::PROP_NAMESPACE);"); + gen.writeMethodImplementation("return ret;"); +} + + +void DeserializerGenerator::deserializeImplCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + if (addParam == 0) + return; + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + DeserializerGenerator* pSer = dynamic_cast(pAGen); + if (pSer == 0) + return; + + const Poco::CppParser::Struct* pDataType = pSer->_pStructIn; // returns the data type for which pStruct was generated + poco_assert(pDataType); + + // now seach for each variable a matching function + // if we don't find one assume that this is deliberate and the user doesn't want to send that member + + gen.writeMethodImplementation("using namespace std::string_literals;\n"); + + pSer->handleSuperClassCalls(pDataType, &DeserializerGenerator::deserializeImplCodeGenImpl, false, gen); + pSer->deserializeImplCodeGenImpl(pDataType, gen, ""); +} + + +void DeserializerGenerator::deserializeImplCodeGenImpl(const Poco::CppParser::Struct* pDataType, CodeGenerator& gen, const std::string& suffix) +{ + SerializerGenerator::VarGet matches; + matchVarsWithFunctions(pDataType, matches); + + // now split up in two multimaps: one containing attrs only, the other containing elems only + SerializerGenerator::OrderedVars attrs; + SerializerGenerator::OrderedVars elems; + SerializerGenerator::doElemAttrSplit(matches, attrs, elems); + std::vector elemCodeLines; + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pDataType, structProps); + // the deserializer doesn't care about namespaces! + + // the first line contains a static string array containing names + if (!elems.empty()) + { + std::string staticVarNames(Poco::format("static const std::string REMOTING__NAMES%s[] = {", suffix)); + int curNamesPos = 0; + int retUsage(0); + + SerializerGenerator::OrderedVars::const_iterator itElem = elems.begin(); + SerializerGenerator::OrderedVars::const_iterator itElemEnd = elems.end(); + for (; itElem != itElemEnd; ++itElem, ++curNamesPos) + { + SerializerGenerator::appendStaticVarName(SerializerGenerator::getVariableName(itElem->second), staticVarNames); + SerializerGenerator::VarGet::const_iterator it = itElem->second; + generateTypeDeserializerLines(pDataType, it, curNamesPos, suffix, elemCodeLines, retUsage); + } + + poco_assert_dbg (staticVarNames[staticVarNames.size() -1] == ','); + staticVarNames[staticVarNames.size() -1] = '}'; + staticVarNames.append(";"); + gen.writeMethodImplementation(staticVarNames); + // write elem code lines + if (!elemCodeLines.empty()) + { + if (retUsage > 0) + gen.writeMethodImplementation("bool ret = false;"); + SerializerGenerator::writeAll(elemCodeLines, gen); + } + } +} + + +void DeserializerGenerator::prepareDeserializeAttributesCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + if (addParam == 0) + return; + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + DeserializerGenerator* pSer = dynamic_cast(pAGen); + if (pSer == 0) + return; + + const Poco::CppParser::Struct* pDataType = pSer->_pStructIn; // returns the data type for which pStruct was generated + poco_assert(pDataType); + + // now seach for each variable a matching function + // if we don't find one assume that this is deliberate and the user doesn't want to send that member + + pSer->handleSuperClassCalls(pDataType, &DeserializerGenerator::prepareDeserializeAttributesCodeGenImpl, true, gen); + pSer->prepareDeserializeAttributesCodeGenImpl(pDataType, gen, ""); +} + + +void DeserializerGenerator::prepareDeserializeAttributesCodeGenImpl(const Poco::CppParser::Struct* pDataType, CodeGenerator& gen, const std::string& suffix) +{ + SerializerGenerator::VarGet matches; + matchVarsWithFunctions(pDataType, matches); + + // now split up in two multimaps: one containing attrs only, the other containing elems only + SerializerGenerator::OrderedVars attrs; + SerializerGenerator::OrderedVars elems; + SerializerGenerator::doElemAttrSplit(matches, attrs, elems); + + std::vector attrCodeLines; + std::vector namespaces; + std::map namespacesMap; // to avoid duplicate namespace entries, the int is the pos in namespace + + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pDataType, structProps); + std::string defaultNS; + GeneratorEngine::getStringProperty(structProps, Utility::NAMESPACE, defaultNS); + namespaces.push_back(defaultNS); + namespacesMap.insert(std::make_pair(defaultNS, static_cast(namespaces.size()) - 1)); + // the first line contains a static string array containing names + if (!attrs.empty()) + { + gen.writeMethodImplementation("using namespace std::string_literals;\n"); + std::string staticVarNames(Poco::format("static const std::string REMOTING__NAMES%s[] = {", suffix)); + // after the names will be all used namespaces + int firstNSPos = static_cast(attrs.size()); + int curNamesPos = 0; + SerializerGenerator::OrderedVars::const_iterator itAttr = attrs.begin(); + SerializerGenerator::OrderedVars::const_iterator itAttrEnd = attrs.end(); + for (; itAttr != itAttrEnd; ++itAttr, ++curNamesPos) + { + SerializerGenerator::appendStaticVarName(SerializerGenerator::getVariableName(itAttr->second), staticVarNames); + // for each attr we need a ser.pushAttribute(ns, name) followed by a serialize + // check if the attr has a namespace attribute + SerializerGenerator::VarGet::const_iterator it = itAttr->second; + CodeGenerator::Properties attrProps(structProps); + GeneratorEngine::parseProperties(it->second.first, attrProps); + std::string ns; + GeneratorEngine::getStringProperty(attrProps, Utility::NAMESPACE, ns); + std::pair::iterator, bool> in = namespacesMap.insert(std::make_pair(ns, static_cast (namespaces.size()))); + if (in.second) + namespaces.push_back(ns); + + bool mandatory = GenUtility::getIsMandatory(attrProps); + + //deser.pushAttribute(ns, name, bool) + std::string pushLine(Poco::format("deser.pushAttribute(REMOTING__NAMES%s[", suffix)); + int posNS = in.first->second + firstNSPos; + pushLine.append(Poco::NumberFormatter::format(posNS)); + pushLine.append(Poco::format("], REMOTING__NAMES%s[", suffix)); + pushLine.append(Poco::NumberFormatter::format(curNamesPos)); + pushLine.append("], "); + + if (mandatory) + pushLine.append("true"); + else + pushLine.append("false"); + + pushLine.append(");"); + + attrCodeLines.push_back(pushLine); + } + + // append the namespaces + std::vector::const_iterator itNS = namespaces.begin(); + std::vector::const_iterator itNSEnd = namespaces.end(); + for (; itNS != itNSEnd; ++itNS) + { + SerializerGenerator::appendStaticVarName(*itNS, staticVarNames); + } + poco_assert_dbg (staticVarNames[staticVarNames.size() -1] == ','); + staticVarNames[staticVarNames.size() -1] = '}'; + staticVarNames.append(";"); + gen.writeMethodImplementation(staticVarNames); + // write attr code lines + SerializerGenerator::writeAll(attrCodeLines, gen); + } +} + + +void DeserializerGenerator::deserializeAttributesCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + if (addParam == 0) + return; + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + DeserializerGenerator* pSer = dynamic_cast(pAGen); + if (pSer == 0) + return; + + const Poco::CppParser::Struct* pDataType = pSer->_pStructIn; // returns the data type for which pStruct was generated + poco_assert(pDataType); + + // now seach for each variable a matching function + // if we don't find one assume that this is deliberate and the user doesn't want to send that member + + pSer->handleSuperClassCalls(pDataType, &DeserializerGenerator::deserializeAttributesCodeGenImpl, true, gen); + pSer->deserializeAttributesCodeGenImpl(pDataType, gen, ""); +} + + +void DeserializerGenerator::deserializeAttributesCodeGenImpl(const Poco::CppParser::Struct* pDataType, CodeGenerator& gen, const std::string& suffix) +{ + SerializerGenerator::VarGet matches; + matchVarsWithFunctions(pDataType, matches); + + // now split up in two multimaps: one containing attrs only, the other containing elems only + SerializerGenerator::OrderedVars attrs; + SerializerGenerator::OrderedVars elems; + SerializerGenerator::doElemAttrSplit(matches, attrs, elems); + + std::vector attrCodeLines; + + // the first line contains a static string array containing names + if (!attrs.empty()) + { + gen.writeMethodImplementation("using namespace std::string_literals;\n"); + std::string staticVarNames(Poco::format("static const std::string REMOTING__NAMES%s[] = {", suffix)); + int curNamesPos = 0; + int retUsage(0); + SerializerGenerator::OrderedVars::const_iterator itAttr = attrs.begin(); + SerializerGenerator::OrderedVars::const_iterator itAttrEnd = attrs.end(); + for (; itAttr != itAttrEnd; ++itAttr, ++curNamesPos) + { + SerializerGenerator::appendStaticVarName(SerializerGenerator::getVariableName(itAttr->second), staticVarNames); + // for each attr we need a ser.pushAttribute(ns, name) followed by a serialize + // check if the attr has a namespace attribute + SerializerGenerator::VarGet::const_iterator it = itAttr->second; + generateTypeDeserializerLines(pDataType, it, curNamesPos, suffix, attrCodeLines, retUsage); + } + + poco_assert_dbg (staticVarNames[staticVarNames.size() -1] == ','); + staticVarNames[staticVarNames.size() -1] = '}'; + staticVarNames.append(";"); + gen.writeMethodImplementation(staticVarNames); + if (retUsage > 0) + gen.writeMethodImplementation("bool ret = false;"); + // write attr code lines + SerializerGenerator::writeAll(attrCodeLines, gen); + } +} + + +void DeserializerGenerator::setDocumentation(const Poco::CppParser::Symbol* pSymOld,Poco::CppParser::Symbol* pNew) +{ +} + + +void DeserializerGenerator::handleSuperClassCalls(const Poco::CppParser::Struct* pClass, void (DeserializerGenerator::*generate)(const Poco::CppParser::Struct*, CodeGenerator&, const std::string&), bool dependsOnAttributes, CodeGenerator& gen) +{ + // add superclass calls + Poco::CppParser::Struct::BaseIterator itB = pClass->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pClass->baseEnd(); + for (; itB != itBEnd; ++itB) + { + if (!itB->pClass) + { + if (GenUtility::mustBeSerializable(itB->name)) + { + std::string msg("While handling " + pClass->fullName() + ": "); + msg.append("Missing base class " + itB->name + ". Please add the header file defining the class to the code generator configuration and make sure the class is serializable."); + throw CodeGenerationException(msg); + } + } + else + { + // only call the parent if it has attributes + if (hasAttributes(itB->pClass) || !dependsOnAttributes) + { + handleSuperClassCalls(itB->pClass, generate, dependsOnAttributes, gen); + + std::string suffix = "__"; + suffix += Poco::replace(Poco::toUpper(itB->pClass->fullName()), ":", "_"); + gen.writeMethodImplementation("// " + itB->pClass->fullName()); + gen.writeMethodImplementation("{"); + (this->*generate)(itB->pClass, gen, suffix); + gen.writeMethodImplementation("}"); + gen.writeMethodImplementation(""); + } + } + } +} + + +void DeserializerGenerator::matchVarsWithFunctions(const Poco::CppParser::Struct* pDataType, SerializerGenerator::VarGet& matches) +{ + // the deserializer can only access public members + Poco::CppParser::Struct::Functions functs; + pDataType->methods(Poco::CppParser::Symbol::ACC_PUBLIC, functs); + Poco::CppParser::NameSpace::SymbolTable vars; + pDataType->variables(vars); + matchVarsWithFunctions(functs, vars, matches); +} + + +void DeserializerGenerator::matchVarsWithFunctions(const Poco::CppParser::Struct::Functions& functs, Poco::CppParser::NameSpace::SymbolTable& varsOrig, SerializerGenerator::VarGet& matches) +{ + Poco::CppParser::NameSpace::SymbolTable varsCopy(varsOrig); + std::map varsLower; + + Poco::CppParser::NameSpace::SymbolTable::iterator itO = varsOrig.begin(); + Poco::CppParser::NameSpace::SymbolTable::iterator itOEnd = varsOrig.end(); + + for (; itO != itOEnd; ++itO) + { + bool ok = (varsLower.insert(std::make_pair(Poco::toLower(itO->first), itO)).second); + if (!ok) + { + throw Poco::LogicException("Found two variables with the same name: " + itO->first); + } + // filter out public members! for those we don't need set and get + Poco::CppParser::Variable* pSO = dynamic_cast(itO->second); + if (pSO) + { + if (pSO->getAccess() == Poco::CppParser::Symbol::ACC_PUBLIC) + { + int flags = pSO->flags(); + if ((flags & Poco::CppParser::Variable::VAR_STATIC) == 0 + && (flags & Poco::CppParser::Variable::VAR_CONST) == 0) + { + //public: use directly, set 0 as funct pointer to indicate direct usage + Poco::CppParser::Function* pNullFct = 0; + matches.insert(std::make_pair(itO->first, std::make_pair(static_cast(itO->second), pNullFct))); + } + varsCopy.erase(itO->first); + varsLower.erase(Poco::toLower(itO->first)); + } + } + } + // search for each variable a matching function + // if we don't find one assume that this is deliberate and the user doesn't want to send that member + + + Poco::CppParser::Struct::Functions::const_iterator it = functs.begin(); + Poco::CppParser::Struct::Functions::const_iterator itEnd = functs.end(); + for (; it != itEnd; ++it) + { + std::string fctName = Poco::toLower((*it)->name()); + if ( !(*it)->isConst() && + (*it)->countParameters() == 1 && + (*it)->getReturnParameter() == Poco::CodeGeneration::Utility::TYPE_VOID) + { + std::set possibleNames; + + possibleNames.insert(fctName); + possibleNames.insert("_"+fctName); + possibleNames.insert("m_"+fctName); + possibleNames.insert(fctName+"_"); + + bool isSwap = false; + std::string varName("_"); + size_t pos = fctName.find("swap"); + if (pos == 0) + { + isSwap = true; + varName.append(fctName.substr(4)); + Poco::toLowerInPlace(varName); + possibleNames.insert(varName); + possibleNames.insert("m"+varName); + possibleNames.insert(varName.substr(1)); + possibleNames.insert(varName.substr(1)+"_"); + } + else + { + pos = fctName.find("set"); + if (pos == 0) + { + varName.append(fctName.substr(3)); + Poco::toLowerInPlace(varName); + possibleNames.insert(varName); + possibleNames.insert("m"+varName); + possibleNames.insert(varName.substr(1)); + possibleNames.insert(varName.substr(1)+"_"); + } + } + std::set::const_iterator itNames = possibleNames.begin(); + std::set::const_iterator itNamesEnd = possibleNames.end(); + bool found = false; + for (; itNames != itNamesEnd && !found; ++itNames) + { + const std::string& lowerName = *itNames; + std::map::iterator itVar = varsLower.find(lowerName); + if (itVar != varsLower.end()) + { + // now check if the argument type of the function matches the type of the variable! + Poco::CppParser::Variable* pFoundVar = static_cast(itVar->second->second); + Poco::CppParser::Function* pFoundFct = *it; + Poco::CppParser::Function::Iterator it = pFoundFct->begin(); + if (it != pFoundFct->end()) + { + Poco::CppParser::Parameter* param = *it; + ++it; + if (it == pFoundFct->end()) + { + std::string paramType = Poco::CodeGeneration::Utility::resolveType(pFoundFct->nameSpace(), param->declType()); + + std::string typeOfVar = Poco::CodeGeneration::Utility::resolveType(pFoundVar->nameSpace(), pFoundVar->declType()); + if (typeOfVar == paramType) + { + found = true; + SerializerGenerator::VarGet::iterator itM = matches.find(itVar->second->first); + if (itM != matches.end() && isSwap) + matches.erase(itM); + matches.insert(std::make_pair(itVar->second->first, std::make_pair(pFoundVar, pFoundFct))); + varsCopy.erase(itVar->second->first); + } + } + } + } + } + } + } + Poco::CppParser::NameSpace::SymbolTable::const_iterator itV = varsCopy.begin(); + Poco::CppParser::NameSpace::SymbolTable::const_iterator itVEnd = varsCopy.end(); + for (; itV != itVEnd; ++itV) + { + EError.notify(0, "Warning: Failed to find setter method for " + itV->second->nameSpace()->fullName() + ":" + itV->first); + } +} + + +void DeserializerGenerator::matchVarsWithFunctionsRecursive(const Poco::CppParser::Struct* pDataType, SerializerGenerator::VarGet& matches) +{ + matchVarsWithFunctions(pDataType, matches); + for (Poco::CppParser::Struct::BaseIterator it = pDataType->baseBegin(); it != pDataType->baseEnd(); ++it) + { + matchVarsWithFunctionsRecursive(it->pClass, matches); + } +} + + +bool DeserializerGenerator::hasAttributes(const Poco::CppParser::Struct* pClass) +{ + bool ret = false; + Poco::CppParser::Struct::BaseIterator itB = pClass->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pClass->baseEnd(); + for (; itB != itBEnd; ++itB) + { + if (!itB->pClass) + { + if (GenUtility::mustBeSerializable(itB->name)) + { + std::string msg("While handling " + pClass->fullName() + ": "); + msg.append("Missing base class " + itB->name + ". Please add the header file defining the class to the code generator configuration and make sure the class is serializable."); + throw CodeGenerationException(msg); + } + } + else + { + ret |= hasAttributes(itB->pClass); + } + + } + if (!ret) + { + SerializerGenerator::VarGet matches; + matchVarsWithFunctions(pClass, matches); + SerializerGenerator::OrderedVars attrs; + SerializerGenerator::OrderedVars elems; + SerializerGenerator::doElemAttrSplit(matches, attrs, elems); + ret = !attrs.empty(); + } + return ret; +} + + +void DeserializerGenerator::generateTypeDeserializerLines(const Poco::CppParser::Struct* pDataType, SerializerGenerator::VarGet::const_iterator it, int namePos, const std::string& suffix, std::vector& lines, int& retUsageCount) +{ + bool isPublicMember = (it->second.second == 0); + const Poco::CppParser::Variable* pVar = it->second.first; + CodeGenerator::Properties varProps; + GeneratorEngine::parseProperties(pVar, varProps); + bool mandatory = GenUtility::getIsMandatory(varProps); + + std::string length; + bool haveLength = GeneratorEngine::getStringProperty(varProps, Utility::LENGTH, length); + if (haveLength) + { + lines.push_back("deser.pushProperty(SerializerBase::PROP_LENGTH, \"" + length + "\"s);"); + } + std::string xsdType; + bool haveXsdType = GeneratorEngine::getStringProperty(varProps, Utility::XSDTYPE, xsdType); + if (haveXsdType) + { + lines.push_back("deser.pushProperty(SerializerBase::PROP_XSDTYPE, \"" + xsdType + "\"s);"); + } + + std::string declType (Poco::CodeGeneration::Utility::resolveType(pDataType, pVar->declType())); + const std::string& origVarName = it->second.first->name(); + std::string varName("gen" + origVarName); + std::string code("ret = TypeDeserializer<"); + Poco::CppParser::Symbol* pSym = pDataType->lookup(declType); + bool enumMode = false; + std::string enumBaseType; + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_ENUM) + { + enumMode = true; + enumBaseType = static_cast(pSym)->baseType(); + if (enumBaseType.empty()) enumBaseType = "int"; + } + if (enumMode) + { + code = enumBaseType; + code += " "; + code.append(varName); + code.append(";"); + lines.push_back(code); + code = "ret = TypeDeserializer<"; + ++retUsageCount; + } + else if (isPublicMember) + { + code = "TypeDeserializer<"; + varName = "value"; + varName.append("."); + varName.append(pVar->name()); + } + else ++retUsageCount; // we use the ret variable + + if (enumMode) + code.append(enumBaseType); + else + code.append(declType); + if (pVar->isPointer()) + code.append("*"); + code.append(Poco::format(">::deserialize(REMOTING__NAMES%s[", suffix)); + code.append(Poco::NumberFormatter::format(namePos)); + code.append("], "); + + if (mandatory) + code.append("true"); + else + code.append("false"); + + code.append(", deser, "); + code.append(varName); + code.append(");"); + if (pVar->isPointer()) + { + throw CodeGenerationException("Pointer types are not supported", pDataType->name()); + } + else + { + if (isPublicMember) + { + // no decl + lines.push_back(code); + if (enumMode) + { + code = "if (ret) value"; + code.append("."); + code.append(pVar->name()); + code.append(" = static_cast<"); + code.append(declType); + code.append(">("); + code.append(varName); + code.append(");"); + lines.push_back(code); + } + // no need to check retCode + // no need to assign + } + else if (enumMode) + { + lines.push_back(code); + lines.push_back("if (ret) value." + it->second.second->name() + "(" + + "static_cast<" + declType + ">(" + varName + "));"); + } + else + { + lines.push_back(declType + " " + varName + ";"); + lines.push_back(code); + lines.push_back("if (ret) value." + it->second.second->name() + "(" + varName + ");"); + } + } + + if (haveLength) + { + lines.push_back("deser.popProperty(SerializerBase::PROP_LENGTH);"); + } + if (haveXsdType) + { + lines.push_back("deser.popProperty(SerializerBase::PROP_XSDTYPE);"); + } +} diff --git a/RemotingNG/RemoteGen/src/DeserializerGenerator.h b/RemotingNG/RemoteGen/src/DeserializerGenerator.h new file mode 100644 index 0000000000..ef4ea6dcdc --- /dev/null +++ b/RemotingNG/RemoteGen/src/DeserializerGenerator.h @@ -0,0 +1,98 @@ +// +// DeserializerGenerator.h +// +// Definition of the DeserializerGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef CodeGeneration_DeserializerGenerator_INCLUDED +#define CodeGeneration_DeserializerGenerator_INCLUDED + + +#include "AbstractGenerator.h" +#include "SerializerGenerator.h" +#include +#include + + +class DeserializerGenerator: public AbstractGenerator + /// A DeserializerGenerator only cares about member variables and generates a serializer class for them +{ +public: + DeserializerGenerator(Poco::CodeGeneration::CppGenerator& cppGen); + /// Creates the DeserializerGenerator. + + ~DeserializerGenerator(); + /// Destroys the DeserializerGenerator. + + static std::string generateClassName(const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + static std::string generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// Must not write the namespace + + void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Writes the method header. Properties contains the properties found in the functions docuementation and in the class documentation. + + void registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e); + + std::string newClassName(const Poco::CppParser::Struct* pStruct); + /// generates the new class name based on the old one + + std::vector newBaseClasses(const Poco::CppParser::Struct* pStruct); + +private: + void addParameters(Poco::CppParser::Function* pFunc, const std::string& className); + + void addImplParameters(Poco::CppParser::Function* pFunc, const std::string& className); + + static void deserializeCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + /// Code generator for deserializers + + static void deserializeImplCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + void deserializeImplCodeGenImpl(const Poco::CppParser::Struct* pDataType, CodeGenerator& gen, const std::string& suffix); + + static void prepareDeserializeAttributesCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + void prepareDeserializeAttributesCodeGenImpl(const Poco::CppParser::Struct* pDataType, CodeGenerator& gen, const std::string& suffix); + + static void deserializeAttributesCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + void deserializeAttributesCodeGenImpl(const Poco::CppParser::Struct* pDataType, CodeGenerator& gen, const std::string& suffix); + + void setDocumentation(const Poco::CppParser::Symbol* pSymOld,Poco::CppParser::Symbol* pNew); + + void handleSuperClassCalls(const Poco::CppParser::Struct* pClass, void (DeserializerGenerator::*generate)(const Poco::CppParser::Struct*, CodeGenerator&, const std::string&), bool dependsOnAttributes, CodeGenerator& gen); + + static void matchVarsWithFunctions(const Poco::CppParser::Struct* pDataType, SerializerGenerator::VarGet& matches); + + static void matchVarsWithFunctions(const Poco::CppParser::Struct::Functions& functs, Poco::CppParser::NameSpace::SymbolTable& vars, SerializerGenerator::VarGet& matches); + + static void matchVarsWithFunctionsRecursive(const Poco::CppParser::Struct* pDataType, SerializerGenerator::VarGet& matches); + + static bool hasAttributes(const Poco::CppParser::Struct* pClass); + /// Returns true if the class or any parent has attributes! + + static void generateTypeDeserializerLines(const Poco::CppParser::Struct* pContext, SerializerGenerator::VarGet::const_iterator it, int namePos, const std::string& suffix, std::vector& lines, int& retUsageCount); +}; + + +// +// inlines +// +inline std::string DeserializerGenerator::newClassName(const Poco::CppParser::Struct* pStruct) +{ + return DeserializerGenerator::generateClassName(pStruct); +} + + +#endif // CodeGeneration_DeserializerGenerator_INCLUDED diff --git a/RemotingNG/RemoteGen/src/EventDispatcherGenerator.cpp b/RemotingNG/RemoteGen/src/EventDispatcherGenerator.cpp new file mode 100644 index 0000000000..aa0cc9d6d4 --- /dev/null +++ b/RemotingNG/RemoteGen/src/EventDispatcherGenerator.cpp @@ -0,0 +1,1095 @@ +// +// EventDispatcherGenerator.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "EventDispatcherGenerator.h" +#include "RemoteObjectGenerator.h" +#include "RemoteBridgeGenerator.h" +#include "InterfaceGenerator.h" +#include "SerializerGenerator.h" +#include "GenUtility.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CppParser/Enum.h" +#include "Poco/Exception.h" +#include "Poco/Path.h" +#include "Poco/NumberFormatter.h" +#include "Poco/StringTokenizer.h" +#include "Poco/String.h" +#include "Poco/Timespan.h" +#include "Poco/Format.h" +#include "Poco/RemotingNG/SerializerBase.h" + + +using namespace Poco::CodeGeneration; + + +EventDispatcherGenerator::EventDispatcherGenerator(Poco::CodeGeneration::CppGenerator& cppGen): AbstractGenerator(cppGen) +{ +} + + +EventDispatcherGenerator::~EventDispatcherGenerator() +{ +} + + +std::string EventDispatcherGenerator::generateClassName(const Poco::CppParser::Struct* pStruct) +{ + poco_assert_dbg (pStruct); + std::string newClassName(pStruct->name()); + newClassName.append("EventDispatcher"); + return newClassName; +} + + +std::string EventDispatcherGenerator::generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct) +{ + if (ns.empty()) + return EventDispatcherGenerator::generateClassName(pStruct); + + return ns + "::" + EventDispatcherGenerator::generateClassName(pStruct); +} + + +std::string EventDispatcherGenerator::generateOutParamName(const Poco::CppParser::Parameter* pParam, const std::string& functionName) +{ + std::string result("_"); + result.append(functionName); + result.append(pParam->name()); + result.append("Out"); + return result; +} + + +std::string EventDispatcherGenerator::generateRetParamName(const Poco::CppParser::Function* pFunc) +{ + if (pFunc->getReturnParameter() == Utility::TYPE_VOID || pFunc->getReturnParameter().empty()) + return std::string(); + + std::string result("_"); + result.append(pFunc->name()); + result.append("Ret"); + return result; +} + + +void EventDispatcherGenerator::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + AbstractGenerator::structStart(pStruct, properties); + + // add constructor/destructor + Poco::CppParser::Function* pConstr = new Poco::CppParser::Function(_pStruct->name(), _pStruct); + //takes asinput the concrete RemoteObject pointer where we will register for the event + + Poco::CppParser::Parameter* pParam1 = new Poco::CppParser::Parameter(InterfaceGenerator::generateClassName(pStruct) + "* pInterface", pConstr); + pConstr->addParameter(pParam1); + Poco::CppParser::Parameter* pParam2 = new Poco::CppParser::Parameter("const Poco::RemotingNG::Identifiable::ObjectId& objectId", pConstr); + pConstr->addParameter(pParam2); + Poco::CppParser::Parameter* pParam3 = new Poco::CppParser::Parameter("const std::string& protocol", pConstr); + pConstr->addParameter(pParam3); + + Poco::CppParser::Variable* pVar = new Poco::CppParser::Variable(InterfaceGenerator::generateClassName(pStruct) + "* _pInterface", _pStruct); + pVar->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + _cppGen.registerConstructorHint(pVar, pParam1); + + Poco::CppParser::Variable* pVar2 = new Poco::CppParser::Variable("Poco::RemotingNG::Identifiable::ObjectId _objectId", _pStruct); + pVar2->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + _cppGen.registerConstructorHint(pVar2, pParam2); + + pConstr->addDocumentation( " Creates a " + _pStruct->name() + "."); + + Poco::CppParser::Function* pDestr = new Poco::CppParser::Function(std::string("virtual ~")+_pStruct->name(), _pStruct); + pDestr->addDocumentation( " Destroys the " + _pStruct->name() + "."); + // include as fwd decl the concrete RemoteObject + _cppGen.addIncludeFile("Poco/RemotingNG/EventDispatcher.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/URIUtility.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/Serializer.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/Deserializer.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/TypeSerializer.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/TypeDeserializer.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/RemotingException.h"); + // add a method virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const + Poco::CppParser::Function* pTypeId = new Poco::CppParser::Function("virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId", _pStruct); + pTypeId->makeConst(); + pTypeId->makeInline(); + + // add a member: static const std::string DEFAULT_NS; + Poco::CppParser::Variable* pVar3 = new Poco::CppParser::Variable("static const std::string DEFAULT_NS", _pStruct); + pVar3->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + + // checks if the class or any parent contains public BasicEvents + checkForEventMembers(pStruct, properties); +} + + +void EventDispatcherGenerator::methodStart(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& methodProperties) +{ + // we don't handle the regular methods here, only events +} + + +void EventDispatcherGenerator::methodStartImpl(Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& methodProperties) +{ + includeTypeSerializers(pFunc, false, false); +} + + +void EventDispatcherGenerator::registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e) +{ + //we don't want any code for constructor and destructor + e.registerCallback(_pStruct->name(), &EventDispatcherGenerator::constructorCodeGen); + e.registerCallback("~"+_pStruct->name(), &EventDispatcherGenerator::destructorCodeGen); + e.registerCallback("remoting__typeId", &AbstractGenerator::typeIdCodeGen); + + std::vector::const_iterator it = _outerEventFunctions.begin(); + for (; it != _outerEventFunctions.end(); ++it) + e.registerCallback(*it, &EventDispatcherGenerator::eventCodeGen); + + // for all other methods we want the serializing implementation + e.registerDefaultCallback(&EventDispatcherGenerator::serializeCodeGen); + e.registerPostClassCallback(&EventDispatcherGenerator::staticMembersInitializer); +} + + +std::vector EventDispatcherGenerator::newBaseClasses(const Poco::CppParser::Struct* pStruct) +{ + std::vector bases; + bases.push_back("Poco::RemotingNG::EventDispatcher"); + return bases; +} + + +void EventDispatcherGenerator::serializeCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("using namespace std::string_literals;\n"); + + OrderedParameters attrs; + OrderedParameters elems; + std::set nsSet; + doElemAttrSplit(pFunc, attrs, elems, nsSet); + std::map nsIdx; + //static std::string REMOTING__NAMES[] = {"create", "protocol", "endPoint"}; // methodName followed by param names, followed by other than default namespaces + std::string staticIds = EventDispatcherGenerator::generateStaticIdString(pFunc, nsSet, attrs, elems, nsIdx); + gen.writeMethodImplementation(staticIds); + + std::map outParams; + detectOutParams(pFunc, outParams); + Poco::CodeGeneration::CodeGenerator::Properties classProperties; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pStruct, classProperties); + + Poco::CodeGeneration::CodeGenerator::Properties methodProperties(classProperties); + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, methodProperties); + + bool hasReturnParam = pFunc->getReturnParameter() != Utility::TYPE_VOID && !pFunc->getReturnParameter().empty(); + bool isOneWay = (outParams.empty() && !hasReturnParam) || (methodProperties.find(Utility::ONEWAY) != methodProperties.end()); + + Poco::CodeGeneration::CodeGenerator::Properties::const_iterator itEvent = methodProperties.find("event"); + bool isEvent = (itEvent != methodProperties.end()); + + writeSerializingBlock(pFunc, attrs, elems, nsIdx, gen, isOneWay, isEvent); + writeDeserializingBlock(pFunc, attrs, elems, gen, isOneWay, isEvent); +} + + +void EventDispatcherGenerator::constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + EventDispatcherGenerator* pProxy = dynamic_cast(pAGen); + poco_check_ptr (pProxy); + + const Poco::CppParser::Struct* pDataType = pProxy->_pStructIn; // returns the data type for which pStruct was generated + const std::vector& events = pProxy->_events; + std::vector::const_iterator it = events.begin(); + for (; it != events.end(); ++it) + { + std::string line("_pInterface->" + *it); + line.append(" += "); + line.append("Poco::delegate(this, &"); + line.append(EventDispatcherGenerator::generateClassName(pDataType)); + line.append("::"); + line.append(EventDispatcherGenerator::generateEventFunctionName(*it)); + line.append(");"); + gen.writeMethodImplementation(line); + } +} + + +void EventDispatcherGenerator::destructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + EventDispatcherGenerator* pProxy = dynamic_cast(pAGen); + poco_check_ptr (pProxy); + + gen.writeMethodImplementation("try"); + gen.writeMethodImplementation("{"); + const Poco::CppParser::Struct* pDataType = pProxy->_pStructIn; // returns the data type for which pStruct was generated + const std::vector& events = pProxy->_events; + std::vector::const_iterator it = events.begin(); + for (; it != events.end(); ++it) + { + std::string line("\t_pInterface->" + *it); + line.append(" -= "); + line.append("Poco::delegate(this, &"); + line.append(EventDispatcherGenerator::generateClassName(pDataType)); + line.append("::"); + line.append(EventDispatcherGenerator::generateEventFunctionName(*it)); + line.append(");"); + gen.writeMethodImplementation(line); + } + gen.writeMethodImplementation("}"); + gen.writeMethodImplementation("catch (...)"); + gen.writeMethodImplementation("{"); + gen.writeMethodImplementation("\tpoco_unexpected();"); + gen.writeMethodImplementation("}"); +} + + +void EventDispatcherGenerator::staticMembersInitializer(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + std::string code("const std::string "); + code.append(pStruct->name()); + code.append("::DEFAULT_NS(\""); + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pStruct, structProps); + std::string defNS; + GeneratorEngine::getStringProperty(structProps, Utility::NAMESPACE, defNS); + code.append(defNS); + code.append("\");"); + gen.writeImplementation(code); +} + + +std::string EventDispatcherGenerator::generateStaticIdString(const Poco::CppParser::Function* pFunc, const std::set& nameSpaces, OrderedParameters& attrs, OrderedParameters& elems, std::map& nsIndex) +{ + std::set::const_iterator itNS = nameSpaces.begin(); + std::set::const_iterator itNSEnd = nameSpaces.end(); + nsIndex.clear(); + int firstNSIdx = static_cast(attrs.size()+elems.size()+1); + for (; itNS != itNSEnd; ++itNS, ++firstNSIdx) + { + nsIndex.insert(std::make_pair(*itNS, firstNSIdx)); + } + std::string staticIds("static const std::string REMOTING__NAMES[] = {\""); + std::string aName(GenUtility::getMethodName(pFunc)); + staticIds.append(aName); + staticIds.append("\"s,"); + + OrderedParameters::iterator it = attrs.begin(); + OrderedParameters::iterator itEnd = attrs.end(); + + int namePos = 1; + for (; it != itEnd; ++it, ++namePos) + { + SerializerGenerator::appendStaticVarName(it->second.name, staticIds); + /// set nameId and nameSpaceId + std::map::const_iterator itIdx = nsIndex.find(it->second.nameSpace); + if (itIdx != nsIndex.end()) + { + it->second.nameSpacePos = itIdx->second; + } + else + it->second.nameSpacePos = -1; + it->second.namePos = namePos; + } + it = elems.begin(); + itEnd = elems.end(); + for (; it != itEnd; ++it, ++namePos) + { + SerializerGenerator::appendStaticVarName(it->second.name, staticIds); + /// set nameId and nameSpaceId + std::map::const_iterator itIdx = nsIndex.find(it->second.nameSpace); + if (itIdx != nsIndex.end()) + { + it->second.nameSpacePos = itIdx->second; + } + else + it->second.nameSpacePos = -1; + it->second.namePos = namePos; + } + + // add namespaces + itNS = nameSpaces.begin(); + itNSEnd = nameSpaces.end(); + for (; itNS != itNSEnd; ++itNS) + { + SerializerGenerator::appendStaticVarName(*itNS, staticIds); + } + if (staticIds[staticIds.size() -1] == ',') + { + staticIds[staticIds.size() -1] = '}'; + staticIds.append(";"); + } + else + staticIds.append("};"); + + return staticIds; +} + + +void EventDispatcherGenerator::writeSerializingBlock(const Poco::CppParser::Function* pFunc, const OrderedParameters& attrs, const OrderedParameters& elems, const std::map& nsIdx, CodeGenerator& gen, bool isOneWay, bool isEvent) +{ + gen.writeMethodImplementation("Poco::RemotingNG::Transport& remoting__trans = transportForSubscriber(subscriberURI);"); + gen.writeMethodImplementation("Poco::ScopedLock remoting__lock(remoting__trans);"); + if (isOneWay) + { + // invoke oneway + gen.writeMethodImplementation("Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginMessage(_objectId, remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_EVENT);"); + } + else + { + gen.writeMethodImplementation("Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(_objectId, remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_EVENT);"); + } + + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pFunc->nameSpace(), structProps); + CodeGenerator::Properties funcProps(structProps); + GeneratorEngine::parseProperties(pFunc, funcProps); + std::string structDefaultNS; + GeneratorEngine::getStringProperty(structProps, Utility::NAMESPACE, structDefaultNS); + std::string funcDefaultNS(structDefaultNS); + GeneratorEngine::getStringProperty(funcProps, Utility::NAMESPACE, funcDefaultNS); + int funcNsIdx = -1; + if (!funcDefaultNS.empty()) + { + if (funcDefaultNS == structDefaultNS) + gen.writeMethodImplementation("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS);"); + else + { + std::map::const_iterator itNS = nsIdx.find(funcDefaultNS); + poco_assert_dbg (itNS != nsIdx.end()); + std::string code("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, REMOTING__NAMES["); + funcNsIdx = itNS->second; + code.append(Poco::NumberFormatter::format(itNS->second)); + code.append("]);"); + gen.writeMethodImplementation(code); + } + } + + // write attrs before serializeRequest + OrderedParameters::const_iterator itOP = attrs.begin(); + OrderedParameters::const_iterator itOPEnd = attrs.end(); + for (; itOP != itOPEnd; ++itOP) + { + if (itOP->second.direction != "out") + { + //ser.pushAttribute(ns, name); + std::string code("remoting__ser.pushAttribute("); + if (itOP->second.nameSpacePos < 0) + { + code.append("DEFAULT_NS, "); + } + else + { + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itOP->second.nameSpacePos)); + code.append("], "); + } + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itOP->second.namePos)); + code.append("]);"); + gen.writeMethodImplementation(code); + } + } + + OrderedParameters::const_iterator itElem = elems.begin(); + OrderedParameters::const_iterator itElemEnd = elems.end(); + for (; itElem != itElemEnd; ++itElem) + { + if (itElem->second.direction != "out") + { + std::string elemStr; + GeneratorEngine::getStringProperty(funcProps, "$" + itElem->second.varName, elemStr); + if (!elemStr.empty()) + { + CodeGenerator::Properties elemProps; + GeneratorEngine::parseElementProperties(elemStr, elemProps); + bool header = false; + GeneratorEngine::getBoolProperty(elemProps, GenUtility::ATTR_HEADER, header); + + if (header) + { + std::string code("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_HEADER, "); + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itElem->second.namePos)); + code.append("]);"); + gen.writeMethodImplementation(code); + } + } + } + } + + std::string messageType(isEvent ? "EVENT" : "REQUEST"); + gen.writeMethodImplementation("remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + + writeTypeSerializer(pFunc, attrs, true, funcNsIdx, gen); + writeTypeSerializer(pFunc, elems, false, funcNsIdx, gen); + + gen.writeMethodImplementation("remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + + if (!funcDefaultNS.empty()) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE);"); + } +} + + +void EventDispatcherGenerator::writeTypeSerializer(const Poco::CppParser::Function* pFunc, const OrderedParameters& params, bool isAttr, int funcNsIdx, CodeGenerator& gen) +{ + OrderedParameters::const_iterator itOP = params.begin(); + OrderedParameters::const_iterator itOPEnd = params.end(); + int lastNS = funcNsIdx; + // do not write the first param! + if (itOP != itOPEnd) + ++itOP; + for (; itOP != itOPEnd; ++itOP) + { + if (itOP->second.direction != "out") + { + poco_check_ptr (itOP->second.pParam); + if (!isAttr && lastNS != itOP->second.nameSpacePos) + { + if (lastNS != funcNsIdx) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE);"); + } + std::string code("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itOP->second.nameSpacePos)); + code.append("]);"); + gen.writeMethodImplementation(code); + lastNS = itOP->second.nameSpacePos; + } + + + const Poco::CppParser::Parameter* pParam = itOP->second.pParam; + std::string type(Utility::resolveType(pFunc->nameSpace(), pParam->declType())); + std::string serLine("Poco::RemotingNG::TypeSerializer<"); + Poco::CppParser::Symbol* pSym = pFunc->nameSpace()->lookup(type); + bool enumMode = false; + std::string enumBaseType; + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_ENUM) + { + enumBaseType = static_cast(pSym)->baseType(); + if (enumBaseType.empty()) enumBaseType = "int"; + enumMode = true; + type = enumBaseType; + } + serLine.append(type); + if (itOP->second.pParam->isPointer()) + serLine.append("*"); + serLine.append(">::serialize(REMOTING__NAMES["); + + serLine.append(Poco::NumberFormatter::format(itOP->second.namePos)); + serLine.append("], "); + if (enumMode) + { + serLine.append("static_cast<"); + serLine.append(enumBaseType); + serLine.append(">("); + serLine.append(itOP->second.varName); + serLine.append(")"); + } + else + { + serLine.append(itOP->second.varName); + } + serLine.append(", remoting__ser);"); + gen.writeMethodImplementation(serLine); + } + } + if (!isAttr && lastNS != funcNsIdx) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE);"); + } +} + + +void EventDispatcherGenerator::writeDeserializingBlock(const Poco::CppParser::Function* pFunc, const OrderedParameters& attrs, const OrderedParameters& elems,CodeGenerator& gen, bool isOneWay, bool isEvent) +{ + if (isOneWay) + { + gen.writeMethodImplementation("remoting__trans.sendMessage(_objectId, remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_EVENT);"); + } + else + { + gen.writeMethodImplementation("Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(_objectId, remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_EVENT);"); + std::map outParams; + detectOutParams(pFunc, outParams); + + writePrepareAttribute(attrs, outParams, "", gen); + CodeGenerator::Properties funcProps; + GeneratorEngine::parseProperties(pFunc, funcProps); + + OrderedParameters::const_iterator itElem = elems.begin(); + OrderedParameters::const_iterator itElemEnd = elems.end(); + for (; itElem != itElemEnd; ++itElem) + { + std::string elemStr; + GeneratorEngine::getStringProperty(funcProps, "$" + itElem->second.varName, elemStr); + if (!elemStr.empty()) + { + CodeGenerator::Properties elemProps; + GeneratorEngine::parseElementProperties(elemStr, elemProps); + bool header = false; + GeneratorEngine::getBoolProperty(elemProps, GenUtility::ATTR_HEADER, header); + + if (header) + { + std::string code("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_HEADER, "); + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itElem->second.namePos)); + code.append("]);"); + gen.writeMethodImplementation(code); + } + } + } + + std::string name(GenUtility::getMethodName(pFunc)); + std::string responseName(GenUtility::getReplyMethodName(pFunc)); + std::string messageType(isEvent ? "EVENT_REPLY" : "REPLY"); + if (name != responseName) + { + gen.writeMethodImplementation("static const std::string REMOTING__REPLY_NAME(\"" + responseName + "\");"); + gen.writeMethodImplementation("remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + else + { + gen.writeMethodImplementation("remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + + writeTypeDeserializers(pFunc, attrs, outParams, "", gen); + + std::string retParamName(generateRetParamName(pFunc)); + bool hasReturnParam = !retParamName.empty(); + writeDeserializeReturnParam(pFunc, gen); + + writeTypeDeserializers(pFunc, elems, outParams, "", gen); + if (name != responseName) + { + gen.writeMethodImplementation("remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + else + { + gen.writeMethodImplementation("remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + + gen.writeMethodImplementation("remoting__trans.endRequest();"); + + if (hasReturnParam) + { + gen.writeMethodImplementation(Utility::RETURN + " " + retParamName + ";"); + } + } +} + + +void EventDispatcherGenerator::writeTypeDeserializers(const Poco::CppParser::Function* pFunc, + const OrderedParameters& params, + const std::map& outParams, + const std::string& indentation, + CodeGenerator& gen) +{ + std::string deserPre("Poco::RemotingNG::TypeDeserializer<"); + OrderedParameters::const_iterator itOP = params.begin(); + OrderedParameters::const_iterator itOPEnd = params.end(); + + for (; itOP != itOPEnd; ++itOP) + { + poco_check_ptr (itOP->second.pParam); + const Poco::CppParser::Parameter* pParam = itOP->second.pParam; + std::map::const_iterator itD = outParams.find(pParam->name()); + if (itD != outParams.end()) + { + std::string retType(Utility::resolveType(pFunc->nameSpace(), itD->second->declType())); + bool isOutParam = (itD->second->isReference()||itD->second->isPointer()) && !itD->second->isConst(); + poco_assert (isOutParam); + Poco::CppParser::Symbol* pSym = pFunc->nameSpace()->lookup(retType); + bool enumMode = false; + std::string enumBaseType; + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_ENUM) + { + enumMode = true; + enumBaseType = static_cast(pSym)->baseType(); + if (enumBaseType.empty()) enumBaseType = "int"; + } + std::string cntStr(Poco::NumberFormatter::format(itOP->second.namePos)); + + std::string codeLine(deserPre); + if (enumMode) + codeLine += enumBaseType; + else + codeLine += retType; + codeLine.append(">::deserialize(REMOTING__NAMES["); + codeLine.append(cntStr); + codeLine.append("], "); + if (itOP->second.mandatory) + codeLine.append("true, "); + else + codeLine.append("false, "); + codeLine.append("remoting__deser, " ); + if (enumMode) + { + gen.writeMethodImplementation(Poco::format("%s%s remoting__%sTmp;", indentation, enumBaseType, itOP->second.varName)); + codeLine.append("remoting__"); + codeLine.append(itOP->second.varName); + codeLine.append("Tmp"); + } + else + { + codeLine.append(itOP->second.varName); + } + codeLine.append(");"); + gen.writeMethodImplementation(indentation+codeLine); + if (enumMode) + { + gen.writeMethodImplementation(Poco::format("%s%s = static_cast<%s>(remoting__%sTmp);", indentation, itOP->second.varName, retType, itOP->second.varName)); + } + } + } +} + + +void EventDispatcherGenerator::writeDeserializeReturnParam(const Poco::CppParser::Function* pFunc, CodeGenerator& gen) +{ + std::string retParamName(generateRetParamName(pFunc)); + bool hasReturnParam = !retParamName.empty(); + + // always get the return param first + if (hasReturnParam) + { + std::string retParamType(GenUtility::getResolvedReturnParameterType(pFunc->nameSpace(), pFunc)); + Poco::CppParser::Parameter retParam(pFunc->getReturnParameter() + " dummy", 0); + bool needsClear = (GenUtility::isVectorType(pFunc->nameSpace(), &retParam) + || GenUtility::isNullableType(pFunc->nameSpace(), &retParam) + || GenUtility::isOptionalType(pFunc->nameSpace(), &retParam)) + && !GenUtility::isArrayType(pFunc->nameSpace(), &retParam); + + if (needsClear) + { + gen.writeMethodImplementation(retParamName+".clear();"); + } + std::string retName(GenUtility::getReturnParameterName(pFunc)); + if (retName != Poco::RemotingNG::SerializerBase::RETURN_PARAM) + { + // static const std::string REMOTING__RETURN_PARAM_NAME("$retName") + std::string line("static const std::string REMOTING__RETURN_PARAM_NAME(\""); + line.append(retName); + line.append("\");"); + gen.writeMethodImplementation(line); + } + Poco::CppParser::Symbol* pSym = pFunc->nameSpace()->lookup(retParamType); + bool enumMode = false; + std::string enumBaseType; + std::string deserType; + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_ENUM) + { + enumBaseType = static_cast(pSym)->baseType(); + if (enumBaseType.empty()) enumBaseType = "int"; + enumMode = true; + deserType = enumBaseType; + } + else + { + retParamType = retParam.declType(); + deserType = retParamType; + } + if (enumMode) + { + gen.writeMethodImplementation(Poco::format("%s remoting__%sTmp;", enumBaseType, retParamName)); + } + std::string line("Poco::RemotingNG::TypeDeserializer<" + deserType); + if (retParam.isPointer()) + line.append("*"); + bool doInline = GenUtility::getInlineReturnParam(pFunc); + if (doInline) + line.append(">::deserializeImpl("); + else + line.append(">::deserialize("); + if (retName == Poco::RemotingNG::SerializerBase::RETURN_PARAM) + line.append("Poco::RemotingNG::SerializerBase::RETURN_PARAM"); + else + line.append("REMOTING__RETURN_PARAM_NAME"); + line.append(", true, remoting__deser, "); + if (enumMode) + line.append(Poco::format("remoting__%sTmp", retParamName)); + else + line.append(retParamName); + line.append(");"); + gen.writeMethodImplementation(line); + if (enumMode) + { + gen.writeMethodImplementation(Poco::format("%s = static_cast<%s>(remoting__%sTmp);", retParamName, retParamType, retParamName)); + } + } +} + + +void EventDispatcherGenerator::writePrepareAttribute(const OrderedParameters& attrs, const std::map& outParams, const std::string& indentation, CodeGenerator& gen) +{ + OrderedParameters::const_iterator itAttrs = attrs.begin(); + OrderedParameters::const_iterator itAttrsEnd = attrs.end(); + for (; itAttrs != itAttrsEnd; ++itAttrs) + { + if (outParams.find(itAttrs->second.pParam->name()) != outParams.end()) + { + //deser.pushAttribute(ns, name, bool) + std::string code("remoting__deser.pushAttribute("); + if (itAttrs->second.nameSpacePos < 0) + { + code.append("DEFAULT_NS, "); + } + else + { + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itAttrs->second.nameSpacePos)); + code.append("], "); + } + + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itAttrs->second.namePos)); + code.append("], "); + + if (itAttrs->second.mandatory) + code.append("true);"); + else + code.append("false);"); + + gen.writeMethodImplementation(indentation+code); + } + } +} + + +void EventDispatcherGenerator::detectOutParams(const Poco::CppParser::Function* pFunc, std::map& outParams) +{ + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + for (; it != itEnd; ++it) + { + // add all non-const refs, add all pointers + Poco::CppParser::Parameter* pParam = *it; + if ( (pParam->isReference()||pParam->isPointer()) && !pParam->isConst()) + { + outParams.insert(std::make_pair(pParam->name(), pParam)); + } + } +} + + +bool EventDispatcherGenerator::hasAnyOutParams(const Poco::CppParser::Function* pFunc) +{ + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + for (; it != itEnd; ++it) + { + // add all non-const refs, add all pointers + Poco::CppParser::Parameter* pParam = *it; + if ( (pParam->isReference()||pParam->isPointer()) && !pParam->isConst()) + { + return true; + } + } + + return pFunc->getReturnParameter() != Utility::TYPE_VOID && !pFunc->getReturnParameter().empty(); +} + + +void EventDispatcherGenerator::doElemAttrSplit(const Poco::CppParser::Function* pFunc, OrderedParameters& attrs, OrderedParameters& elems, std::set& nameSpaces) +{ + nameSpaces.clear(); + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pFunc->nameSpace(), structProps); + CodeGenerator::Properties funcProps(structProps); + GeneratorEngine::parseProperties(pFunc, funcProps); + Poco::UInt32 paramCnt = 0; + const Poco::UInt32 unknownOrderOffset = 0xffff0000; + std::string structDefaultNS; + GeneratorEngine::getStringProperty(structProps, Utility::NAMESPACE, structDefaultNS); + std::string funcDefaultNS(structDefaultNS); + GeneratorEngine::getStringProperty(funcProps, Utility::NAMESPACE, funcDefaultNS); + + for (; it != itEnd; ++it, ++paramCnt) + { + Poco::UInt32 order = unknownOrderOffset + paramCnt; + std::string aName((*it)->name()); + std::string aNS(funcDefaultNS); + bool mandatory = true; + std::string direction; + CodeGenerator::Properties::iterator itProp = funcProps.find("$" + aName); + + if (itProp != funcProps.end()) + { + CodeGenerator::Properties paramProps; // we need type and order + GeneratorEngine::parseElementProperties(itProp->second, paramProps); + + GeneratorEngine::getStringProperty(paramProps, Utility::NAME, aName); + GeneratorEngine::getStringProperty(paramProps, Utility::NAMESPACE, aNS); + mandatory = GenUtility::getIsMandatory(paramProps); + GeneratorEngine::getStringProperty(paramProps, Utility::DIRECTION, direction); + if (!aNS.empty() && aNS != structDefaultNS) + nameSpaces.insert(aNS); + + std::string type; + bool hasType = GeneratorEngine::getStringProperty(paramProps, Utility::TYPE, type); + bool isAttr = false; // the default is elem + if (hasType && type == Utility::VAL_ATTR) + isAttr = true; + + GeneratorEngine::getUInt32Property(paramProps, Utility::ORDER, order); + if (isAttr) + attrs.insert(std::make_pair(order, ExtParam((*it)->name(), aName, aNS, *it, mandatory, direction))); + else + elems.insert(std::make_pair(order, ExtParam((*it)->name(), aName, aNS, *it, mandatory, direction))); + } + else + { + elems.insert(std::make_pair(order, ExtParam((*it)->name(), aName, aNS, *it, mandatory, direction))); + } + } +} + + +void EventDispatcherGenerator::checkForEventMembers(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + checkForEventMembersImpl(pStruct, properties); + + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + for (; itB != itBEnd; ++itB) + { + const Poco::CppParser::Struct* pParent = itB->pClass; + if (pParent && Utility::hasAnyRemoteProperty(pParent)) + { + Poco::CodeGeneration::CodeGenerator::Properties parentProperties; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pParent, parentProperties); + checkForEventMembers(pParent, parentProperties); + } + } +} + + +void EventDispatcherGenerator::checkForEventMembersImpl(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + Poco::CppParser::NameSpace::SymbolTable tbl; + pStruct->variables(tbl); + Poco::CppParser::NameSpace::SymbolTable::const_iterator it = tbl.begin(); + Poco::CppParser::NameSpace::SymbolTable::const_iterator itEnd = tbl.end(); + for (; it != itEnd; ++it) + { + Poco::CppParser::Variable* pVar = static_cast(it->second); + Poco::CodeGeneration::CodeGenerator::Properties eventProperties(properties); + Poco::CodeGeneration::GeneratorEngine::parseProperties(pVar, eventProperties); + if (GenUtility::isRemoteEvent(pVar, eventProperties)) + { + _events.push_back(pVar->name()); + _cppGen.addSrcIncludeFile("Poco/Delegate.h"); + // generate a serializer method for that member too + // call methodStart(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& methodProperties) + // convert the basicevent to a private function + std::string funcDecl("void "); + std::string fctName = generateEventFunctionName(pVar->name()); + funcDecl.append(fctName); + std::vector templTypes = GenUtility::getResolvedInnerTemplateTypes(pStruct, pVar->declType()); + if (templTypes.size() != 1) + throw Poco::InvalidArgumentException("Illegal remote event param: " + pVar->fullName()); + std::string paramDecl = templTypes[0]; + if (paramDecl != "void") + { + paramDecl.append("& data"); + } + { + Poco::CppParser::Function* pFunc = new Poco::CppParser::Function(funcDecl, _pStruct); + + Poco::CppParser::Parameter* pParam = new Poco::CppParser::Parameter("const void* pSender", 0); + pFunc->addParameter(pParam); + + if (paramDecl != "void") + { + Poco::CppParser::Parameter* pParam2 = new Poco::CppParser::Parameter(paramDecl, 0); + pFunc->addParameter(pParam2); + } + _outerEventFunctions.push_back(fctName); + + if (pVar->getAttributes().has("oneway")) + { + Poco::CppParser::Attributes funcAttr = pFunc->getAttributes(); + funcAttr.set("oneway", pVar->getAttributes().getString("oneway")); + pFunc->setAttributes(funcAttr); + } + + if (pVar->getAttributes().has(Utility::FILTER)) + { + Poco::CppParser::Attributes funcAttr = pFunc->getAttributes(); + funcAttr.set(Utility::FILTER, pVar->getAttributes().getString(Utility::FILTER)); + pFunc->setAttributes(funcAttr); + } + } + funcDecl.append("Impl"); + { + Poco::CppParser::Function* pFunc = new Poco::CppParser::Function(funcDecl, _pStruct); + Poco::CppParser::Parameter* pParam0 = new Poco::CppParser::Parameter("const std::string& subscriberURI", 0); + pFunc->addParameter(pParam0); + if (templTypes[0] != "void") + { + Poco::CppParser::Parameter* pParam1 = new Poco::CppParser::Parameter(paramDecl, 0); + pFunc->addParameter(pParam1); + } + CodeGenerator::Properties methodProperties; + Poco::CppParser::Attributes funcAttr; + const Poco::CppParser::Attributes& varAttr = pVar->getAttributes(); + // we have one single parameter, this one defines the name of the function! + funcAttr.set("inline", "true"); + funcAttr.set("event", "true"); + methodProperties.insert(std::make_pair("inline", "true")); + methodProperties.insert(std::make_pair("event", "true")); + if (varAttr.has("name")) + { + funcAttr.set("name", varAttr.getString("name")); + methodProperties.insert(std::make_pair("name", varAttr.getString("name"))); + } + else + { + funcAttr.set("name", pVar->name()); + methodProperties.insert(std::make_pair("name", pVar->name())); + } + if (varAttr.has("oneway")) + { + std::string oneVal = varAttr.getString("oneway"); + funcAttr.set("oneway", oneVal); + methodProperties.insert(std::make_pair("oneway", oneVal)); + } + pFunc->setAttributes(funcAttr); + pFunc->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + methodStartImpl(pFunc, methodProperties); + methodEnd(pFunc, methodProperties); + } + } + } + + if (!_events.empty()) + { + Poco::Path file (Utility::createInclude(_pStruct, true)); + + std::string newFileName = InterfaceGenerator::generateClassName(_pStructIn); + file.setBaseName(newFileName); + std::string inclFile = file.toString(Poco::Path::PATH_UNIX); + _cppGen.addIncludeFile(inclFile); + } +} + + +std::string EventDispatcherGenerator::generateEventFunctionName(const std::string& eventVarname) +{ + return "event__" + Poco::trim(eventVarname); +} + + +void EventDispatcherGenerator::eventCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + EventDispatcherGenerator* pProxy = dynamic_cast(pAGen); + poco_check_ptr (pProxy); + + bool hasFilter = pFunc->getAttributes().getBool(Utility::FILTER, false); + if (hasFilter) + { + std::string nameLine("static const std::string REMOTING__EVENT_NAME(\""); + nameLine.append(pFunc->name().substr(7)); // strip out "event__" prefix + nameLine.append("\");"); + gen.writeMethodImplementation(nameLine); + } + + // only forward to the network if the network is not the sender + gen.writeMethodImplementation("if (pSender)"); + gen.writeMethodImplementation("{"); + gen.writeMethodImplementation("\tPoco::Clock now;"); + gen.writeMethodImplementation("\tPoco::FastMutex::ScopedLock lock(_mutex);"); + gen.writeMethodImplementation("\tSubscriberMap::iterator it = _subscribers.begin();"); + gen.writeMethodImplementation("\twhile (it != _subscribers.end())"); + gen.writeMethodImplementation("\t{"); + gen.writeMethodImplementation("\t\tif (it->second->expireTime != 0 && it->second->expireTime < now)"); + gen.writeMethodImplementation("\t\t{"); + gen.writeMethodImplementation("\t\t\tSubscriberMap::iterator itDel(it++);"); + gen.writeMethodImplementation("\t\t\t_subscribers.erase(itDel);"); + gen.writeMethodImplementation("\t\t}"); + gen.writeMethodImplementation("\t\telse"); + gen.writeMethodImplementation("\t\t{"); + if (pFunc->getAttributes().has("oneway")) + { + gen.writeMethodImplementation("\t\t\ttry"); + gen.writeMethodImplementation("\t\t\t{"); + if (pFunc->countParameters() == 1) // void event + { + gen.writeMethodImplementation("\t\t\t\t" + pFunc->name() + "Impl(it->first);"); + } + else + { + if (hasFilter) + { + gen.writeMethodImplementation("\t\t\t\tif (accept(it->second->filters, REMOTING__EVENT_NAME, data))"); + gen.writeMethodImplementation("\t\t\t\t{"); + gen.writeMethodImplementation("\t\t\t\t\t" + pFunc->name() + "Impl(it->first, data);"); + gen.writeMethodImplementation("\t\t\t\t}"); + } + else + { + gen.writeMethodImplementation("\t\t\t\t" + pFunc->name() + "Impl(it->first, data);"); + } + } + gen.writeMethodImplementation("\t\t\t}"); + gen.writeMethodImplementation("\t\t\tcatch (Poco::Exception&)"); + gen.writeMethodImplementation("\t\t\t{"); + gen.writeMethodImplementation("\t\t\t}"); + } + else + { + gen.writeMethodImplementation("\t\t\ttry"); + gen.writeMethodImplementation("\t\t\t{"); + if (pFunc->countParameters() == 1) // void event + { + gen.writeMethodImplementation("\t\t\t\t" + pFunc->name() + "Impl(it->first);"); + } + else + { + if (hasFilter) + { + gen.writeMethodImplementation("\t\t\t\tif (accept(it->second->filters, REMOTING__EVENT_NAME, data))"); + gen.writeMethodImplementation("\t\t\t\t{"); + gen.writeMethodImplementation("\t\t\t\t\t" + pFunc->name() + "Impl(it->first, data);"); + gen.writeMethodImplementation("\t\t\t\t}"); + } + else + { + gen.writeMethodImplementation("\t\t\t\t" + pFunc->name() + "Impl(it->first, data);"); + } + } + gen.writeMethodImplementation("\t\t\t}"); + gen.writeMethodImplementation("\t\t\tcatch (Poco::RemotingNG::RemoteException&)"); + gen.writeMethodImplementation("\t\t\t{"); + gen.writeMethodImplementation("\t\t\t\tthrow;"); + gen.writeMethodImplementation("\t\t\t}"); + gen.writeMethodImplementation("\t\t\tcatch (Poco::Exception&)"); + gen.writeMethodImplementation("\t\t\t{"); + gen.writeMethodImplementation("\t\t\t}"); + } + gen.writeMethodImplementation("\t\t\t++it;"); + gen.writeMethodImplementation("\t\t}"); + gen.writeMethodImplementation("\t}"); + gen.writeMethodImplementation("}"); +} diff --git a/RemotingNG/RemoteGen/src/EventDispatcherGenerator.h b/RemotingNG/RemoteGen/src/EventDispatcherGenerator.h new file mode 100644 index 0000000000..e16d437df0 --- /dev/null +++ b/RemotingNG/RemoteGen/src/EventDispatcherGenerator.h @@ -0,0 +1,147 @@ +// +// EventDispatcherGenerator.h +// +// Definition of the EventDispatcherGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef RemoteGen_EventDispatcherGenerator_INCLUDED +#define RemoteGen_EventDispatcherGenerator_INCLUDED + + +#include "AbstractGenerator.h" +#include "Poco/CodeGeneration/CppGenerator.h" +#include + + +class EventDispatcherGenerator: public AbstractGenerator + /// EventDispatcherGenerator generates a proxy for a given class definition. C++ specific. +{ +public: + struct ExtParam + { + std::string varName; + /// The original name + std::string name; + /// The name after renaming. + int namePos; + std::string nameSpace; + int nameSpacePos; + const Poco::CppParser::Parameter* pParam; + bool mandatory; + std::string direction; + ExtParam(const std::string& origName, const std::string& aName, const std::string& aNS, const Poco::CppParser::Parameter* aParam, bool isMandatory, const std::string& aDirection): + varName(origName), + name(aName), + namePos(-1), + nameSpace(aNS), + nameSpacePos(-1), + pParam(aParam), + mandatory(isMandatory), + direction(aDirection) + { + poco_check_ptr (pParam); + } + }; + + typedef std::map OrderedParameters; + /// maps orderid to a a pair of name and parameter + + EventDispatcherGenerator(Poco::CodeGeneration::CppGenerator& cppGen); + /// Creates the EventDispatcherGenerator. + + ~EventDispatcherGenerator(); + /// Destroys the EventDispatcherGenerator. + + static std::string generateClassName(const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + static std::string generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// Must not write the namespace + + void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Writes the method header. Properties contains the properties found in the functions docuementation and in the class documentation. + + void registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e); + + std::string newClassName(const Poco::CppParser::Struct* pStruct); + /// generates the new class name based on the old one + + std::vector newBaseClasses(const Poco::CppParser::Struct* pStruct); + + static std::string generateStaticIdString(const Poco::CppParser::Function* pFunc, const std::set& nameSpaces, OrderedParameters& attrs, OrderedParameters& elems, std::map& nsIndex); + /// Generates a static ids vector containing as first element the fucntion name, followed by parameter names sorted by order. Set namespacePos and namePos in attrs and elems and converts the namespaces set to a map of namespaces ->stringIdx + + static void doElemAttrSplit(const Poco::CppParser::Function* pFunc, OrderedParameters& attrs, OrderedParameters& elems, std::set& nameSpaces); + + static void writePrepareAttribute(const OrderedParameters& attrs, const std::map& outParams, const std::string& indentation, CodeGenerator& gen); + + static void detectOutParams(const Poco::CppParser::Function* pFunc, std::map& outParams); + + static void writeTypeDeserializers(const Poco::CppParser::Function* pFunc, + const OrderedParameters& params, + const std::map& outParams, + const std::string& indentation, + CodeGenerator& gen); + + static bool hasAnyOutParams(const Poco::CppParser::Function* pFunc); + + static std::string generateEventFunctionName(const std::string& eventVarname); + /// generates a fct name for an event member + +private: + static void serializeCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static void eventCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static void constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + /// Code generator for constructor + + static void destructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + /// Code generator for destructor + + static void staticMembersInitializer(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static std::string generateOutParamName(const Poco::CppParser::Parameter* pParam, const std::string& functionName); + + static std::string generateRetParamName(const Poco::CppParser::Function* pFunc); + + static void writeSerializingBlock(const Poco::CppParser::Function* pFunc, const OrderedParameters& attrs, const OrderedParameters& elems, const std::map& nsIdx, CodeGenerator& gen, bool isOneWay, bool isEvent); + static void writeTypeSerializer(const Poco::CppParser::Function* pFunc, const OrderedParameters& params, bool isAttr, int funcNsIdx, CodeGenerator& gen); + static void writeDeserializingBlock(const Poco::CppParser::Function* pFunc, const OrderedParameters& attrs, const OrderedParameters& elems, CodeGenerator& gen, bool isOneWay, bool isEvent); + /// expireTime is in microsec + + static void writeDeserializeReturnParam(const Poco::CppParser::Function* pFunc, CodeGenerator& gen); + + void checkForEventMembers(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + void checkForEventMembersImpl(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// checks if the class or any parent contains public BasicEvents + + void methodStartImpl(Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& methodProperties); + + +private: + std::vector _boolsToInit; + std::vector _events; + std::vector _outerEventFunctions; +}; + + +// +// inlines +// +inline std::string EventDispatcherGenerator::newClassName(const Poco::CppParser::Struct* pStruct) +{ + return EventDispatcherGenerator::generateClassName(pStruct); +} + + +#endif // RemoteGen_EventDispatcherGenerator_INCLUDED diff --git a/RemotingNG/RemoteGen/src/EventSubscriberGenerator.cpp b/RemotingNG/RemoteGen/src/EventSubscriberGenerator.cpp new file mode 100644 index 0000000000..f9c56a7556 --- /dev/null +++ b/RemotingNG/RemoteGen/src/EventSubscriberGenerator.cpp @@ -0,0 +1,846 @@ +// +// EventSubscriberGenerator.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "EventSubscriberGenerator.h" +#include "InterfaceGenerator.h" +#include "ProxyGenerator.h" +#include "GenUtility.h" +#include "RemoteObjectGenerator.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CppParser/Enum.h" +#include "Poco/Exception.h" +#include "Poco/Path.h" +#include "Poco/NumberFormatter.h" +#include "Poco/Format.h" +#include "Poco/String.h" +#include "Poco/RemotingNG/SerializerBase.h" +#include + + +using namespace Poco::CodeGeneration; + + +EventSubscriberGenerator::EventSubscriberGenerator(Poco::CodeGeneration::CppGenerator& cppGen): + AbstractGenerator(cppGen), + _pCurrent(0) +{ +} + + +EventSubscriberGenerator::~EventSubscriberGenerator() +{ +} + + +std::string EventSubscriberGenerator::generateClassName(const Poco::CppParser::Struct* pStruct) +{ + poco_assert_dbg (pStruct); + std::string newClassName(pStruct->name()); + newClassName.append("EventSubscriber"); + return newClassName; +} + + +std::string EventSubscriberGenerator::generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct) +{ + if (ns.empty()) + return EventSubscriberGenerator::generateClassName(pStruct); + + return ns + "::" + EventSubscriberGenerator::generateClassName(pStruct); +} + + +void EventSubscriberGenerator::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + AbstractGenerator::structStart(pStruct, properties); + // add constructor/destructor + Poco::CppParser::Function* pConstr = new Poco::CppParser::Function(_pStruct->name(), _pStruct); + Poco::CppParser::Parameter* pConstr1 = new Poco::CppParser::Parameter("const std::string& uri", 0); + pConstr->addParameter(pConstr1); + Poco::CppParser::Parameter* pConstr2 = new Poco::CppParser::Parameter(ProxyGenerator::generateClassName(pStruct)+ "* pProxy", 0); + pConstr->addParameter(pConstr2); + pConstr->addDocumentation( " Creates a " + _pStruct->name() + "."); + + Poco::CppParser::Function* pDestr = new Poco::CppParser::Function(std::string("virtual ~")+_pStruct->name(), _pStruct); + pDestr->addDocumentation( " Destroys the " + _pStruct->name() + "."); + + // add a method virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const + Poco::CppParser::Function* pTypeId = new Poco::CppParser::Function("virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId", _pStruct); + pTypeId->makeConst(); + pTypeId->makeInline(); + + // add a member: static const std::string DEFAULT_NS; + Poco::CppParser::Variable* pVar2 = new Poco::CppParser::Variable("static const std::string DEFAULT_NS", _pStruct); + pVar2->setAccess(Poco::CppParser::Symbol::ACC_PUBLIC); + + // we will write the inline classes here already! + // add src includes at the beginning + std::string proxy = ProxyGenerator::generateQualifiedClassName(nameSpace(), _pStructIn); + Poco::CppParser::Symbol* pSym = Poco::CppParser::NameSpace::root()->lookup(proxy); + poco_assert (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_STRUCT); + Poco::CodeGeneration::Utility::handleBaseClassesInclude(_pStruct, _cppGen); + Poco::CodeGeneration::Utility::handleInclude(static_cast(pSym), _cppGen); + _cppGen.writeDefaultHeader(_pStruct, _pStruct->name(), _pStruct->getLibrary(), _pStruct->getPackage()); + + Poco::CodeGeneration::CodeGenerator::Properties classProperties; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pStruct, classProperties); + Poco::CppParser::Struct::Functions functions; + pStruct->methods(Poco::CppParser::Symbol::ACC_PUBLIC, functions); + + Poco::CppParser::Struct::Functions::const_iterator it = functions.begin(); + Poco::CppParser::Struct::Functions::const_iterator itEnd = functions.end(); + for (; it != itEnd; ++it) + { + Poco::CodeGeneration::CodeGenerator::Properties methodProperties(classProperties); + Poco::CodeGeneration::GeneratorEngine::parseProperties(*it, methodProperties); + if (GenUtility::isRemoteMethod(*it, methodProperties)) + { + includeTypeSerializers(*it, false, false); + } + } + + _cppGen.addSrcIncludeFile("Poco/RemotingNG/MethodHandler.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/ServerTransport.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/Serializer.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/Deserializer.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/TypeSerializer.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/TypeDeserializer.h"); + _cppGen.addSrcIncludeFile("Poco/SharedPtr.h"); + _cppGen.addIncludeFile("Poco/RemotingNG/EventSubscriber.h"); + + std::vector eventFunctions; + checkForEventMembers(pStruct, eventFunctions, properties); + + _cppGen.writeIncludes(); + _cppGen.writeNameSpaceBegin(nameSpace()); + + for (std::vector::const_iterator it = eventFunctions.begin(); it != eventFunctions.end(); ++it) + { + Poco::CodeGeneration::CodeGenerator::Properties methodProperties; + Poco::CodeGeneration::GeneratorEngine::parseProperties(*it, methodProperties); + + generateEventFunction(*it, methodProperties); + } +} + + +void EventSubscriberGenerator::structEnd() +{ + Poco::CodeGeneration::GeneratorEngine e; + registerCallbacks(e); + AbstractGenerator* pGen = this; // cast first to pGen for void* cast safety + e.generate(_pStruct, _cppGen, reinterpret_cast(pGen) ,false, false); + _cppGen.writeNameSpaceEnd(nameSpace()); + _cppGen.endFile(); + _pStruct = 0; + _pStructIn = 0; +} + + +void EventSubscriberGenerator::methodStart(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& properties) +{ +} + + +void EventSubscriberGenerator::generateEventFunction(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& properties) +{ + _pCurrent = pFuncOld; + + _currentFctOneWayProperty = (properties.find(Poco::CodeGeneration::Utility::ONEWAY) != properties.end()); + // we create for each method a class className##MethodName##MethodHandler + std::string className(_pStructIn->name()); + std::string methodName(pFuncOld->name()); + methodName[0] = std::toupper(methodName[0]); + className.append(methodName); + className.append("MethodHandler"); + std::string decl("class "); + decl.append(className); + + Poco::CppParser::Struct* pStruct = new Poco::CppParser::Struct(decl, true, _pNs); + pStruct->addBase("Poco::RemotingNG::MethodHandler", Poco::CppParser::Symbol::ACC_PUBLIC, false); + pStruct->makeInline(); + pStruct->fixupBases(); + if (pFuncOld->attrs().has("event")) + { + pStruct->attrs().set("event", "true"); + _isEvent = true; + } + Poco::CppParser::Function* pConstr = new Poco::CppParser::Function(className, pStruct); + Poco::CppParser::Parameter* pConstr1 = new Poco::CppParser::Parameter(ProxyGenerator::generateClassName(_pStructIn)+ "* pProxy", 0); + pConstr->addParameter(pConstr1); + Poco::CppParser::Variable* pVar = new Poco::CppParser::Variable(ProxyGenerator::generateClassName(_pStructIn)+ "* _pProxy", pStruct); + pVar->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + _cppGen.registerConstructorHint(pVar, "pProxy"); + + // add: void invoke(Poco::RemotingNG::ServerTransport& remoting__trans, Poco::RemotingNG::Desrializer& remoting__deser, Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject) + Poco::CppParser::Function* pInvoke = new Poco::CppParser::Function("void invoke", pStruct); + Poco::CppParser::Parameter* pParam1 = new Poco::CppParser::Parameter("Poco::RemotingNG::ServerTransport& remoting__trans", 0); + Poco::CppParser::Parameter* pParam2 = new Poco::CppParser::Parameter("Poco::RemotingNG::Deserializer& remoting__deser", 0); + Poco::CppParser::Parameter* pParam3 = new Poco::CppParser::Parameter("Poco::RemotingNG::RemoteObject::Ptr remoting__pRemoteObject", 0); + pInvoke->addParameter(pParam1); + pInvoke->addParameter(pParam2); + pInvoke->addParameter(pParam3); + + // don't append the real method name. Use the renamed version! + CodeGenerator::Properties funcProps; + GeneratorEngine::parseProperties(pFuncOld, funcProps); + std::string aName(pFuncOld->name()); + GeneratorEngine::getStringProperty(funcProps, Utility::NAME, aName); + _methodHandlers.insert(std::make_pair(aName, pStruct)); + Poco::CodeGeneration::GeneratorEngine e; + e.registerCallback("invoke", &EventSubscriberGenerator::invokeCodeGen); + e.registerCallback(className, &EventSubscriberGenerator::mhctorCodeGen); + AbstractGenerator* pGen = this; + e.generate(pStruct, _cppGen, reinterpret_cast(pGen), false, false); +} + + +void EventSubscriberGenerator::registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e) +{ + //we don't want any code for constructor and destructor + e.registerCallback(_pStruct->name(), &EventSubscriberGenerator::constructorCodeGen); + e.registerCallback("~"+_pStruct->name(), &Poco::CodeGeneration::GeneratorEngine::emptyCodeGen); + e.registerCallback("remoting__typeId", &EventSubscriberGenerator::typeIdCodeGen); + e.registerPostClassCallback(&EventSubscriberGenerator::staticMembersInitializer); +} + + +std::vector EventSubscriberGenerator::newBaseClasses(const Poco::CppParser::Struct* pStruct) +{ + std::vector bases; + bases.push_back("Poco::RemotingNG::EventSubscriber"); + return bases; +} + + +void EventSubscriberGenerator::constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + EventSubscriberGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + + gen.writeMethodImplementation("using namespace std::string_literals;\n"); + + EventSubscriberGenerator::MethodHandlers::const_iterator it = pGen->_methodHandlers.begin(); + EventSubscriberGenerator::MethodHandlers::const_iterator itEnd = pGen->_methodHandlers.end(); + for (; it != itEnd; ++it) + { + // add: addMethodHandler("create", new TransportManagerCreateMethodHandler()); + std::string codeLine("addMethodHandler(\""); + codeLine.append(it->first); + codeLine.append("\"s, new "); + codeLine.append(it->second->fullName()); + codeLine.append("(pProxy));"); + gen.writeMethodImplementation(codeLine); + } +} + + +void EventSubscriberGenerator::invokeCodeGen(const Poco::CppParser::Function* pFuncNew, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + EventSubscriberGenerator* pGen = dynamic_cast(pAGen); + const Poco::CppParser::Function* pFunc = pGen->getCurrentFct(); + poco_check_ptr(pFunc); + bool isEvent = pGen->_isEvent; + + gen.writeMethodImplementation("using namespace std::string_literals;\n"); + + ProxyGenerator::OrderedParameters attrs; + ProxyGenerator::OrderedParameters elems; + std::set nsSet; + ProxyGenerator::doElemAttrSplit(pFunc, attrs, elems, nsSet); + std::map nsIdx; + //static const std::string REMOTING__NAMES[] = {"create"s, "protocol"s, "endPoint"s}; // methodName followed by param names, followed by other than default namespaces + std::string staticIds = ProxyGenerator::generateStaticIdString(pFunc, nsSet, attrs, elems, nsIdx); + gen.writeMethodImplementation(staticIds); + std::map outParams; + ProxyGenerator::detectOutParams(pFunc, outParams); + + Poco::CppParser::Parameter retParam(pFunc->getReturnParameter() + " dummy", 0); + bool hasReturnParam = pFunc->getReturnParameter() != Poco::CodeGeneration::Utility::TYPE_VOID && !pFunc->getReturnParameter().empty(); + bool isOneWay = (outParams.empty() && !hasReturnParam) || pGen->currentFctHasOneWayProperty(); + std::string indentation; + if (!isOneWay) + { + gen.writeMethodImplementation("bool remoting__requestSucceeded = false;"); + gen.writeMethodImplementation("try"); + gen.writeMethodImplementation("{"); + indentation = "\t"; + } + + // now create for each method variable a placeholder where we can deserialize data to + // be sure to check for ifacetypes! + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + for (; it != itEnd; ++it) + { + const Poco::CppParser::Parameter* pParam = *it; + std::string fullDeclType(Utility::resolveType(pGen->_pStructIn, pParam->declType())); + poco_assert (!pParam->isPointer()); + gen.writeMethodImplementation(indentation+fullDeclType + " " + (*it)->name()+";"); + } + // now deserialize the individual entries + writePrepareAttribute(pGen, attrs, indentation, gen); + CodeGenerator::Properties funcProps; + GeneratorEngine::parseProperties(pFunc, funcProps); + + // push soapHeader attributes + ProxyGenerator::OrderedParameters::const_iterator itElem = elems.begin(); + ProxyGenerator::OrderedParameters::const_iterator itElemEnd = elems.end(); + for (; itElem != itElemEnd; ++itElem) + { + std::string elemStr; + GeneratorEngine::getStringProperty(funcProps, "$" + itElem->second.varName, elemStr); + if (!elemStr.empty()) + { + CodeGenerator::Properties elemProps; + GeneratorEngine::parseElementProperties(elemStr, elemProps); + std::string header; + GeneratorEngine::getStringProperty(elemProps, GenUtility::ATTR_HEADER, header); + Poco::toLowerInPlace(header); + if (elemProps.find(GenUtility::ATTR_HEADER) != elemProps.end() && (header.empty() || header == "true")) + { + std::string code("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_HEADER, "); + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itElem->second.namePos)); + code.append("]);"); + gen.writeMethodImplementation(indentation+code); + } + } + } + + std::string messageType(isEvent ? "EVENT" : "REQUEST"); + gen.writeMethodImplementation(indentation+"remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + + writeTypeDeserializers(pFunc, attrs, indentation, gen); + writeTypeDeserializers(pFunc, elems, indentation, gen); + + gen.writeMethodImplementation(indentation+"remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + + // now get the pRemoteObject and static_cast it to the required RemoteObject subclass + std::string fN = pStruct->fullName(); + size_t pos = fN.rfind("::"); + std::string ns; + if (pos != std::string::npos) + ns = fN.substr(0, pos); + + std::string invokeLine; + if (hasReturnParam) + { + std::string fullDeclType(Poco::CodeGeneration::Utility::resolveType(pGen->_pStructIn, retParam.declType())); + invokeLine = fullDeclType + " ret = "; + } + // now add the call to the method + if (isOneWay) + { + gen.writeMethodImplementation(indentation+"try"); + gen.writeMethodImplementation(indentation+"{"); + } + invokeLine.append("_pProxy->"); + FunctionToEvent::const_iterator itFE = pGen->_events.find(pFunc->name()); + if (itFE != pGen->_events.end()) + { + invokeLine.append(itFE->second); + } + else + invokeLine.append(pFunc->name()); //??? or exception: no the same code is used by functions too! + // write single params + it = pFunc->begin(); + itEnd = pFunc->end(); + + if (it == itEnd) // voidEvent + invokeLine.append("(nullptr"); + else + invokeLine.append("(nullptr, "); // nullptr because it came from the network + + for (; it != itEnd; ++it) + { + invokeLine.append((*it)->name()); + Poco::CppParser::Function::Iterator itBeforeEnd = itEnd; + --itBeforeEnd; + if (it != itBeforeEnd) + invokeLine.append(", "); + } + + invokeLine.append(");"); + if (isOneWay) + { + gen.writeMethodImplementation(indentation+"\t"+invokeLine); + gen.writeMethodImplementation(indentation+"}"); + gen.writeMethodImplementation(indentation+"catch (...)"); + gen.writeMethodImplementation(indentation+"{"); + gen.writeMethodImplementation(indentation+"}"); + } + else + gen.writeMethodImplementation(indentation+invokeLine); + + if (!isOneWay) + { + gen.writeMethodImplementation(indentation+"remoting__requestSucceeded = true;"); + + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pFunc->nameSpace(), structProps); + CodeGenerator::Properties funcProps(structProps); + GeneratorEngine::parseProperties(pFunc, funcProps); + std::string structDefaultNS; + GeneratorEngine::getStringProperty(structProps, Utility::NAMESPACE, structDefaultNS); + std::string funcDefaultNS(structDefaultNS); + GeneratorEngine::getStringProperty(funcProps, Utility::NAMESPACE, funcDefaultNS); + int funcNsIdx = -1; + gen.writeMethodImplementation(indentation+"Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_REPLY);"); + if (!funcDefaultNS.empty()) + { + if (funcDefaultNS == structDefaultNS) + gen.writeMethodImplementation(indentation+"remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, " + EventSubscriberGenerator::generateClassName(pGen->_pStructIn) +"::DEFAULT_NS);"); + else + { + std::map::const_iterator itNS = nsIdx.find(funcDefaultNS); + poco_assert_dbg (itNS != nsIdx.end()); + std::string code("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, REMOTING__NAMES["); + funcNsIdx = itNS->second; + code.append(Poco::NumberFormatter::format(itNS->second)); + code.append("]);"); + gen.writeMethodImplementation(indentation+code); + } + } + + // write attrs before serializeRequest + writePushAttributes(pGen, pFunc, attrs, outParams, indentation, gen); + // push soapHeader attributes + + ProxyGenerator::OrderedParameters::const_iterator itElem = elems.begin(); + ProxyGenerator::OrderedParameters::const_iterator itElemEnd = elems.end(); + for (; itElem != itElemEnd; ++itElem) + { + std::string elemStr; + GeneratorEngine::getStringProperty(funcProps, "$" + itElem->second.varName, elemStr); + if (!elemStr.empty()) + { + CodeGenerator::Properties elemProps; + GeneratorEngine::parseElementProperties(elemStr, elemProps); + bool header = false; + GeneratorEngine::getBoolProperty(elemProps, GenUtility::ATTR_HEADER, header); + if (header) + { + std::string code("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_HEADER, "); + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itElem->second.namePos)); + code.append("]);"); + gen.writeMethodImplementation(indentation+code); + } + } + } + + std::string name(GenUtility::getMethodName(pFunc)); + std::string responseName(GenUtility::getReplyMethodName(pFunc)); + std::string messageType(isEvent ? "EVENT_REPLY" : "REPLY"); + if (name != responseName) + { + gen.writeMethodImplementation(indentation+"static const std::string REMOTING__REPLY_NAME(\"" + responseName + "\");"); + gen.writeMethodImplementation(indentation+"remoting__ser.serializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + else + { + gen.writeMethodImplementation(indentation+"remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + + // write first the attrs, then the return param, then the other out params + + writeTypeSerializer(pFunc, attrs, outParams, indentation, true, funcNsIdx, gen); + + std::string serLine("Poco::RemotingNG::TypeSerializer<"); + if (hasReturnParam) + { + std::string retType(Poco::CodeGeneration::Utility::resolveType(pGen->_pStructIn, retParam.declType())); + std::string retName (GenUtility::getReturnParameterName(pFunc)); + if (retName != Poco::RemotingNG::SerializerBase::RETURN_PARAM) + { + // static const std::string REMOTING__RETURN_PARAM_NAME("$retName") + std::string line("static const std::string REMOTING__RETURN_PARAM_NAME(\""); + line.append(retName); + line.append("\");"); + gen.writeMethodImplementation(indentation+line); + retName = "REMOTING__RETURN_PARAM_NAME"; + } + else + retName = "Poco::RemotingNG::SerializerBase::RETURN_PARAM"; + bool doInline = GenUtility::getInlineReturnParam(pFunc); + if (doInline) + gen.writeMethodImplementation(indentation+serLine + retType +">::serializeImpl("+retName+", ret, remoting__ser);"); + else + gen.writeMethodImplementation(indentation+serLine + retType +">::serialize("+retName+", ret, remoting__ser);"); + } + + writeTypeSerializer(pFunc, elems, outParams, indentation, false, funcNsIdx, gen); + if (name != responseName) + { + gen.writeMethodImplementation(indentation+"remoting__ser.serializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + else + { + gen.writeMethodImplementation(indentation+"remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + + gen.writeMethodImplementation("}"); + gen.writeMethodImplementation("catch (Poco::Exception& e)"); + gen.writeMethodImplementation("{"); + // don't catch errors which happen during serializing data back to the caller + gen.writeMethodImplementation(indentation+"if (!remoting__requestSucceeded)"); + gen.writeMethodImplementation(indentation+"{"); + gen.writeMethodImplementation(indentation+"\tPoco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT);"); + gen.writeMethodImplementation(indentation+"\tremoting__ser.serializeFaultMessage(REMOTING__NAMES[0], e);"); + gen.writeMethodImplementation(indentation+"}"); + gen.writeMethodImplementation("}"); + gen.writeMethodImplementation("catch (std::exception& e)"); + gen.writeMethodImplementation("{"); + // don't catch errors which happen during serializing data back to the caller + gen.writeMethodImplementation(indentation+"if (!remoting__requestSucceeded)"); + gen.writeMethodImplementation(indentation+"{"); + gen.writeMethodImplementation(indentation+"\tPoco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT);"); + gen.writeMethodImplementation(indentation+"\tPoco::Exception exc(e.what());"); + gen.writeMethodImplementation(indentation+"\tremoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc);"); + gen.writeMethodImplementation(indentation+"}"); + gen.writeMethodImplementation("}"); + gen.writeMethodImplementation("catch (...)"); + gen.writeMethodImplementation("{"); + // don't catch errors which happen during serializing data back to the caller + gen.writeMethodImplementation(indentation+"if (!remoting__requestSucceeded)"); + gen.writeMethodImplementation(indentation+"{"); + gen.writeMethodImplementation(indentation+"\tPoco::RemotingNG::Serializer& remoting__ser = remoting__trans.sendReply(Poco::RemotingNG::SerializerBase::MESSAGE_FAULT);"); + gen.writeMethodImplementation(indentation+"\tPoco::Exception exc(\"Unknown Exception\");"); + gen.writeMethodImplementation(indentation+"\tremoting__ser.serializeFaultMessage(REMOTING__NAMES[0], exc);"); + gen.writeMethodImplementation(indentation+"}"); + gen.writeMethodImplementation("}"); + } +} + + +void EventSubscriberGenerator::mhctorCodeGen(const Poco::CppParser::Function* pFuncNew, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + // FIXME: the following should actually be done using + // constructor member variable initialization syntax. + // Due to a bug in the code generator, this does not work, + // so we do it in the constructor body. + gen.writeMethodImplementation("_pProxy = pProxy;"); +} + + +void EventSubscriberGenerator::writePushAttributes(EventSubscriberGenerator* pGen, + const Poco::CppParser::Function* pFunc, + const ProxyGenerator::OrderedParameters& attrs, + const std::map& outParams, + const std::string& indentation, + CodeGenerator& gen) +{ + ProxyGenerator::OrderedParameters::const_iterator itOP = attrs.begin(); + ProxyGenerator::OrderedParameters::const_iterator itOPEnd = attrs.end(); + for (; itOP != itOPEnd; ++itOP) + { + poco_check_ptr (itOP->second.pParam); + const Poco::CppParser::Parameter* pParam = itOP->second.pParam; + std::map::const_iterator itD = outParams.find(pParam->name()); + if (itD != outParams.end()) + { + //ser.pushAttribute(ns, name); + std::string code("remoting__ser.pushAttribute("); + if (itOP->second.nameSpacePos < 0) + { + code.append(EventSubscriberGenerator::generateClassName(pGen->_pStructIn) +"::DEFAULT_NS, "); + } + else + { + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itOP->second.nameSpacePos)); + code.append("], "); + } + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itOP->second.namePos)); + code.append("]);"); + gen.writeMethodImplementation(indentation+code); + } + } +} + + +void EventSubscriberGenerator::writePrepareAttribute(EventSubscriberGenerator* pGen, const ProxyGenerator::OrderedParameters& attrs, const std::string& indentation, CodeGenerator& gen) +{ + ProxyGenerator::OrderedParameters::const_iterator itAttrs = attrs.begin(); + ProxyGenerator::OrderedParameters::const_iterator itAttrsEnd = attrs.end(); + for (; itAttrs != itAttrsEnd; ++itAttrs) + { + //deser.pushAttribute(ns, name, bool) + std::string code("remoting__deser.pushAttribute("); + if (itAttrs->second.nameSpacePos < 0) + { + code.append(EventSubscriberGenerator::generateClassName(pGen->_pStructIn) +"::DEFAULT_NS, "); + } + else + { + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itAttrs->second.nameSpacePos)); + code.append("], "); + } + + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itAttrs->second.namePos)); + code.append("], "); + + if (itAttrs->second.mandatory) + code.append("true);"); + else + code.append("false);"); + + gen.writeMethodImplementation(indentation+code); + } +} + + +void EventSubscriberGenerator::writeTypeDeserializers(const Poco::CppParser::Function* pFunc, + const ProxyGenerator::OrderedParameters& params, + const std::string& indentation, + CodeGenerator& gen) +{ + std::string deserPre("Poco::RemotingNG::TypeDeserializer<"); + ProxyGenerator::OrderedParameters::const_iterator itOP = params.begin(); + ProxyGenerator::OrderedParameters::const_iterator itOPEnd = params.end(); + + for (; itOP != itOPEnd; ++itOP) + { + poco_check_ptr (itOP->second.pParam); + if (itOP->second.direction != "out") + { + const Poco::CppParser::Parameter* pParam = itOP->second.pParam; + std::string retType(Utility::resolveType(pFunc->nameSpace(), pParam->declType())); + std::string cntStr(Poco::NumberFormatter::format(itOP->second.namePos)); + Poco::CppParser::Symbol* pSym = pFunc->nameSpace()->lookup(retType); + bool enumMode = false; + std::string enumBaseType; + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_ENUM) + { + enumMode = true; + enumBaseType = static_cast(pSym)->baseType(); + if (enumBaseType.empty()) enumBaseType = "int"; + } + std::string codeLine(deserPre); + if (enumMode) + codeLine += enumBaseType; + else + codeLine += retType; + codeLine.append(">::deserialize(REMOTING__NAMES["); + codeLine.append(cntStr); + codeLine.append("], "); + if (itOP->second.mandatory) + codeLine.append("true, "); + else + codeLine.append("false, "); + codeLine.append("remoting__deser, "); + if (enumMode) + { + gen.writeMethodImplementation(Poco::format("%s%s remoting__%sTmp;", indentation, enumBaseType, itOP->second.varName)); + codeLine.append("remoting__" + itOP->second.varName + "Tmp"); + } + else + { + codeLine.append(itOP->second.varName); + } + codeLine.append(");"); + gen.writeMethodImplementation(indentation+codeLine); + if (enumMode) + { + gen.writeMethodImplementation(indentation + itOP->second.varName + " = static_cast<" + retType + ">(remoting__" + itOP->second.varName + "Tmp);"); + } + } + } +} + + +void EventSubscriberGenerator::writeTypeSerializer(const Poco::CppParser::Function* pFunc, + const ProxyGenerator::OrderedParameters& params, + const std::map& outParams, + const std::string& indentation, + bool isAttr, + int funcNsIdx, + CodeGenerator& gen) +{ + ProxyGenerator::OrderedParameters::const_iterator itOP = params.begin(); + ProxyGenerator::OrderedParameters::const_iterator itOPEnd = params.end(); + int lastNS = funcNsIdx; + for (; itOP != itOPEnd; ++itOP) + { + poco_check_ptr (itOP->second.pParam); + const Poco::CppParser::Parameter* pParam = itOP->second.pParam; + std::map::const_iterator itD = outParams.find(pParam->name()); + if (itD != outParams.end()) + { + if (!isAttr && lastNS != itOP->second.nameSpacePos) + { + if (lastNS != funcNsIdx) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE);"); + } + std::string code("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itOP->second.nameSpacePos)); + code.append("]);"); + gen.writeMethodImplementation(indentation+code); + lastNS = itOP->second.nameSpacePos; + } + std::string serLine("Poco::RemotingNG::TypeSerializer<"); + std::string type(Utility::resolveType(pFunc->nameSpace(), itOP->second.pParam->declType())); + Poco::CppParser::Symbol* pSym = pFunc->nameSpace()->lookup(type); + bool enumMode = false; + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_ENUM) + { + enumMode = true; + type = "int"; + } + + serLine.append(type); + + if (itOP->second.pParam->isPointer()) + serLine.append("*"); + serLine.append(">::serialize(REMOTING__NAMES["); + + serLine.append(Poco::NumberFormatter::format(itOP->second.namePos)); + serLine.append("], "); + if (enumMode) + { + serLine.append("(int)"); + serLine.append(itOP->second.varName); + } + else + { + serLine.append(itOP->second.varName); + } + serLine.append(", remoting__ser);"); + gen.writeMethodImplementation(indentation+serLine); + } + } + if (!isAttr && lastNS != funcNsIdx) + { + gen.writeMethodImplementation(indentation+"remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE);"); + } +} + + +void EventSubscriberGenerator::staticMembersInitializer(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + std::string code("const std::string "); + code.append(pStruct->name()); + code.append("::DEFAULT_NS(\""); + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pStruct, structProps); + std::string defNS; + GeneratorEngine::getStringProperty(structProps, Utility::NAMESPACE, defNS); + code.append(defNS); + code.append("\");"); + gen.writeImplementation(code); +} + + +void EventSubscriberGenerator::checkForEventMembers(const Poco::CppParser::Struct* pStruct, std::vector& eventFunctions, const CodeGenerator::Properties& properties) +{ + checkForEventMembersImpl(pStruct, eventFunctions, properties); + + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + for (; itB != itBEnd; ++itB) + { + const Poco::CppParser::Struct* pParent = itB->pClass; + if (pParent && Utility::hasAnyRemoteProperty(pParent)) + { + Poco::CodeGeneration::CodeGenerator::Properties parentProperties; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pParent, parentProperties); + checkForEventMembers(pParent, eventFunctions, parentProperties); + } + } +} + + +void EventSubscriberGenerator::checkForEventMembersImpl(const Poco::CppParser::Struct* pStruct, std::vector& eventFunctions, const CodeGenerator::Properties& properties) +{ + bool events = false; + Poco::CppParser::NameSpace::SymbolTable tbl; + pStruct->variables(tbl); + Poco::CppParser::NameSpace::SymbolTable::const_iterator it = tbl.begin(); + Poco::CppParser::NameSpace::SymbolTable::const_iterator itEnd = tbl.end(); + for (; it != itEnd; ++it) + { + Poco::CppParser::Variable* pVar = static_cast(it->second); + Poco::CodeGeneration::CodeGenerator::Properties eventProperties(properties); + Poco::CodeGeneration::GeneratorEngine::parseProperties(pVar, eventProperties); + if (GenUtility::isRemoteEvent(pVar, eventProperties)) + { + events = true; + _cppGen.addSrcIncludeFile("Poco/Delegate.h"); + // generate a serializer method for that member too + // call methodStart(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& methodProperties) + // convert the basicevent to a private function + std::string funcDecl("void "); + std::string fctName = ProxyGenerator::generateEventFunctionName(pVar->name()); + funcDecl.append(fctName); + _events.insert(std::make_pair(fctName, pVar->name())); + std::vector templTypes = GenUtility::getResolvedInnerTemplateTypes(pStruct, pVar->declType()); + if (templTypes.size() != 1) + throw Poco::InvalidArgumentException("Illegal remote event param: " + pVar->fullName()); + std::string paramDecl = templTypes[0]; + if (paramDecl != "void") + { + paramDecl.append("& data"); + } + { + Poco::CppParser::Function* pFunc = new Poco::CppParser::Function(funcDecl, _pStruct); + if (paramDecl != "void") + { + Poco::CppParser::Parameter* pParam = new Poco::CppParser::Parameter(paramDecl, 0); + pFunc->addParameter(pParam); + } + Poco::CppParser::Attributes funcAttr; + const Poco::CppParser::Attributes& varAttr = pVar->getAttributes(); + // we have one single parameter, this one defines the name of the function! + funcAttr.set("inline", "true"); + funcAttr.set("event", "true"); + if (varAttr.has("name")) + { + funcAttr.set("name", varAttr.getString("name")); + } + else + { + funcAttr.set("name", pVar->name()); + } + if (varAttr.has("oneway")) + { + std::string oneVal = varAttr.getString("oneway"); + funcAttr.set("oneway", oneVal); + } + pFunc->setAttributes(funcAttr); + pFunc->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + + includeTypeSerializers(pFunc, false, false); + eventFunctions.push_back(pFunc); + } + } + } + + if (events) + { + Poco::Path file (Poco::CodeGeneration::Utility::createInclude(_pStruct, true)); + + std::string newFileName = ProxyGenerator::generateClassName(_pStructIn); + file.setBaseName(newFileName); + std::string inclFile = file.toString(Poco::Path::PATH_UNIX); + _cppGen.addIncludeFile(inclFile); + } +} diff --git a/RemotingNG/RemoteGen/src/EventSubscriberGenerator.h b/RemotingNG/RemoteGen/src/EventSubscriberGenerator.h new file mode 100644 index 0000000000..698ce28c44 --- /dev/null +++ b/RemotingNG/RemoteGen/src/EventSubscriberGenerator.h @@ -0,0 +1,126 @@ +// +// EventSubscriberGenerator.h +// +// Definition of the EventSubscriberGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef RemoteGen_EventSubscriberGenerator_INCLUDED +#define RemoteGen_EventSubscriberGenerator_INCLUDED + + +#include "AbstractGenerator.h" +#include "ProxyGenerator.h" +#include "Poco/CodeGeneration/CppGenerator.h" +#include + + +class EventSubscriberGenerator: public AbstractGenerator + /// EventSubscriberGenerator generates a proxy for a given class definition. C++ specific. +{ +public: + + EventSubscriberGenerator(Poco::CodeGeneration::CppGenerator& cppGen); + /// Creates the EventSubscriberGenerator. + + ~EventSubscriberGenerator(); + /// Destroys the EventSubscriberGenerator. + + static std::string generateClassName(const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + static std::string generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// Must not write the namespace + + void structEnd(); + + void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Writes the method header. Properties contains the properties found in the functions docuementation and in the class documentation. + + void registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e); + + std::string newClassName(const Poco::CppParser::Struct* pStruct); + /// generates the new class name based on the old one + + std::vector newBaseClasses(const Poco::CppParser::Struct* pStruct); + +private: + void checkForEventMembers(const Poco::CppParser::Struct* pStruct, std::vector& eventFunctions, const CodeGenerator::Properties& properties); + /// checks if the class or any parent contains public BasicEvents + + void checkForEventMembersImpl(const Poco::CppParser::Struct* pStruct, std::vector& eventFunctions, const CodeGenerator::Properties& properties); + + void generateEventFunction(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + + const Poco::CppParser::Function* getCurrentFct() const; + bool currentFctHasOneWayProperty() const; + + static void constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void invokeCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void mhctorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static void staticMembersInitializer(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void writePrepareAttribute(EventSubscriberGenerator* pGen, const ProxyGenerator::OrderedParameters& attrs, const std::string& indentation, CodeGenerator& gen); + static void writeTypeSerializer(const Poco::CppParser::Function* pFunc, + const ProxyGenerator::OrderedParameters& params, + const std::map& outParams, + const std::string& indentation, + bool isAttr, + int funcNsIdx, + CodeGenerator& gen); + + static void writePushAttributes(EventSubscriberGenerator* pGen, + const Poco::CppParser::Function* pFunc, + const ProxyGenerator::OrderedParameters& attrs, + const std::map& outParams, + const std::string& indentation, + CodeGenerator& gen); + + static void writeTypeDeserializers(const Poco::CppParser::Function* pFunc, + const ProxyGenerator::OrderedParameters& params, + const std::string& indentation, + CodeGenerator& gen); + +private: + typedef std::map MethodHandlers; + typedef std::map FunctionToEvent; + + const Poco::CppParser::Function* _pCurrent; + bool _currentFctOneWayProperty; + bool _isEvent; + MethodHandlers _methodHandlers; + FunctionToEvent _events; +}; + + +// +// inlines +// +inline std::string EventSubscriberGenerator::newClassName(const Poco::CppParser::Struct* pStruct) +{ + return EventSubscriberGenerator::generateClassName(pStruct); +} + + +inline const Poco::CppParser::Function* EventSubscriberGenerator::getCurrentFct() const +{ + poco_assert (_pCurrent); + return _pCurrent; +} + + +inline bool EventSubscriberGenerator::currentFctHasOneWayProperty() const +{ + return _currentFctOneWayProperty; +} + + +#endif // RemoteGen_EventSubscriberGenerator_INCLUDED diff --git a/RemotingNG/RemoteGen/src/ExtensionsGenerator.cpp b/RemotingNG/RemoteGen/src/ExtensionsGenerator.cpp new file mode 100644 index 0000000000..2c1c67e3c6 --- /dev/null +++ b/RemotingNG/RemoteGen/src/ExtensionsGenerator.cpp @@ -0,0 +1,44 @@ +// +// ExtensionsGenerator.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "ExtensionsGenerator.h" + + +ExtensionsGenerator::ExtensionsGenerator(std::ostream& out): + _out(out) +{ +} + + +ExtensionsGenerator::~ExtensionsGenerator() +{ +} + + +void ExtensionsGenerator::generate(const std::vector& bundleServices) +{ + _out << "" << std::endl; + _out << "\t" << std::endl; + + std::vector::const_iterator it = bundleServices.begin(); + for (; it != bundleServices.end(); ++it) + { + if (it->clientCode) + { + _out << "\tpStruct->name() << "\" "; + _out << "serviceLocation=\"http://localhost:22080/soap/"; + _out << it->pStruct->name(); + _out << "/The" << it->pStruct->name() << "\"/>" << std::endl; + } + } + _out << "" << std::endl; +} diff --git a/RemotingNG/RemoteGen/src/ExtensionsGenerator.h b/RemotingNG/RemoteGen/src/ExtensionsGenerator.h new file mode 100644 index 0000000000..6382173281 --- /dev/null +++ b/RemotingNG/RemoteGen/src/ExtensionsGenerator.h @@ -0,0 +1,39 @@ +// +// ExtensionsGenerator.h +// +// Definition of the ExtensionsGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef RemoteGen_ExtensionsGenerator_INCLUDED +#define RemoteGen_ExtensionsGenerator_INCLUDED + + +#include "BundleActivatorGenerator.h" +#include +#include + + +class ExtensionsGenerator + /// ExtensionsGenerator generates an extesions.xml file +{ +public: + ExtensionsGenerator(std::ostream& out); + /// Creates the ExtensionsGenerator. + + ~ExtensionsGenerator(); + /// Destroys the ExtensionsGenerator. + + void generate(const std::vector& bundleServices); + +private: + std::ostream& _out; +}; + + +#endif // RemoteGen_ExtensionsGenerator_INCLUDED diff --git a/RemotingNG/RemoteGen/src/GenUtility.cpp b/RemotingNG/RemoteGen/src/GenUtility.cpp new file mode 100644 index 0000000000..2452b17de3 --- /dev/null +++ b/RemotingNG/RemoteGen/src/GenUtility.cpp @@ -0,0 +1,592 @@ +// +// GenUtility.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "GenUtility.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CppParser/Symbol.h" +#include "Poco/CppParser/TypeDef.h" +#include "Poco/Exception.h" +#include "Poco/String.h" +#include "Poco/NumberParser.h" +#include "Poco/Ascii.h" +#include +#include + + +POCO_IMPLEMENT_EXCEPTION(CodeGenerationException, Poco::ApplicationException, "Code generation error") + + +const std::string GenUtility::ATTR_INLINE("inline"); +const std::string GenUtility::ATTR_NAME("name"); +const std::string GenUtility::ATTR_REPLYNAME("replyName"); +const std::string GenUtility::VAL_REQUEST("Request"); +const std::string GenUtility::VAL_REPLY("Reply"); +const std::string GenUtility::ATTR_RETURN("return"); +const std::string GenUtility::ATTR_HEADER("header"); +const std::string GenUtility::KEYS_VECTOR[KEYS_VECTOR_SIZE] = {"std::vector", "std::set", "std::multiset", "std::unordered_set", "std::unordered_multiset", "std::list", "std::array", "Poco::Array"}; +const std::string GenUtility::KEYS_UNIQUE_VECTOR[KEYS_UNIQUE_VECTOR_SIZE] = {"std::set", "std::unordered_set"}; + + +bool GenUtility::isRemoteMethod(const Poco::CppParser::Function* pFunc, const Poco::CodeGeneration::CodeGenerator::Properties& properties) +{ + if (!pFunc->isDefault() && !pFunc->isDeleted() && !pFunc->isStatic() && pFunc->isPublic()) + { + bool remote = false; + return (Poco::CodeGeneration::GeneratorEngine::getBoolProperty(properties, Poco::CodeGeneration::Utility::REMOTE, remote) && remote); + } + else return false; +} + + +bool GenUtility::isRemoteEvent(const Poco::CppParser::Variable* pVar, const Poco::CodeGeneration::CodeGenerator::Properties& properties) +{ + if (pVar->isPublic() && !pVar->isStatic()) + { + const std::string& varType = pVar->declType(); + if (varType.find("Poco::BasicEvent") == 0 || varType.find("Poco::FIFOEvent") == 0) + { + bool remote = false; + return (Poco::CodeGeneration::GeneratorEngine::getBoolProperty(properties, Poco::CodeGeneration::Utility::REMOTE, remote) && remote); + } + } + return false; +} + + +std::string GenUtility::getMethodName(const Poco::CppParser::Function* pFunc) +{ + Poco::CodeGeneration::CodeGenerator::Properties funcProps; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, funcProps); + std::string aName(pFunc->name()); + Poco::CodeGeneration::GeneratorEngine::getStringProperty(funcProps, GenUtility::ATTR_NAME, aName); + return aName; +} + + +std::string GenUtility::getRequestMethodName(const Poco::CppParser::Function* pFunc) +{ + Poco::CodeGeneration::CodeGenerator::Properties funcProps; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, funcProps); + std::string aName(pFunc->name()); + std::string replyName(aName+GenUtility::VAL_REQUEST); + Poco::CodeGeneration::GeneratorEngine::getStringProperty(funcProps, GenUtility::ATTR_REPLYNAME, replyName); + return replyName; +} + + +std::string GenUtility::getReplyMethodName(const Poco::CppParser::Function* pFunc) +{ + Poco::CodeGeneration::CodeGenerator::Properties funcProps; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, funcProps); + std::string aName(pFunc->name()); + Poco::CodeGeneration::GeneratorEngine::getStringProperty(funcProps, GenUtility::ATTR_NAME, aName); + std::string replyName(aName+GenUtility::VAL_REPLY); + Poco::CodeGeneration::GeneratorEngine::getStringProperty(funcProps, GenUtility::ATTR_REPLYNAME, replyName); + return replyName; +} + + +std::string GenUtility::getParameterName(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Parameter* pParam) +{ + Poco::CodeGeneration::CodeGenerator::Properties funcProps; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, funcProps); + std::string name(pParam->name()); + std::string elemStr; + bool found = Poco::CodeGeneration::GeneratorEngine::getStringProperty(funcProps, "$" + pParam->name(), elemStr); + if (found && !elemStr.empty()) + { + Poco::CodeGeneration::CodeGenerator::Properties elemProps; + Poco::CodeGeneration::GeneratorEngine::parseElementProperties(elemStr, elemProps); + Poco::CodeGeneration::GeneratorEngine::getStringProperty(elemProps, GenUtility::ATTR_NAME, name); + } + return name; +} + + +std::string GenUtility::getVariableName(const Poco::CppParser::Variable* pVar) +{ + Poco::CodeGeneration::CodeGenerator::Properties props; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pVar, props); + Poco::CodeGeneration::CodeGenerator::Properties::const_iterator itName = props.find(GenUtility::ATTR_NAME); + std::string result; + if (itName != props.end()) + { + result = itName->second; + } + else + { + result = cleanVariableName(pVar->name()); + } + + return result; +} + + +Poco::UInt32 GenUtility::getVariableOrder(const Poco::CppParser::Variable* pVar, Poco::UInt32 defValue) +{ + Poco::CodeGeneration::CodeGenerator::Properties props; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pVar, props); + Poco::CodeGeneration::GeneratorEngine::getUInt32Property(props, Poco::CodeGeneration::Utility::ORDER, defValue); + + return defValue; +} + + +Poco::UInt32 GenUtility::getParameterOrder(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Parameter* pParam, Poco::UInt32 defValue) +{ + Poco::CodeGeneration::CodeGenerator::Properties funcProps; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, funcProps); + std::string elemStr; + bool found = Poco::CodeGeneration::GeneratorEngine::getStringProperty(funcProps, "$" + pParam->name(), elemStr); + if (found && !elemStr.empty()) + { + Poco::CodeGeneration::CodeGenerator::Properties elemProps; + Poco::CodeGeneration::GeneratorEngine::parseElementProperties(elemStr, elemProps); + Poco::CodeGeneration::GeneratorEngine::getUInt32Property(elemProps, Poco::CodeGeneration::Utility::ORDER, defValue); + } + + return defValue; +} + + +bool GenUtility::getIsMandatory(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Parameter* pParam) +{ + bool isMandatory = true; + Poco::CodeGeneration::CodeGenerator::Properties funcProps; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, funcProps); + std::string elemStr; + bool found = Poco::CodeGeneration::GeneratorEngine::getStringProperty(funcProps, "$" + pParam->name(), elemStr); + if (found && !elemStr.empty()) + { + Poco::CodeGeneration::CodeGenerator::Properties elemProps; + Poco::CodeGeneration::GeneratorEngine::parseElementProperties(elemStr, elemProps); + isMandatory = getIsMandatory(elemProps); + } + return isMandatory; +} + + +bool GenUtility::getIsMandatory(const Poco::CppParser::Variable* pVar) +{ + Poco::CodeGeneration::CodeGenerator::Properties props; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pVar, props); + return getIsMandatory(props); +} + + +bool GenUtility::getIsMandatory(const Poco::CodeGeneration::CodeGenerator::Properties& props) +{ + bool isMandatory = true; + if (!Poco::CodeGeneration::GeneratorEngine::getBoolProperty(props, Poco::CodeGeneration::Utility::MANDATORY, isMandatory)) + { + bool isOptional = !isMandatory; + if (Poco::CodeGeneration::GeneratorEngine::getBoolProperty(props, Poco::CodeGeneration::Utility::OPTIONAL, isOptional)) + { + isMandatory = !isOptional; + } + } + return isMandatory; +} + + +bool GenUtility::getIsInHeader(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Parameter* pParam) +{ + bool soapHeader = false; + Poco::CodeGeneration::CodeGenerator::Properties funcProps; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, funcProps); + std::string elemStr; + bool found = Poco::CodeGeneration::GeneratorEngine::getStringProperty(funcProps, "$" + pParam->name(), elemStr); + if (found && !elemStr.empty()) + { + Poco::CodeGeneration::CodeGenerator::Properties elemProps; + Poco::CodeGeneration::GeneratorEngine::parseElementProperties(elemStr, elemProps); + Poco::CodeGeneration::GeneratorEngine::getBoolProperty(elemProps, ATTR_HEADER, soapHeader); + } + + return soapHeader; +} + + +std::string GenUtility::cleanVariableName(const std::string& origName) +{ + std::string result; + std::size_t pos = origName.find("_"); + if (pos != std::string::npos) + { + // is it at end or at the beginning? + if (pos == (origName.size()-1)) + { + result = origName.substr(0, pos); + } + else if (pos == 0 || (pos == 1 && origName[0] == 'm')) + { + // at beginning + result = origName.substr(pos+1); + } + else + result = origName; + } + else + result = origName; + + return result; +} + + +std::string GenUtility::getReturnParameterName(const Poco::CppParser::Function* pFunc) +{ + Poco::CodeGeneration::CodeGenerator::Properties funcProps; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, funcProps); + std::string name(GenUtility::ATTR_RETURN); + std::string elemStr; + bool found = Poco::CodeGeneration::GeneratorEngine::getStringProperty(funcProps, GenUtility::ATTR_RETURN, elemStr); + if (found && !elemStr.empty()) + { + Poco::CodeGeneration::CodeGenerator::Properties elemProps; + Poco::CodeGeneration::GeneratorEngine::parseElementProperties(elemStr, elemProps); + Poco::CodeGeneration::GeneratorEngine::getStringProperty(elemProps, GenUtility::ATTR_NAME, name); + } + return name; +} + + +bool GenUtility::getInlineReturnParam(const Poco::CppParser::Function* pFunc) +{ + Poco::CodeGeneration::CodeGenerator::Properties funcProps; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, funcProps); + bool doInline = false; + std::string elemStr; + bool found = Poco::CodeGeneration::GeneratorEngine::getStringProperty(funcProps, GenUtility::ATTR_RETURN, elemStr); + if (found && !elemStr.empty()) + { + Poco::CodeGeneration::CodeGenerator::Properties elemProps; + Poco::CodeGeneration::GeneratorEngine::parseElementProperties(elemStr, elemProps); + Poco::CodeGeneration::GeneratorEngine::getBoolProperty(elemProps, GenUtility::ATTR_INLINE, doInline); + } + return doInline; +} + + +std::string GenUtility::getReturnParameterType(const Poco::CppParser::Function* pFunc) +{ + if (pFunc->getReturnParameter().empty() || pFunc->getReturnParameter() == Poco::CodeGeneration::Utility::TYPE_VOID) + return Poco::CodeGeneration::Utility::TYPE_VOID; + + return pFunc->getReturnParameter(); +} + + +std::string GenUtility::getResolvedReturnParameterType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Function* pFunc) +{ + std::string retParam(getReturnParameterType(pFunc)); + return Poco::CodeGeneration::Utility::resolveType(pNS, retParam); +} + + +bool GenUtility::isVectorType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Parameter* pParam) +{ + std::string paramType = Poco::CodeGeneration::Utility::resolveType(pNS, pParam->declType()); + return isVectorType(paramType); +} + + +bool GenUtility::isVectorType(const std::string& resolvedType) +{ + if (resolvedType == "std::vector < char >") return false; + bool found = false; + for (int i = 0; i < KEYS_VECTOR_SIZE && !found; ++i) + { + found = (resolvedType.find(KEYS_VECTOR[i]) == 0); + } + return found; +} + + +bool GenUtility::isUniqueVectorType(const std::string& resolvedType) +{ + bool found = false; + for (int i = 0; i < KEYS_UNIQUE_VECTOR_SIZE && !found; ++i) + { + found = (resolvedType.find(KEYS_UNIQUE_VECTOR[i]) == 0); + } + return found; +} + + +bool GenUtility::isArrayType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Parameter* pParam) +{ + std::string paramType = Poco::CodeGeneration::Utility::resolveType(pNS, pParam->declType()); + return isArrayType(paramType); +} + + +bool GenUtility::isArrayType(const std::string& resolvedType) +{ + return resolvedType.compare(0, 11, "Poco::Array") == 0 || resolvedType.compare(0, 10, "std::array") == 0; +} + + +bool GenUtility::isNullableType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Parameter* pParam) +{ + std::string resolvedType = Poco::CodeGeneration::Utility::resolveType(pNS, pParam->declType()); + return isNullableType(resolvedType); +} + + +bool GenUtility::isOptionalType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Parameter* pParam) +{ + std::string resolvedType = Poco::CodeGeneration::Utility::resolveType(pNS, pParam->declType()); + return isOptionalType(resolvedType); +} + + +bool GenUtility::isStdOptionalType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Parameter* pParam) +{ + std::string resolvedType = Poco::CodeGeneration::Utility::resolveType(pNS, pParam->declType()); + return isStdOptionalType(resolvedType); +} + + +bool GenUtility::isTemplateType(const std::string& resolvedType) +{ + std::size_t posStart = resolvedType.find('<'); + std::size_t posEnd = resolvedType.find('>'); + return (posStart != std::string::npos && posEnd != std::string::npos && posStart < posEnd); +} + + +bool GenUtility::isPtrType(const std::string& type) +{ + return type.compare(0, 7, "AutoPtr") == 0 + || type.compare(0, 13, "Poco::AutoPtr") == 0 + || type.compare(0, 9, "SharedPtr") == 0 + || type.compare(0, 15, "Poco::SharedPtr") == 0 + || type.compare(0, 9, "std::shared_ptr") == 0 + || type.compare(0, 15, "std::unique_ptr") == 0; +} + + +bool GenUtility::isNullableType(const std::string& type) +{ + return type.compare(0, 8, "Nullable") == 0 + || type.compare(0, 14, "Poco::Nullable") == 0; +} + + +bool GenUtility::isOptionalType(const std::string& type) +{ + return type.compare(0, 8, "Optional") == 0 + || type.compare(0, 14, "Poco::Optional") == 0 + || type.compare(0, 13, "std::optional") == 0; +} + + +bool GenUtility::isStdOptionalType(const std::string& type) +{ + return type.compare(0, 13, "std::optional") == 0; +} + + +std::vector GenUtility::getResolvedInnerTemplateTypes(const Poco::CppParser::NameSpace* pNS, const std::string& typeDecl) +{ + std::string resolved(Poco::CodeGeneration::Utility::resolveType(pNS, typeDecl)); + return getInnerTemplateTypes(resolved); +} + + +std::vector GenUtility::getInnerTemplateTypes(const std::string& typeDecl) +{ + std::vector templTypes; + //a typical template def std::map > + int lvl = 0; + std::string temp; + for (int i = 0; i < typeDecl.size(); ++i) + { + char c = typeDecl[i]; + if (c == '<') + { + ++lvl; + if (lvl > 1) + temp.append(&c, 1); + } + else if (c == '>') + { + --lvl; + if (lvl == 0) + { + Poco::trimInPlace(temp); + if (!temp.empty() && (Poco::Ascii::isAlpha(temp[0]) || temp[0] == '_')) // Poco::Array -> 8 is not a type + templTypes.push_back(temp); + temp.clear(); + } + else + temp.append(&c, 1); + } + else if (c == ',') + { + if (lvl > 0) + { + Poco::trimInPlace(temp); + if (!temp.empty() && (Poco::Ascii::isAlpha(temp[0]) || temp[0] == '_')) // Poco::Array -> 8 is not a type + templTypes.push_back(temp); + temp.clear(); + } + else + temp.append(&c, 1); + } + else + { + if (lvl > 0) + { + temp.append(&c, 1); + } + } + } + return templTypes; +} + + +bool GenUtility::mustBeSerializable(const std::string& name) +{ + return (name != "Thread" && name != "Runnable" && name != "RefCountedObject" && name != "Service"); +} + + +bool GenUtility::hasEvents(const Poco::CppParser::Struct* pStruct) +{ + if (!pStruct) + return false; + + Poco::CppParser::NameSpace::SymbolTable tbl; + pStruct->variables(tbl); + Poco::CppParser::NameSpace::SymbolTable::const_iterator it = tbl.begin(); + Poco::CppParser::NameSpace::SymbolTable::const_iterator itEnd = tbl.end(); + for (; it != itEnd; ++it) + { + Poco::CppParser::Variable* pVar = static_cast(it->second); + const std::string& varType = pVar->declType(); + if (pVar->getAccess() == Poco::CppParser::Variable::ACC_PUBLIC) + { + if (varType.find("Poco::BasicEvent") == 0 || varType.find("Poco::FIFOEvent") == 0) + { + return true; + } + } + } + return parentsHaveEvents(pStruct); +} + + +bool GenUtility::parentsHaveEvents(const Poco::CppParser::Struct* pStruct) +{ + if (!pStruct) + return false; + + // check parents + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + for (; itB != itBEnd; ++itB) + { + if (itB->pClass) + { + if (GenUtility::hasEvents(itB->pClass)) + return true; + } + } + return false; +} + + +bool GenUtility::hasAnyRemoteParent(const Poco::CppParser::Struct* pStruct) +{ + bool hasAnyRemote = false; + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + for (; itB != itBEnd; ++itB) + { + if (itB->pClass) + hasAnyRemote |= Poco::CodeGeneration::Utility::hasAnyRemoteProperty(itB->pClass); + } + return hasAnyRemote; +} + + +Poco::UInt64 GenUtility::parseExpireTime(const std::string& expireTimeStr) +{ + std::size_t pos = 0; + while (std::isdigit(expireTimeStr[pos]) && pos < expireTimeStr.size()) + pos++; + + Poco::UInt64 expireTime = Poco::NumberParser::parseUnsigned(expireTimeStr.substr(0, pos)); + + // now search for either ms, s(ec), m(in), h(our), + // the default is ms + + std::string tmp(expireTimeStr.substr(pos)); + Poco::toLowerInPlace(tmp); + Poco::trimInPlace(tmp); + // convert to microsec + if (tmp == "ms" || (tmp.find("milli") == 0)) + expireTime *= 1000; + else if (tmp == "s" || (tmp.find("sec") == 0)) + expireTime *= (1000*1000); + else if (tmp == "m" || (tmp.find("min") == 0)) + expireTime *= (1000*1000*60); + else if (tmp == "h" || (tmp.find("hour") == 0)) + { + expireTime *= (1000*1000*60); + expireTime *= 60; + } + else + expireTime *= 1000; + + return expireTime; +} + + +void GenUtility::checkFunctionParams(const Poco::CppParser::Function* pFunc) +{ + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + for (; it != itEnd; ++it) + { + if ((*it)->name() == (*it)->declType()) + throw CodeGenerationException("Unnamed function parameters are not allowed", pFunc->fullName() + "()"); + } +} + + +bool GenUtility::isOverride(const std::string& funcName, const Poco::CppParser::Struct* pStruct) +{ + poco_check_ptr (pStruct); + + Poco::CppParser::Struct::Functions methods; + pStruct->methods(Poco::CppParser::Symbol::ACC_PUBLIC, methods); + bool isDefinedHere = false; + for (Poco::CppParser::Struct::Functions::const_iterator it = methods.begin(); !isDefinedHere && it != methods.end(); ++it) + { + if ((*it)->name() == funcName) + { + isDefinedHere = true; + } + } + if (!isDefinedHere) return false; + + Poco::CppParser::Struct::FunctionSet inherited; + pStruct->inheritedMethods(inherited); + for (Poco::CppParser::Struct::FunctionSet::const_iterator it = inherited.begin(); it != inherited.end(); ++it) + { + if ((*it)->name() == funcName) + return true; + } + return false; +} diff --git a/RemotingNG/RemoteGen/src/GenUtility.h b/RemotingNG/RemoteGen/src/GenUtility.h new file mode 100644 index 0000000000..79dbff7bcd --- /dev/null +++ b/RemotingNG/RemoteGen/src/GenUtility.h @@ -0,0 +1,164 @@ +// +// GenUtility.h +// +// Definition of the GenUtility class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef RemoteGen_GenUtility_INCLUDED +#define RemoteGen_GenUtility_INCLUDED + + +#include "Poco/CppParser/Parameter.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Variable.h" +#include "Poco/CppParser/Struct.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CodeGeneration/CodeGenerator.h" +#include "Poco/Exception.h" +#include + + +#define RemoteGen_API +POCO_DECLARE_EXCEPTION(RemoteGen_API, CodeGenerationException, Poco::ApplicationException) + + +class GenUtility + /// GenUtility functions +{ +public: + static const std::string ATTR_HEADER; + static const std::string ATTR_RETURN; + + static bool isRemoteMethod(const Poco::CppParser::Function* pFunc, const Poco::CodeGeneration::CodeGenerator::Properties& properties); + + static bool isRemoteEvent(const Poco::CppParser::Variable* pVar, const Poco::CodeGeneration::CodeGenerator::Properties& properties); + + static std::string getMethodName(const Poco::CppParser::Function* pFunc); + + static std::string getRequestMethodName(const Poco::CppParser::Function* pFunc); + + static std::string getReplyMethodName(const Poco::CppParser::Function* pFunc); + + static std::string getParameterName(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Parameter* pParam); + + static std::string getVariableName(const Poco::CppParser::Variable* pVar); + + static Poco::UInt32 getVariableOrder(const Poco::CppParser::Variable* pVar, Poco::UInt32 defValue); + + static Poco::UInt32 getParameterOrder(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Parameter* pVar, Poco::UInt32 defValue); + + static bool getIsMandatory(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Parameter* pParam); + + static bool getIsMandatory(const Poco::CppParser::Variable* pVar); + + static bool getIsMandatory(const Poco::CodeGeneration::CodeGenerator::Properties& props); + + static bool getIsInHeader(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Parameter* pParam); + + static bool getInlineReturnParam(const Poco::CppParser::Function* pFunc); + + static std::string getReturnParameterName(const Poco::CppParser::Function* pFunc); + + static std::string cleanVariableName(const std::string& origName); + /// Extracts the core name from a variable name, e.g.: m_id -> id, _ixyz -> xyz + + static std::string getReturnParameterType(const Poco::CppParser::Function* pFunc); + /// Returns Poco::CodeGeneration::Utility::TYPE_VOID for void data types, otherwise returns the type of the return parameter. + + static std::string getResolvedReturnParameterType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Function* pFunc); + /// Returns Poco::CodeGeneration::Utility::TYPE_VOID for void data types, otherwise returns the type of the return parameter. + /// The returned type is already resolved + + static bool isVectorType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Parameter* pParam); + /// a vector type is everything that can be mapped directly to an XML schema collection type with maxOccurs=unbounded + + static bool isVectorType(const std::string& resolvedType); + + static bool isUniqueVectorType(const std::string& resolvedType); + /// returns true if type is std::set or std::unordered_set + + static bool isArrayType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Parameter* pParam); + /// returns true if type is Poco::Array or std::array. + + static bool isArrayType(const std::string& resolvedType); + + static bool isTemplateType(const std::string& resolvedType); + + static bool isPtrType(const std::string& type); + // returns true if the type is either an AutoPtr or a SharedPtr + + static bool isNullableType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Parameter* pParam); + /// returns true if the type is Poco::Nullable + + static bool isNullableType(const std::string& type); + /// returns true if the type is Poco::Nullable + + static bool isOptionalType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Parameter* pParam); + /// returns true if the type is Poco::Optional or std::optional + + static bool isStdOptionalType(const Poco::CppParser::NameSpace* pNS, const Poco::CppParser::Parameter* pParam); + /// returns true if the type is std::optional + + static bool isOptionalType(const std::string& type); + /// returns true if the type is Poco::Optional or std::optional + + static bool isStdOptionalType(const std::string& type); + /// returns true if the type is std::optional + + static std::vector getInnerTemplateTypes(const std::string& typeDecl); + /// Returns a vector containing the types used to instantiate the template + + static std::vector getResolvedInnerTemplateTypes(const Poco::CppParser::NameSpace* pNS, const std::string& typeDecl); + /// Returns a vector containing the types used to instantiate the template + + static bool mustBeSerializable(const std::string& name); + /// Checks whether a (parent) class must be serializable or can be ignored + + static bool hasAnyRemoteParent(const Poco::CppParser::Struct* pStruct); + + static Poco::UInt64 parseExpireTime(const std::string& expireTimeStr); + ///Parses an expire time str. Is an integer value followed by a unit (e.g.:12ms, 3 min) + ///Returns a microseconds value + + static bool hasEvents(const Poco::CppParser::Struct* pService); + /// Check if the Struct or any of its parent classes have events + + static bool parentsHaveEvents(const Poco::CppParser::Struct* pStruct); + /// Checks only the parent classes for exporting events + + static void checkFunctionParams(const Poco::CppParser::Function* pFunction); + /// Checks for unnamed parameters. + + static bool isOverride(const std::string& funcName, const Poco::CppParser::Struct* pStruct); + /// Returns true if the function with the given name is an overrided virtual function. + +private: + GenUtility(); + ~GenUtility(); + GenUtility(const GenUtility&); + GenUtility& operator = (const GenUtility&); + + static const std::string ATTR_INLINE; + static const std::string ATTR_NAME; + static const std::string ATTR_REPLYNAME; + static const std::string VAL_REQUEST; + static const std::string VAL_REPLY; + + enum + { + KEYS_VECTOR_SIZE = 8, + KEYS_UNIQUE_VECTOR_SIZE = 4 + }; + + static const std::string KEYS_VECTOR[KEYS_VECTOR_SIZE]; + static const std::string KEYS_UNIQUE_VECTOR[KEYS_UNIQUE_VECTOR_SIZE]; +}; + + +#endif // RemoteGen_GenUtility_INCLUDED diff --git a/RemotingNG/RemoteGen/src/InterfaceGenerator.cpp b/RemotingNG/RemoteGen/src/InterfaceGenerator.cpp new file mode 100644 index 0000000000..e389357328 --- /dev/null +++ b/RemotingNG/RemoteGen/src/InterfaceGenerator.cpp @@ -0,0 +1,337 @@ +// +// InterfaceGenerator.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "InterfaceGenerator.h" +#include "GenUtility.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CodeGeneration/CppGenerator.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CppParser/TypeDef.h" +#include "Poco/CppParser/Enum.h" +#include "Poco/Exception.h" +#include "Poco/Path.h" +#include "Poco/String.h" + + +using Poco::CodeGeneration::Utility; + + +InterfaceGenerator::InterfaceGenerator(Poco::CodeGeneration::CppGenerator& cppGen, bool enableOSP): + AbstractGenerator(cppGen), + _enableOSP(enableOSP) + +{ +} + + +InterfaceGenerator::~InterfaceGenerator() +{ +} + + +std::string InterfaceGenerator::generateClassName(const Poco::CppParser::Struct* pStruct) +{ + poco_assert_dbg (pStruct); + std::string newClassName("I"); + newClassName.append(pStruct->name()); + return newClassName; +} + + +std::string InterfaceGenerator::generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct) +{ + if (ns.empty()) + return InterfaceGenerator::generateClassName(pStruct); + + return ns + "::" + InterfaceGenerator::generateClassName(pStruct);; +} + + +void InterfaceGenerator::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + AbstractGenerator::structStart(pStruct, properties); + bool hasAnyRemote = GenUtility::hasAnyRemoteParent(pStruct); + if (!hasAnyRemote) + { + // pushBack of a name not enough, we need virtual inheritance + if (!_enableOSP) + { + _pStruct->addBase("Poco::RefCountedObject", Poco::CppParser::Symbol::ACC_PUBLIC, true); + _cppGen.addIncludeFile("Poco/RefCountedObject.h"); + } + else + { + // virtual not needed, service inherists virtual from RefCountedObject + _pStruct->addBase("Poco::OSP::Service", Poco::CppParser::Symbol::ACC_PUBLIC, false); + _cppGen.addIncludeFile("Poco/OSP/Service.h"); + } + _cppGen.addIncludeFile("Poco/RemotingNG/Identifiable.h"); + _cppGen.addIncludeFile("Poco/AutoPtr.h"); + } + + Poco::CodeGeneration::Utility::handleInclude(pStruct, _cppGen); + // add constructor/destructor + Poco::CppParser::Function* pConstr = new Poco::CppParser::Function(_pStruct->name(), _pStruct); + pConstr->addDocumentation( " Creates a " + _pStruct->name() + "."); + + Poco::CppParser::Function* pDestr = new Poco::CppParser::Function(std::string("virtual ~")+_pStruct->name(), _pStruct); + pDestr->addDocumentation( " Destroys the " + _pStruct->name() + "."); + + Poco::CppParser::Function* pTypeId = new Poco::CppParser::Function(std::string("static const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId()"), _pStruct); + pTypeId->addDocumentation( " Returns the TypeId of the class."); + + Poco::CppParser::TypeAlias* pTypeAlias = new Poco::CppParser::TypeAlias("using Ptr = Poco::AutoPtr<" + generateClassName(pStruct) + ">", _pStruct); + poco_check_ptr (pTypeAlias); // just avoid unused variable warning + + if (_enableOSP) + { + // implement service interface + // const std::type_info& type() const; + Poco::CppParser::Function* pType = new Poco::CppParser::Function(std::string("const std::type_info& type"), _pStruct); + pType->makeConst(); + pType->addDocumentation(" Returns the type information for the object's class."); + // bool isA(const std::type_info& otherType) const; + Poco::CppParser::Function* pIsA = new Poco::CppParser::Function(std::string("bool isA"), _pStruct); + pIsA->makeConst(); + Poco::CppParser::Parameter* pParam = new Poco::CppParser::Parameter("const std::type_info& otherType", 0); + pIsA->addParameter(pParam); + pIsA->addDocumentation(" Returns true if the class is a subclass of the class given by otherType."); + } + + bool ev = checkForEventMembers(pStruct, properties); + if (ev) + { + Poco::CppParser::Function* pEvents = new Poco::CppParser::Function("virtual std::string remoting__enableEvents", _pStruct); + Poco::CppParser::Parameter* pParam = new Poco::CppParser::Parameter("Poco::RemotingNG::Listener::Ptr pListener", 0); + pEvents->addParameter(pParam); + pParam = new Poco::CppParser::Parameter("bool enable = true", 0); + pEvents->addParameter(pParam); + pEvents->makePureVirtual(); + pEvents->addDocumentation(" Enable or disable delivery of remote events."); + pEvents->addDocumentation(""); + pEvents->addDocumentation(" The given Listener instance must implement the Poco::RemotingNG::EventListener"); + pEvents->addDocumentation(" interface, otherwise this method will fail with a RemotingException."); + pEvents->addDocumentation(""); + pEvents->addDocumentation(" This method is only used with Proxy objects; calling this method on a"); + pEvents->addDocumentation(" RemoteObject will do nothing."); + _cppGen.addIncludeFile("Poco/RemotingNG/Listener.h"); + } +} + + +void InterfaceGenerator::methodStart(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& properties) +{ + poco_assert_dbg (_pStruct && _pStructIn); + + if (!GenUtility::isRemoteMethod(pFuncOld, properties)) return; + if (GenUtility::isOverride(pFuncOld->name(), _pStructIn)) return; + + // recreate a "rettype method signature" as "virtual retType method signature = 0" + // note that a decl contains only the string up to method, no params! + std::string decl (Poco::CodeGeneration::Utility::VIRTUAL+" "); + std::string resRetType = Utility::resolveType(_pStructIn, pFuncOld->getReturnParameter()); + + if (resRetType != pFuncOld->getReturnParameter()) + { + const std::string& oldRet = pFuncOld->getReturnParameter(); + if (!oldRet.empty()) + { + const std::string& oldDecl = pFuncOld->declaration(); + std::size_t pos = oldDecl.find(oldRet); + if (pos != std::string::npos) + { + pos += oldRet.size(); + decl.append(resRetType); + decl.append(oldDecl.substr(pos)); + } + else + decl.append(oldDecl); + } + else + decl.append(pFuncOld->declaration()); + } + else + { + decl.append(pFuncOld->declaration()); + } + + Poco::CppParser::Function* pFunc = new Poco::CppParser::Function(decl, _pStruct); + pFunc->setAccess (pFuncOld->getAccess()); + addDocumentation(pFuncOld, pFunc); + pFunc->setAttributes(pFuncOld->getAttributes()); + if (pFuncOld->isConst()) + pFunc->makeConst(); + + pFunc->makePureVirtual(); + + Poco::CppParser::Function::Iterator it = pFuncOld->begin(); + Poco::CppParser::Function::Iterator itEnd = pFuncOld->end(); + + for (; it != itEnd; ++it) + { + std::string decl = Poco::CodeGeneration::Utility::resolveParamDecl(_pStructIn, *it); + if ((*it)->hasDefaultValue()) + { + decl.append(" = "); + std::string type = Poco::CodeGeneration::Utility::resolveType(_pStructIn, (*it)->declType()); + Poco::CppParser::Symbol* pSym = Poco::CppParser::NameSpace::root()->lookup(type); + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_ENUM) + { + Poco::CppParser::Enum* pEnum = static_cast(pSym); + if (pEnum->flags() & Poco::CppParser::Enum::ENUM_IS_CLASS) + decl.append(pEnum->fullName()); + else + decl.append(pEnum->nameSpace()->fullName()); + decl.append("::"); + std::string defaultValue((*it)->defaultValue()); + std::string::size_type scpos = defaultValue.find_last_of("::"); + if (scpos != std::string::npos) + { + defaultValue.erase(0, scpos + 1); + } + decl.append(defaultValue); + } + else + { + decl.append(type); + decl.append("("); + decl.append((*it)->defaultValue()); + decl.append(")"); + } + } + if ((*it)->isPointer()) + throw Poco::InvalidArgumentException("Pointer parameters are not supported: " + pFuncOld->nameSpace()->fullName() + "::" + pFuncOld->name() + "::" + (*it)->name()); + + Poco::CppParser::Parameter* pParam = new Poco::CppParser::Parameter(decl, pFunc); + pFunc->addParameter(pParam); + } +} + + +void InterfaceGenerator::registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e) +{ + e.registerCallback("remoting__typeId", &InterfaceGenerator::ifaceTypeIdCodeGen); + e.registerCallback("type", &InterfaceGenerator::ifaceTypeCodeGen); + e.registerCallback("isA", &InterfaceGenerator::ifaceIsACodeGen); +} + + +void InterfaceGenerator::ifaceTypeIdCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + InterfaceGenerator* pIG = dynamic_cast(pAGen); + poco_check_ptr (pIG); + + const Poco::CppParser::Struct* pDataType = pIG->_pStructIn; // returns the data type for which pStruct was generated + poco_assert(pDataType); + gen.writeMethodImplementation("static const std::string REMOTING__TYPE_ID(\"" + Poco::replace(pDataType->fullName(), "::", ".") + "\");"); + gen.writeMethodImplementation("return REMOTING__TYPE_ID;"); +} + + +void InterfaceGenerator::ifaceTypeCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + InterfaceGenerator* pIG = dynamic_cast(pAGen); + poco_check_ptr (pIG); + + const Poco::CppParser::Struct* pDataType = pIG->_pStructIn; // returns the data type for which pStruct was generated + + poco_assert(pDataType); + gen.writeMethodImplementation("return typeid(" + InterfaceGenerator::generateClassName(pDataType) + ");"); +} + + +void InterfaceGenerator::ifaceIsACodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + InterfaceGenerator* pIG = dynamic_cast(pAGen); + poco_check_ptr (pIG); + + const Poco::CppParser::Struct* pDataType = pIG->_pStructIn; // returns the data type for which pStruct was generated + poco_assert(pDataType); + // static const std::string name(typeid(MyClass).name()); + // return name == otherType.name() || MyBaseClass::isA(otherType); + + std::string nameCheck("return name == otherType.name()"); + + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + + for (; itB != itBEnd; ++itB) + { + nameCheck.append(" || "); + nameCheck.append(itB->name + "::isA(otherType)"); + } + nameCheck.append(";"); + gen.writeMethodImplementation("static const std::string name(typeid(" + pStruct->fullName() + ").name());"); + gen.writeMethodImplementation(nameCheck); +} + + +std::vector InterfaceGenerator::newBaseClasses(const Poco::CppParser::Struct* pStruct) +{ + std::vector bases; + GenUtility::hasAnyRemoteParent(pStruct); + + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + + for (; itB != itBEnd; ++itB) + { + const Poco::CppParser::Struct* pParent = itB->pClass; + if (pParent && Utility::hasAnyRemoteProperty(pParent)) + { + bases.push_back(generateQualifiedClassName(nameSpace(), pParent)); + } + } + + return bases; +} + + +bool InterfaceGenerator::checkForEventMembers(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + bool ev = false; + Poco::CppParser::NameSpace::SymbolTable tbl; + pStruct->variables(tbl); + Poco::CppParser::NameSpace::SymbolTable::const_iterator it = tbl.begin(); + Poco::CppParser::NameSpace::SymbolTable::const_iterator itEnd = tbl.end(); + for (; it != itEnd; ++it) + { + Poco::CppParser::Variable* pVar = static_cast(it->second); + Poco::CodeGeneration::CodeGenerator::Properties eventProperties(properties); + Poco::CodeGeneration::GeneratorEngine::parseProperties(pVar, eventProperties); + if (GenUtility::isRemoteEvent(pVar, eventProperties)) + { + // add a variable with the same name + Poco::CppParser::Variable* pVarNew = new Poco::CppParser::Variable(resolveEventType(pStruct, pVar->declaration()), _pStruct); + pVarNew->setAccess(Poco::CppParser::Symbol::ACC_PUBLIC); + ev = true; + } + } + return ev; +} + + +std::string InterfaceGenerator::resolveEventType(const Poco::CppParser::Struct* pStruct, const std::string& decl) +{ + std::string::size_type pos = decl.find_last_of(' '); + std::string typeDecl(decl, 0, pos); + return Utility::resolveType(pStruct, typeDecl) + decl.substr(pos); +} diff --git a/RemotingNG/RemoteGen/src/InterfaceGenerator.h b/RemotingNG/RemoteGen/src/InterfaceGenerator.h new file mode 100644 index 0000000000..5688250699 --- /dev/null +++ b/RemotingNG/RemoteGen/src/InterfaceGenerator.h @@ -0,0 +1,82 @@ +// +// InterfaceGenerator.h +// +// Definition of the InterfaceGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef RemoteGen_InterfaceGenerator_INCLUDED +#define RemoteGen_InterfaceGenerator_INCLUDED + + +#include "AbstractGenerator.h" + + +class InterfaceGenerator: public AbstractGenerator + /// InterfaceGenerator generates a remote interface for a given class definition. C++ specific. + /// Has no members, a default constructor/destructor and only virtual = 0; methods +{ +public: + InterfaceGenerator(Poco::CodeGeneration::CppGenerator& cppGen, bool enableOSP); + /// Creates the InterfaceGenerator. + + ~InterfaceGenerator(); + /// Destroys the InterfaceGenerator. + + static std::string generateClassName(const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + static std::string generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// Must not write the namespace + + void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Writes the method header. Properties contains the properties found in the functions docuementation and in the class documentation. + + void registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e); + + std::string newClassName(const Poco::CppParser::Struct* pStruct); + /// generates the new class name based on the old one + + std::vector newBaseClasses(const Poco::CppParser::Struct* pStruct); + + bool enableOSP() const; + +private: + static void ifaceTypeIdCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, Poco::CodeGeneration::CodeGenerator& gen, void* addParam); + + static void ifaceIsACodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static void ifaceTypeCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + bool checkForEventMembers(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + + std::string resolveEventType(const Poco::CppParser::Struct* pStruct, const std::string& decl); + + bool _enableOSP; +}; + + +// +// inlines +// +inline std::string InterfaceGenerator::newClassName(const Poco::CppParser::Struct* pStruct) +{ + return InterfaceGenerator::generateClassName(pStruct); +} + + +inline bool InterfaceGenerator::enableOSP() const +{ + return _enableOSP; +} + + +#endif // RemoteGen_InterfaceGenerator_INCLUDED diff --git a/RemotingNG/RemoteGen/src/ProxyFactoryGenerator.cpp b/RemotingNG/RemoteGen/src/ProxyFactoryGenerator.cpp new file mode 100644 index 0000000000..161c73efc3 --- /dev/null +++ b/RemotingNG/RemoteGen/src/ProxyFactoryGenerator.cpp @@ -0,0 +1,116 @@ +// +// ProxyFactoryGenerator.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "ProxyFactoryGenerator.h" +#include "ProxyGenerator.h" +#include "InterfaceGenerator.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/Exception.h" +#include "Poco/Path.h" +#include "Poco/NumberFormatter.h" + + +using Poco::CodeGeneration::Utility; + + +ProxyFactoryGenerator::ProxyFactoryGenerator(Poco::CodeGeneration::CppGenerator& cppGen): AbstractGenerator(cppGen) +{ +} + + +ProxyFactoryGenerator::~ProxyFactoryGenerator() +{ +} + + +std::string ProxyFactoryGenerator::generateClassName(const Poco::CppParser::Struct* pStruct) +{ + poco_assert_dbg (pStruct); + std::string newClassName(pStruct->name()); + newClassName.append("ProxyFactory"); + return newClassName; +} + + +std::string ProxyFactoryGenerator::generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct) +{ + if (ns.empty()) + return ProxyFactoryGenerator::generateClassName(pStruct); + + return ns + "::" + ProxyFactoryGenerator::generateClassName(pStruct); +} + + +void ProxyFactoryGenerator::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + AbstractGenerator::structStart(pStruct, properties); + // add constructor/destructor + Poco::CppParser::Function* pConstr = new Poco::CppParser::Function(_pStruct->name(), _pStruct); + pConstr->addDocumentation( " Creates a " + _pStruct->name() + "."); + + Poco::CppParser::Function* pDestr = new Poco::CppParser::Function(std::string("~")+_pStruct->name(), _pStruct); + pDestr->addDocumentation( " Destroys the " + _pStruct->name() + "."); + + std::string proxyName = ProxyGenerator::generateQualifiedClassName(nameSpace(), pStruct); + Poco::CppParser::Symbol* pSym = Poco::CppParser::NameSpace::root()->lookup(proxyName); + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_STRUCT) + Poco::CodeGeneration::Utility::handleInclude(static_cast(pSym), _cppGen); + + //add method: Poco::RemotingNG::Proxy* createProxy() const + Poco::CppParser::Function* pCreate = new Poco::CppParser::Function("Poco::RemotingNG::Proxy* createProxy", _pStruct); + pCreate->addDocumentation( " Creates and returns a new Proxy object."); + Poco::CppParser::Parameter* pParam1 = new Poco::CppParser::Parameter("const Poco::RemotingNG::Identifiable::ObjectId& oid", pCreate); + pCreate->addParameter(pParam1); + pCreate->makeConst(); +} + + +void ProxyFactoryGenerator::methodStart(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& properties) +{ + // ignore the other methods +} + + +void ProxyFactoryGenerator::registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e) +{ + //we don't want any code for constructor and destructor + e.registerCallback(_pStruct->name(), &Poco::CodeGeneration::GeneratorEngine::emptyCodeGen); + e.registerCallback("~"+_pStruct->name(), &Poco::CodeGeneration::GeneratorEngine::emptyCodeGen); + e.registerCallback("createProxy", &ProxyFactoryGenerator::createCodeGen); +} + + +std::vector ProxyFactoryGenerator::newBaseClasses(const Poco::CppParser::Struct* pStruct) +{ + // we extend from Proxy and from the Interface + std::vector bases; + bases.push_back("Poco::RemotingNG::ProxyFactory"); + return bases; +} + + +void ProxyFactoryGenerator::createCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + ProxyFactoryGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + std::string fullName (pStruct->fullName()); + size_t pos = fullName.rfind("::"); + std::string ns; + if (pos != std::string::npos) + ns = fullName.substr(0, pos); + + std::string proxyName = ProxyGenerator::generateQualifiedClassName(ns, pGen->_pStructIn); + gen.writeMethodImplementation("return new "+ proxyName + "(oid);"); +} diff --git a/RemotingNG/RemoteGen/src/ProxyFactoryGenerator.h b/RemotingNG/RemoteGen/src/ProxyFactoryGenerator.h new file mode 100644 index 0000000000..34e40a6ffe --- /dev/null +++ b/RemotingNG/RemoteGen/src/ProxyFactoryGenerator.h @@ -0,0 +1,63 @@ +// +// ProxyFactoryGenerator.h +// +// Definition of the ProxyFactoryGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef RemoteGen_ProxyFactoryGenerator_INCLUDED +#define RemoteGen_ProxyFactoryGenerator_INCLUDED + + +#include "AbstractGenerator.h" + + +class ProxyFactoryGenerator: public AbstractGenerator + /// ProxyFactoryGenerator generates a proxy for a given class definition. C++ specific. +{ +public: + ProxyFactoryGenerator(Poco::CodeGeneration::CppGenerator& cppGen); + /// Creates the ProxyFactoryGenerator. + + ~ProxyFactoryGenerator(); + /// Destroys the ProxyFactoryGenerator. + + static std::string generateClassName(const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + static std::string generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// Must not write the namespace + + void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Writes the method header. Properties contains the properties found in the functions docuementation and in the class documentation. + + void registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e); + + std::string newClassName(const Poco::CppParser::Struct* pStruct); + /// generates the new class name based on the old one + + std::vector newBaseClasses(const Poco::CppParser::Struct* pStruct); + +private: + static void createCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); +}; + + +// +// inlines +// +inline std::string ProxyFactoryGenerator::newClassName(const Poco::CppParser::Struct* pStruct) +{ + return ProxyFactoryGenerator::generateClassName(pStruct); +} + + +#endif // RemoteGen_ProxyFactoryGenerator_INCLUDED diff --git a/RemotingNG/RemoteGen/src/ProxyGenerator.cpp b/RemotingNG/RemoteGen/src/ProxyGenerator.cpp new file mode 100644 index 0000000000..4612b4d03d --- /dev/null +++ b/RemotingNG/RemoteGen/src/ProxyGenerator.cpp @@ -0,0 +1,1513 @@ +// +// ProxyGenerator.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "ProxyGenerator.h" +#include "InterfaceGenerator.h" +#include "EventSubscriberGenerator.h" +#include "SerializerGenerator.h" +#include "GenUtility.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CppParser/Enum.h" +#include "Poco/Exception.h" +#include "Poco/Path.h" +#include "Poco/NumberFormatter.h" +#include "Poco/StringTokenizer.h" +#include "Poco/String.h" +#include "Poco/Format.h" +#include "Poco/Timespan.h" +#include "Poco/RemotingNG/SerializerBase.h" + + +using namespace Poco::CodeGeneration; + + +ProxyGenerator::ProxyGenerator(Poco::CodeGeneration::CppGenerator& cppGen): AbstractGenerator(cppGen), _cacheVariableSet(false), _hasEvents(false) +{ +} + + +ProxyGenerator::~ProxyGenerator() +{ +} + + +std::string ProxyGenerator::generateClassName(const Poco::CppParser::Struct* pStruct) +{ + poco_assert_dbg (pStruct); + std::string newClassName(pStruct->name()); + newClassName.append("Proxy"); + return newClassName; +} + + +std::string ProxyGenerator::generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct) +{ + if (ns.empty()) + return ProxyGenerator::generateClassName(pStruct); + + return ns + "::" + ProxyGenerator::generateClassName(pStruct); +} + + +std::string ProxyGenerator::generateOutParamName(const Poco::CppParser::Parameter* pParam, const std::string& functionName) +{ + std::string result("_"); + result.append(functionName); + result.append(pParam->name()); + result.append("Out"); + return result; +} + + +std::string ProxyGenerator::generateRetParamName(const Poco::CppParser::Function* pFunc) +{ + if (pFunc->getReturnParameter() == Poco::CodeGeneration::Utility::TYPE_VOID || pFunc->getReturnParameter().empty()) + return std::string(); + + std::string result("_"); + result.append(pFunc->name()); + result.append("Ret"); + return result; +} + +std::string ProxyGenerator::generateFunctResultName(const Poco::CppParser::Function* pFunc) +{ + std::string result("_"); + result.append(pFunc->name()); + result.append("ResultIsSet"); + return result; +} + + +void ProxyGenerator::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + AbstractGenerator::structStart(pStruct, properties); + // add constructor/destructor + Poco::CppParser::Function* pConstr = new Poco::CppParser::Function(_pStruct->name(), _pStruct); + //const Identifiable::ObjectId& oid + Poco::CppParser::Parameter* pParam1 = new Poco::CppParser::Parameter("const Poco::RemotingNG::Identifiable::ObjectId& oid", pConstr); + pConstr->addParameter(pParam1); + + pConstr->addDocumentation( " Creates a " + _pStruct->name() + "."); + + Poco::CppParser::Function* pDestr = new Poco::CppParser::Function(std::string("virtual ~")+_pStruct->name(), _pStruct); + pDestr->addDocumentation( " Destroys the " + _pStruct->name() + "."); + + + _cppGen.addIncludeFile("Poco/RemotingNG/Proxy.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/URIUtility.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/Serializer.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/Deserializer.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/TypeSerializer.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/TypeDeserializer.h"); + // add a method virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const + Poco::CppParser::Function* pTypeId = new Poco::CppParser::Function("virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId", _pStruct); + pTypeId->makeConst(); + pTypeId->makeInline(); + + // add a member: static const std::string DEFAULT_NS; + Poco::CppParser::Variable* pVar2 = new Poco::CppParser::Variable("static const std::string DEFAULT_NS", _pStruct); + pVar2->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + + Poco::CppParser::TypeAlias* pTypeAlias = new Poco::CppParser::TypeAlias("using Ptr = Poco::AutoPtr<" + generateClassName(pStruct) + ">", _pStruct); + poco_check_ptr (pTypeAlias); // just avoid unused variable warning + + // replicate parent functions + handleParentFunctions(pStruct); + // checks if the class or any parent contains public BasicEvents + checkForParentEventMembers(pStruct); + checkForEventMembers(pStruct); + + if (_hasEvents) + { + Poco::CppParser::Function* pEvents = new Poco::CppParser::Function("virtual std::string remoting__enableEvents", _pStruct); + Poco::CppParser::Parameter* pParam = new Poco::CppParser::Parameter("Poco::RemotingNG::Listener::Ptr pListener", 0); + pEvents->addParameter(pParam); + pParam = new Poco::CppParser::Parameter("bool enable = true", 0); + pEvents->addParameter(pParam); + Poco::CppParser::Variable* pEvSub = new Poco::CppParser::Variable("Poco::RemotingNG::EventSubscriber::Ptr _pEventSubscriber", _pStruct); + pEvSub->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + Poco::CppParser::Variable* pEvLis = new Poco::CppParser::Variable("Poco::RemotingNG::EventListener::Ptr _pEventListener", _pStruct); + pEvLis->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + _cppGen.addIncludeFile("Poco/RemotingNG/EventSubscriber.h"); + _cppGen.addIncludeFile("Poco/RemotingNG/EventListener.h"); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/RemotingException.h"); + } + + if (!_cacheVariableSet) + { + //check the local functions + Poco::CppParser::Struct::Functions functions; + // we only handle public functions, others cannot be called remote + pStruct->methods(Poco::CppParser::Symbol::ACC_PUBLIC, functions); + Poco::CppParser::Struct::Functions::const_iterator it = functions.begin(); + Poco::CppParser::Struct::Functions::const_iterator itEnd = functions.end(); + + for (; it != itEnd && !_cacheVariableSet; ++it) + { + Poco::CppParser::Function* pFunc = *it; + CodeGenerator::Properties methodProperties(properties); + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, methodProperties); + if (GenUtility::isRemoteMethod(pFunc, methodProperties)) + { + bool enableCachingForThisMethod = false; + CodeGenerator::Properties::const_iterator itPropCache = methodProperties.find(Utility::CACHING); + if (itPropCache != methodProperties.end() && itPropCache->second != Utility::VAL_FALSE) + enableCachingForThisMethod = true; + _cacheVariableSet |= enableCachingForThisMethod; + } + } + } + + if (_cacheVariableSet) + { + _cppGen.addIncludeFile("Poco/UniqueExpireCache.h"); + _cppGen.addIncludeFile("Poco/ExpirationDecorator.h"); + Poco::CppParser::Variable* pVar = new Poco::CppParser::Variable("mutable Poco::UniqueExpireCache > _cache", _pStruct); + pVar->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + } +} + + +void ProxyGenerator::methodStart(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& methodProperties) +{ + if (_functions.find(pFuncOld->name()) != _functions.end()) + return; + + if (GenUtility::isRemoteMethod(pFuncOld, methodProperties)) + { + _functions.insert(pFuncOld->name()); + + Poco::CppParser::Function* pFunc = methodClone(pFuncOld, methodProperties); + methodStartImpl(pFunc, methodProperties); + } +} + + +void ProxyGenerator::methodStartImpl(Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& methodProperties) +{ + includeTypeSerializers(pFunc, false, false); + CodeGenerator::Properties::const_iterator it = methodProperties.find(Utility::CACHEEXPIRETIME); + + bool neverExpires = (it != methodProperties.end() && it->second == Utility::VAL_INFINITE); + + GenUtility::checkFunctionParams(pFunc); + bool enableCachingForThisMethod = false; + CodeGenerator::Properties::const_iterator itPropCache = methodProperties.find(Utility::CACHING); + if (itPropCache != methodProperties.end() && itPropCache->second != Utility::VAL_FALSE) + enableCachingForThisMethod = true; + std::map outParams; + detectOutParams(pFunc, outParams); + //bool isOneWay = outParams.empty() && (pFunc->getReturnParameter().empty() || pFunc->getReturnParameter() == Poco::CodeGeneration::Utility::TYPE_VOID); + // if we find any method that has return/out parameters add a place where we can store these results + if (enableCachingForThisMethod) + { + std::map::const_iterator itO = outParams.begin(); + std::map::const_iterator itOEnd = outParams.end(); + for (; itO != itOEnd; ++itO) + { + std::string oName = generateOutParamName(itO->second, pFunc->name()); + std::string decl("mutable " + itO->second->declType()); + if (itO->second->isPointer()) + decl.append("*"); + decl.append(" "); + decl.append(oName); + Poco::CppParser::Variable* pVarInt = new Poco::CppParser::Variable(decl, _pStruct); + pVarInt->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + + } + if (neverExpires) + { + std::string boolName = generateFunctResultName(pFunc); + std::string decl("mutable bool " + boolName); + Poco::CppParser::Variable* pVarInt = new Poco::CppParser::Variable(decl, _pStruct); + pVarInt->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + _cppGen.registerConstructorHint(pVarInt, Utility::VAL_FALSE); + + } + } + + std::string retParamName = generateRetParamName(pFunc); + if (!retParamName.empty()) + { + Poco::CppParser::Parameter p(pFunc->getReturnParameter() + " " + retParamName, 0); + std::string decl("mutable " + p.declType()); + if (p.isPointer()) + decl.append("*"); + decl.append(" "); + decl.append(retParamName); + Poco::CppParser::Variable* pVarInt = new Poco::CppParser::Variable(decl, _pStruct); + pVarInt->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + } + _cacheVariableSet |= enableCachingForThisMethod; +} + + +void ProxyGenerator::registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e) +{ + //we don't want any code for constructor and destructor + e.registerCallback(_pStruct->name(), &ProxyGenerator::constructorCodeGen); + e.registerCallback("~"+_pStruct->name(), &ProxyGenerator::destructorCodeGen); + e.registerCallback("remoting__typeId", &AbstractGenerator::typeIdCodeGen); + e.registerCallback("remoting__enableEvents", &ProxyGenerator::remotingEventsCodeGen); + + std::vector::const_iterator it = _outerEventFunctions.begin(); + for (; it != _outerEventFunctions.end(); ++it) + e.registerCallback(*it, &ProxyGenerator::eventCodeGen); + + // for all other methods we want the serializing implementation + e.registerDefaultCallback(&ProxyGenerator::serializeCodeGen); + e.registerPostClassCallback(&ProxyGenerator::staticMembersInitializer); +} + + +std::vector ProxyGenerator::newBaseClasses(const Poco::CppParser::Struct* pStruct) +{ + // we extend from Proxy and from the Interface + std::vector bases; + bases.push_back(InterfaceGenerator::generateQualifiedClassName(nameSpace(), pStruct)); + bases.push_back("Poco::RemotingNG::Proxy"); + return bases; +} + + +void ProxyGenerator::serializeCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + OrderedParameters attrs; + OrderedParameters elems; + std::set nsSet; + doElemAttrSplit(pFunc, attrs, elems, nsSet); + std::map nsIdx; + + gen.writeMethodImplementation("using namespace std::string_literals;\n"); + + //static std::string REMOTING__NAMES[] = {"create"s, "protocol"s, "endPoint"s}; // methodName followed by param names, followed by other than default namespaces + std::string staticIds = ProxyGenerator::generateStaticIdString(pFunc, nsSet, attrs, elems, nsIdx); + gen.writeMethodImplementation(staticIds); + + std::map outParams; + detectOutParams(pFunc, outParams); + Poco::CodeGeneration::CodeGenerator::Properties classProperties; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pStruct, classProperties); + if (classProperties.find(Poco::CodeGeneration::Utility::CACHING) != classProperties.end()) + throw Poco::InvalidArgumentException("cacheResult property is not allowed on class level!"); + + Poco::CodeGeneration::CodeGenerator::Properties methodProperties(classProperties); + Poco::CodeGeneration::GeneratorEngine::parseProperties(pFunc, methodProperties); + + bool hasReturnParam = pFunc->getReturnParameter() != Poco::CodeGeneration::Utility::TYPE_VOID && !pFunc->getReturnParameter().empty(); + bool isOneWay = outParams.empty() && !hasReturnParam && (methodProperties.find(Poco::CodeGeneration::Utility::ONEWAY) != methodProperties.end()); + + Poco::CodeGeneration::CodeGenerator::Properties::const_iterator itSync = methodProperties.find(Poco::CodeGeneration::Utility::SYNCHRONIZED); + if (itSync != methodProperties.end() && (itSync->second == Utility::VAL_TRUE || itSync->second.empty() || itSync->second == "all" || itSync->second == "proxy")) + gen.writeMethodImplementation("Poco::FastMutex::ScopedLock remoting__lock(remoting__mutex());"); + + Poco::CodeGeneration::CodeGenerator::Properties::const_iterator itCache = methodProperties.find(Poco::CodeGeneration::Utility::CACHING); + // now check if we have sth cached and if the property is set + bool useCache = (itCache != methodProperties.end() && itCache->second != Utility::VAL_FALSE); + Poco::CodeGeneration::CodeGenerator::Properties::const_iterator itEvent = methodProperties.find("event"); + bool isEvent = (itEvent != methodProperties.end()); + Poco::CodeGeneration::CodeGenerator::Properties::const_iterator itExp = methodProperties.find(Utility::CACHEEXPIRETIME); + bool cacheCanExpire = true; + std::string expireTimeStr; + if (itExp != methodProperties.end()) + { + cacheCanExpire = (itExp->second != Utility::VAL_INFINITE); + expireTimeStr = itExp->second; + } + + if (useCache && !isOneWay) + writeCachingBlock(pFunc, gen, cacheCanExpire); + + writeSerializingBlock(pFunc, attrs, elems, nsIdx, gen, isOneWay, isEvent); + + Poco::UInt64 expireTime = 0; + if (cacheCanExpire && !expireTimeStr.empty()) + { + expireTime = GenUtility::parseExpireTime(expireTimeStr); + // we need expireTime in millisecs not micro! + expireTime /= 1000; + } + writeDeserializingBlock(pFunc, attrs, elems, nsIdx, gen, isOneWay, useCache, cacheCanExpire, expireTime, isEvent); +} + + +void ProxyGenerator::constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ +} + + +void ProxyGenerator::destructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + ProxyGenerator* pProxy = dynamic_cast(pAGen); + poco_check_ptr (pProxy); + + if (!pProxy->_events.empty()) + { + gen.writeMethodImplementation("if (_pEventListener)"); + gen.writeMethodImplementation("{"); + gen.writeMethodImplementation("\ttry"); + gen.writeMethodImplementation("\t{"); + gen.writeMethodImplementation("\t\t_pEventListener->unsubscribeFromEvents(_pEventSubscriber);"); + gen.writeMethodImplementation("\t}"); + gen.writeMethodImplementation("\tcatch (...)"); + gen.writeMethodImplementation("\t{"); + gen.writeMethodImplementation("\t}"); + gen.writeMethodImplementation("\t_pEventSubscriber.reset();"); + gen.writeMethodImplementation("\t_pEventListener.reset();"); + gen.writeMethodImplementation("}"); + } +} + + +void ProxyGenerator::staticMembersInitializer(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + std::string code("const std::string "); + code.append(pStruct->name()); + code.append("::DEFAULT_NS"); + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pStruct, structProps); + std::string defNS; + GeneratorEngine::getStringProperty(structProps, Utility::NAMESPACE, defNS); + if (!defNS.empty()) + { + code.append("(\""); + code.append(defNS); + code.append("\")"); + } + code.append(";"); + gen.writeImplementation(code); +} + + +std::string ProxyGenerator::generateStaticIdString(const Poco::CppParser::Function* pFunc, const std::set& nameSpaces, OrderedParameters& attrs, OrderedParameters& elems, std::map& nsIndex) +{ + std::set::const_iterator itNS = nameSpaces.begin(); + std::set::const_iterator itNSEnd = nameSpaces.end(); + nsIndex.clear(); + int firstNSIdx = static_cast(attrs.size()+elems.size()+1); + for (; itNS != itNSEnd; ++itNS, ++firstNSIdx) + { + nsIndex.insert(std::make_pair(*itNS, firstNSIdx)); + } + std::string staticIds("static const std::string REMOTING__NAMES[] = {\""); + std::string aName(GenUtility::getMethodName(pFunc)); + staticIds.append(aName); + staticIds.append("\"s,"); + + OrderedParameters::iterator it = attrs.begin(); + OrderedParameters::iterator itEnd = attrs.end(); + + int namePos = 1; + for (; it != itEnd; ++it, ++namePos) + { + SerializerGenerator::appendStaticVarName(it->second.name, staticIds); + /// set nameId and nameSpaceId + std::map::const_iterator itIdx = nsIndex.find(it->second.nameSpace); + if (itIdx != nsIndex.end()) + { + it->second.nameSpacePos = itIdx->second; + } + else + it->second.nameSpacePos = -1; + it->second.namePos = namePos; + } + it = elems.begin(); + itEnd = elems.end(); + for (; it != itEnd; ++it, ++namePos) + { + SerializerGenerator::appendStaticVarName(it->second.name, staticIds); + /// set nameId and nameSpaceId + std::map::const_iterator itIdx = nsIndex.find(it->second.nameSpace); + if (itIdx != nsIndex.end()) + { + it->second.nameSpacePos = itIdx->second; + } + else + it->second.nameSpacePos = -1; + it->second.namePos = namePos; + } + + // add namespaces + itNS = nameSpaces.begin(); + itNSEnd = nameSpaces.end(); + for (; itNS != itNSEnd; ++itNS) + { + SerializerGenerator::appendStaticVarName(*itNS, staticIds); + } + if (staticIds[staticIds.size() -1] == ',') + { + staticIds[staticIds.size() -1] = '}'; + staticIds.append(";"); + } + else + staticIds.append("};"); + + return staticIds; +} + + +void ProxyGenerator::writeCachingBlock(const Poco::CppParser::Function* pFunc, CodeGenerator& gen, bool cacheCanExpire) +{ + static std::string indent("\t"); + if (!hasAnyOutParams(pFunc)) + return; + + std::string prefix("\t"); + if (cacheCanExpire) + { + gen.writeMethodImplementation("if (_cache.has(REMOTING__NAMES[0]))"); + } + else + { + gen.writeMethodImplementation("if (" + generateFunctResultName(pFunc) + ")"); + } + gen.writeMethodImplementation("{"); + // return all outParams, and the ret Param + std::map outParams; + detectOutParams(pFunc, outParams); + std::map::const_iterator itParams = outParams.begin(); + std::map::const_iterator itParamsEnd = outParams.end(); + for (; itParams != itParamsEnd; ++itParams) + { + std::string setLine(itParams->second->name()); + setLine.append("= "); + setLine.append(generateOutParamName(itParams->second, pFunc->name())); + setLine.append(";"); + gen.writeMethodImplementation(prefix+setLine); + } + std::string returnParam = generateRetParamName(pFunc); + + if (!returnParam.empty()) + { + gen.writeMethodImplementation(prefix+"return " + returnParam + ";"); + } + else + gen.writeMethodImplementation(prefix+"return;"); + + gen.writeMethodImplementation("}"); +} + + +void ProxyGenerator::writeSerializingBlock(const Poco::CppParser::Function* pFunc, const OrderedParameters& attrs, const OrderedParameters& elems, const std::map& nsIdx, CodeGenerator& gen, bool isOneWay, bool isEvent) +{ + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pFunc->nameSpace(), structProps); + CodeGenerator::Properties funcProps(structProps); + GeneratorEngine::parseProperties(pFunc, funcProps); + std::string structDefaultNS; + GeneratorEngine::getStringProperty(structProps, Utility::NAMESPACE, structDefaultNS); + std::string funcDefaultNS(structDefaultNS); + GeneratorEngine::getStringProperty(funcProps, Utility::NAMESPACE, funcDefaultNS); + std::string action; + GeneratorEngine::getStringProperty(funcProps, Utility::ACTION, action); + std::string request; + GeneratorEngine::getStringProperty(funcProps, Utility::REQUEST, request); + std::string reply; + GeneratorEngine::getStringProperty(funcProps, Utility::REPLY, reply); + std::string fault; + GeneratorEngine::getStringProperty(funcProps, Utility::FAULT, fault); + + int funcNsIdx = -1; + if (!funcDefaultNS.empty()) + { + if (funcDefaultNS == structDefaultNS) + { + gen.writeMethodImplementation("const std::string& remoting__namespace(DEFAULT_NS);"); + } + else + { + std::map::const_iterator itNS = nsIdx.find(funcDefaultNS); + poco_assert_dbg (itNS != nsIdx.end()); + std::string code("const std::string& remoting__namespace(REMOTING__NAMES["); + funcNsIdx = itNS->second; + code.append(Poco::NumberFormatter::format(itNS->second)); + code.append("]);"); + gen.writeMethodImplementation(code); + } + } + + gen.writeMethodImplementation("Poco::RemotingNG::Transport& remoting__trans = remoting__transport();"); + + if (!funcDefaultNS.empty()) + { + gen.writeMethodImplementation("remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace);"); + } + if (!action.empty()) + { + gen.writeMethodImplementation("remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_ACTION, \"" + action + "\"s);"); + } + if (!request.empty()) + { + gen.writeMethodImplementation("remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_REQUEST, \"" + request + "\"s);"); + } + if (!reply.empty()) + { + gen.writeMethodImplementation("remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_REPLY, \"" + reply + "\"s);"); + } + if (!fault.empty()) + { + gen.writeMethodImplementation("remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_FAULT, \"" + fault + "\"s);"); + } + + std::string structContentType; + GeneratorEngine::getStringProperty(structProps, Utility::CONSUMES, structContentType); + std::string funcContentType(structContentType); + GeneratorEngine::getStringProperty(funcProps, Utility::CONSUMES, funcContentType); + if (!funcContentType.empty()) + { + gen.writeMethodImplementation("remoting__trans.setAttribute(Poco::RemotingNG::SerializerBase::PROP_CONTENT_TYPE, \"" + funcContentType + "\"s);"); + } + + if (isOneWay) + { + // invoke oneway + gen.writeMethodImplementation("Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginMessage(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST);"); + } + else + { + gen.writeMethodImplementation("Poco::RemotingNG::Serializer& remoting__ser = remoting__trans.beginRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST);"); + } + + if (!funcDefaultNS.empty()) + { + gen.writeMethodImplementation("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, remoting__namespace);"); + } + + std::string structPath; + GeneratorEngine::getStringProperty(structProps, Utility::PATH, structPath); + std::string funcPath(structPath); + GeneratorEngine::getStringProperty(funcProps, Utility::PATH, funcPath); + if (!funcPath.empty()) + { + std::string line("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PATH, \""); + line.append(funcPath); + line.append("\"s);"); + gen.writeMethodImplementation(line); + } + + if (!funcContentType.empty()) + { + std::string line("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_CONSUMES, \""); + line.append(funcContentType); + line.append("\"s);"); + gen.writeMethodImplementation(line); + } + + // write attrs before serializeRequest + OrderedParameters::const_iterator itOP = attrs.begin(); + OrderedParameters::const_iterator itOPEnd = attrs.end(); + for (; itOP != itOPEnd; ++itOP) + { + if (itOP->second.direction != "out") + { + std::string code("remoting__ser.pushAttribute("); + if (itOP->second.nameSpacePos < 0) + { + code.append("DEFAULT_NS, "); + } + else + { + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itOP->second.nameSpacePos)); + code.append("], "); + } + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itOP->second.namePos)); + code.append("]);"); + gen.writeMethodImplementation(code); + } + } + + OrderedParameters::const_iterator itElem = elems.begin(); + OrderedParameters::const_iterator itElemEnd = elems.end(); + for (; itElem != itElemEnd; ++itElem) + { + if (itElem->second.direction != "out") + { + std::string elemStr; + GeneratorEngine::getStringProperty(funcProps, "$" + itElem->second.varName, elemStr); + if (!elemStr.empty()) + { + CodeGenerator::Properties elemProps; + GeneratorEngine::parseElementProperties(elemStr, elemProps); + bool header = false; + GeneratorEngine::getBoolProperty(elemProps, GenUtility::ATTR_HEADER, header); + + if (header) + { + std::string code("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_HEADER, "); + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itElem->second.namePos)); + code.append("]);"); + gen.writeMethodImplementation(code); + } + } + } + } + + std::string messageType(isEvent ? "EVENT" : "REQUEST"); + gen.writeMethodImplementation("remoting__ser.serializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + + writeTypeSerializer(pFunc, attrs, true, funcNsIdx, gen); + writeTypeSerializer(pFunc, elems, false, funcNsIdx, gen); + + gen.writeMethodImplementation("remoting__ser.serializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + + if (!funcContentType.empty()) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_CONSUMES);"); + } + if (!funcPath.empty()) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PATH);"); + } + if (!funcDefaultNS.empty()) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE);"); + } +} + + +void ProxyGenerator::writeTypeSerializer(const Poco::CppParser::Function* pFunc, const OrderedParameters& params, bool isAttr, int funcNsIdx, CodeGenerator& gen) +{ + CodeGenerator::Properties funcProps; + GeneratorEngine::parseProperties(pFunc, funcProps); + + OrderedParameters::const_iterator itOP = params.begin(); + OrderedParameters::const_iterator itOPEnd = params.end(); + int lastNS = funcNsIdx; + for (; itOP != itOPEnd; ++itOP) + { + if (itOP->second.direction != "out") + { + poco_check_ptr (itOP->second.pParam); + if (!isAttr && lastNS != itOP->second.nameSpacePos) + { + if (lastNS != funcNsIdx) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE);"); + } + std::string code("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itOP->second.nameSpacePos)); + code.append("]);"); + gen.writeMethodImplementation(code); + lastNS = itOP->second.nameSpacePos; + } + + std::string location; + std::string format; + std::string contentType; + std::string length; + std::string xsdType; + std::string propStr; + GeneratorEngine::getStringProperty(funcProps, "$" + itOP->second.varName, propStr); + if (!propStr.empty()) + { + CodeGenerator::Properties paramProps; + GeneratorEngine::parseElementProperties(propStr, paramProps); + GeneratorEngine::getStringProperty(paramProps, Utility::IN, location); + GeneratorEngine::getStringProperty(paramProps, Utility::FORMAT, format); + GeneratorEngine::getStringProperty(paramProps, Utility::CONTENT_TYPE, contentType); + GeneratorEngine::getStringProperty(paramProps, Utility::LENGTH, length); + GeneratorEngine::getStringProperty(paramProps, Utility::XSDTYPE, xsdType); + } + if (!location.empty()) + { + gen.writeMethodImplementation("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, \"" + location + "\"s);"); + } + if (!format.empty()) + { + gen.writeMethodImplementation("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT, \"" + format + "\"s);"); + } + if (!contentType.empty()) + { + gen.writeMethodImplementation("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_CONTENT_TYPE, \"" + contentType + "\"s);"); + } + if (!length.empty()) + { + gen.writeMethodImplementation("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LENGTH, \"" + length + "\"s);"); + } + if (!xsdType.empty()) + { + gen.writeMethodImplementation("remoting__ser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_XSDTYPE, \"" + xsdType + "\"s);"); + } + + std::string serLine("Poco::RemotingNG::TypeSerializer<"); + std::string type(Poco::CodeGeneration::Utility::resolveType(pFunc->nameSpace(), itOP->second.pParam->declType())); + Poco::CppParser::Symbol* pSym = pFunc->nameSpace()->lookup(type); + + bool enumMode = false; + std::string enumBaseType; + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_ENUM) + { + enumMode = true; + enumBaseType = static_cast(pSym)->baseType(); + if (enumBaseType.empty()) enumBaseType = "int"; + type = enumBaseType; + } + serLine.append(type); + if (itOP->second.pParam->isPointer()) + serLine.append("*"); + serLine.append(">::serialize(REMOTING__NAMES["); + + serLine.append(Poco::NumberFormatter::format(itOP->second.namePos)); + serLine.append("], "); + if (enumMode) + serLine.append(Poco::format("static_cast<%s>(%s)", enumBaseType, itOP->second.varName)); + else + serLine.append(itOP->second.varName); + serLine.append(", remoting__ser);"); + gen.writeMethodImplementation(serLine); + + if (!location.empty()) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION);"); + } + if (!format.empty()) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT);"); + } + if (!contentType.empty()) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_CONTENT_TYPE);"); + } + if (!length.empty()) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LENGTH);"); + } + if (!xsdType.empty()) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_XSDTYPE);"); + } + } + } + if (!isAttr && lastNS != funcNsIdx) + { + gen.writeMethodImplementation("remoting__ser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE);"); + } +} + + +void ProxyGenerator::writeDeserializingBlock(const Poco::CppParser::Function* pFunc, const OrderedParameters& attrs, const OrderedParameters& elems, const std::map& nsIdx, CodeGenerator& gen, bool isOneWay, bool useCache, bool cacheCanExpire, Poco::UInt64 expireTime, bool isEvent) +{ + if (isOneWay) + { + gen.writeMethodImplementation("remoting__trans.sendMessage(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST);"); + } + else + { + gen.writeMethodImplementation("Poco::RemotingNG::Deserializer& remoting__deser = remoting__trans.sendRequest(remoting__objectId(), remoting__typeId(), REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_REQUEST);"); + std::map outParams; + detectOutParams(pFunc, outParams); + + writePrepareAttribute(attrs, outParams, "", gen); + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pFunc->nameSpace(), structProps); + CodeGenerator::Properties funcProps; + GeneratorEngine::parseProperties(pFunc, funcProps); + + std::string structDefaultNS; + GeneratorEngine::getStringProperty(structProps, Utility::NAMESPACE, structDefaultNS); + std::string funcDefaultNS(structDefaultNS); + GeneratorEngine::getStringProperty(funcProps, Utility::NAMESPACE, funcDefaultNS); + + if (!funcDefaultNS.empty()) + { + if (funcDefaultNS == structDefaultNS) + gen.writeMethodImplementation("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, DEFAULT_NS);"); + else + { + std::map::const_iterator itNS = nsIdx.find(funcDefaultNS); + poco_assert_dbg (itNS != nsIdx.end()); + std::string code("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE, REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itNS->second)); + code.append("]);"); + gen.writeMethodImplementation(code); + } + } + + std::string structContentType; + GeneratorEngine::getStringProperty(structProps, Utility::PRODUCES, structContentType); + std::string funcContentType(structContentType); + GeneratorEngine::getStringProperty(funcProps, Utility::PRODUCES, funcContentType); + if (!funcContentType.empty()) + { + std::string line("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_PRODUCES, \""); + line.append(funcContentType); + line.append("\"s);"); + gen.writeMethodImplementation(line); + } + + OrderedParameters::const_iterator itElem = elems.begin(); + OrderedParameters::const_iterator itElemEnd = elems.end(); + for (; itElem != itElemEnd; ++itElem) + { + if (itElem->second.direction != "in") + { + std::string elemStr; + GeneratorEngine::getStringProperty(funcProps, "$" + itElem->second.varName, elemStr); + if (!elemStr.empty()) + { + CodeGenerator::Properties elemProps; + GeneratorEngine::parseElementProperties(elemStr, elemProps); + bool header = false; + GeneratorEngine::getBoolProperty(elemProps, GenUtility::ATTR_HEADER, header); + + if (header) + { + std::string code("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_HEADER, "); + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itElem->second.namePos)); + code.append("]);"); + gen.writeMethodImplementation(code); + } + } + } + } + + std::string name(GenUtility::getMethodName(pFunc)); + std::string responseName(GenUtility::getReplyMethodName(pFunc)); + std::string messageType(isEvent ? "EVENT" : "REPLY"); + if (name != responseName) + { + gen.writeMethodImplementation("static const std::string REMOTING__REPLY_NAME(\"" + responseName + "\");"); + gen.writeMethodImplementation("remoting__deser.deserializeMessageBegin(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + else + { + gen.writeMethodImplementation("remoting__deser.deserializeMessageBegin(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + + writeTypeDeserializers(pFunc, attrs, outParams, useCache, "", gen); + + std::string retParamName(generateRetParamName(pFunc)); + bool hasReturnParam = !retParamName.empty(); + writeDeserializeReturnParam(pFunc, gen); + + writeTypeDeserializers(pFunc, elems, outParams, useCache, "", gen); + if (name != responseName) + { + gen.writeMethodImplementation("remoting__deser.deserializeMessageEnd(REMOTING__REPLY_NAME, Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + else + { + gen.writeMethodImplementation("remoting__deser.deserializeMessageEnd(REMOTING__NAMES[0], Poco::RemotingNG::SerializerBase::MESSAGE_" + messageType + ");"); + } + + // notify the cache about the update + if (useCache) + { + if (cacheCanExpire) + { + std::string cacheAdd("_cache.add(REMOTING__NAMES[0], Poco::ExpirationDecorator(0, "); + + // set 1 billion as limit 1.000.000.000 + // yes, we could split it up in 32bits values but then we have to be careful with appending u at the end of the constants, + // so we don't + if (expireTime > 1000000000) + { + // we can't write an Int64 constant in a platform independent way + // compose it of 32bits + cacheAdd.append("((Poco::Timespan::TimeDiff)"); + std::vector fragments; + Poco::Timespan::TimeDiff val(expireTime); + while (val > 1000000000) + { + fragments.push_back(static_cast(val%1000000000)); + val /= 1000000000; + } + //write val, even if it is zero + std::string expireString = Poco::NumberFormatter::format(val); + cacheAdd.append(expireString+")"); // close the cast bracket + poco_assert (!fragments.empty()); + std::vector ::const_iterator it = fragments.end(); + + do + { + --it; + expireString = Poco::NumberFormatter::format(*it); + cacheAdd.append("*"); + cacheAdd.append(expireString); + } + while (it != fragments.begin()); + cacheAdd.append("));"); + } + else + { + std::string expireString = Poco::NumberFormatter::format(expireTime); + cacheAdd.append(expireString); + cacheAdd.append("));"); + } + gen.writeMethodImplementation(cacheAdd); + } + else + gen.writeMethodImplementation(generateFunctResultName(pFunc)+ " = true;"); + } + + if (!funcContentType.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_PRODUCES);"); + } + if (!funcDefaultNS.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_NAMESPACE);"); + } + gen.writeMethodImplementation("remoting__trans.endRequest();"); + if (hasReturnParam) + { + gen.writeMethodImplementation(Utility::RETURN + " " + retParamName + ";"); + } + } +} + + +void ProxyGenerator::writeTypeDeserializers(const Poco::CppParser::Function* pFunc, + const OrderedParameters& params, + const std::map& outParams, + bool useCache, + const std::string& indentation, + CodeGenerator& gen) +{ + CodeGenerator::Properties funcProps; + GeneratorEngine::parseProperties(pFunc, funcProps); + + OrderedParameters::const_iterator itOP = params.begin(); + OrderedParameters::const_iterator itOPEnd = params.end(); + + for (; itOP != itOPEnd; ++itOP) + { + if (itOP->second.direction != "in") + { + poco_check_ptr (itOP->second.pParam); + const Poco::CppParser::Parameter* pParam = itOP->second.pParam; + std::map::const_iterator itD = outParams.find(pParam->name()); + if (itD != outParams.end()) + { + std::string location; + std::string format; + std::string contentType; + std::string length; + std::string xsdType; + std::string propStr; + GeneratorEngine::getStringProperty(funcProps, "$" + itOP->second.varName, propStr); + if (!propStr.empty()) + { + CodeGenerator::Properties paramProps; + GeneratorEngine::parseElementProperties(propStr, paramProps); + GeneratorEngine::getStringProperty(paramProps, Utility::IN, location); + GeneratorEngine::getStringProperty(paramProps, Utility::FORMAT, format); + GeneratorEngine::getStringProperty(paramProps, Utility::CONTENT_TYPE, contentType); + GeneratorEngine::getStringProperty(paramProps, Utility::LENGTH, length); + GeneratorEngine::getStringProperty(paramProps, Utility::XSDTYPE, xsdType); + } + if (!location.empty()) + { + gen.writeMethodImplementation("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, \"" + location + "\"s);"); + } + if (!format.empty()) + { + gen.writeMethodImplementation("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT, \"" + format + "\"s);"); + } + if (!contentType.empty()) + { + gen.writeMethodImplementation("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_CONTENT_TYPE, \"" + contentType + "\"s);"); + } + if (!length.empty()) + { + gen.writeMethodImplementation("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LENGTH, \"" + length + "\"s);"); + } + if (!xsdType.empty()) + { + gen.writeMethodImplementation("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_XSDTYPE, \"" + xsdType + "\"s);"); + } + + std::string retType(Poco::CodeGeneration::Utility::resolveType(pFunc->nameSpace(), itD->second->declType())); + bool isOutParam = (itD->second->isReference()||itD->second->isPointer()) && !itD->second->isConst(); + poco_assert (isOutParam); + Poco::CppParser::Symbol* pSym = pFunc->nameSpace()->lookup(retType); + bool enumMode = false; + std::string enumBaseType; + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_ENUM) + { + enumMode = true; + enumBaseType = static_cast(pSym)->baseType(); + if (enumBaseType.empty()) enumBaseType = "int"; + } + std::string cntStr(Poco::NumberFormatter::format(itOP->second.namePos)); + std::string codeLine("Poco::RemotingNG::TypeDeserializer<"); + if (enumMode) + codeLine.append(enumBaseType); + else + codeLine.append(retType); + codeLine.append(">::deserialize(REMOTING__NAMES["); + codeLine.append(cntStr); + codeLine.append("], "); + if (itOP->second.mandatory) + codeLine.append("true, "); + else + codeLine.append("false, "); + codeLine.append("remoting__deser, " ); + if (enumMode) + { + gen.writeMethodImplementation(Poco::format("%s%s remoting__%sTmp;", indentation, enumBaseType, itOP->second.varName)); + codeLine.append("remoting__" + itOP->second.varName + "Tmp"); + } + else + { + codeLine.append(itOP->second.varName); + } + codeLine.append(");"); + gen.writeMethodImplementation(indentation+codeLine); + // assign the result + if (enumMode) + { + gen.writeMethodImplementation(indentation + itOP->second.varName + " = static_cast<" + retType + ">(remoting__" + itOP->second.varName + "Tmp);"); + } + if (useCache) + { + std::string cacheName (generateOutParamName(itD->second, pFunc->name())); + gen.writeMethodImplementation(indentation+cacheName + "= "+ itD->second->name() + ";"); + } + if (!location.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION);"); + } + if (!format.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT);"); + } + if (!contentType.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_CONTENT_TYPE);"); + } + if (!length.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LENGTH);"); + } + if (!xsdType.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_XSDTYPE);"); + } + } + } + } +} + + +void ProxyGenerator::writeDeserializeReturnParam(const Poco::CppParser::Function* pFunc, CodeGenerator& gen) +{ + std::string retParamName(generateRetParamName(pFunc)); + bool hasReturnParam = !retParamName.empty(); + + // always get the return param first + if (hasReturnParam) + { + CodeGenerator::Properties funcProps; + GeneratorEngine::parseProperties(pFunc, funcProps); + + std::string format; + std::string location; + std::string contentType; + std::string length; + std::string xsdType; + std::string propStr; + GeneratorEngine::getStringProperty(funcProps, GenUtility::ATTR_RETURN, propStr); + if (!propStr.empty()) + { + CodeGenerator::Properties paramProps; + GeneratorEngine::parseElementProperties(propStr, paramProps); + GeneratorEngine::getStringProperty(paramProps, Utility::IN, location); + GeneratorEngine::getStringProperty(paramProps, Utility::FORMAT, format); + GeneratorEngine::getStringProperty(paramProps, Utility::CONTENT_TYPE, contentType); + GeneratorEngine::getStringProperty(paramProps, Utility::LENGTH, length); + GeneratorEngine::getStringProperty(paramProps, Utility::XSDTYPE, xsdType); + } + if (!location.empty()) + { + gen.writeMethodImplementation("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION, \"" + location + "\"s);"); + } + if (!format.empty()) + { + gen.writeMethodImplementation("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT, \"" + format + "\"s);"); + } + if (!contentType.empty()) + { + gen.writeMethodImplementation("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_CONTENT_TYPE, \"" + contentType + "\"s);"); + } + if (!length.empty()) + { + gen.writeMethodImplementation("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_LENGTH, \"" + length + "\"s);"); + } + if (!xsdType.empty()) + { + gen.writeMethodImplementation("remoting__deser.pushProperty(Poco::RemotingNG::SerializerBase::PROP_XSDTYPE, \"" + xsdType + "\"s);"); + } + + std::string retParamType(GenUtility::getResolvedReturnParameterType(pFunc->nameSpace(), pFunc)); + Poco::CppParser::Parameter retParam(pFunc->getReturnParameter() + " dummy", 0); + bool needsClear = (GenUtility::isVectorType(pFunc->nameSpace(), &retParam) + || GenUtility::isNullableType(pFunc->nameSpace(), &retParam) + || GenUtility::isOptionalType(pFunc->nameSpace(), &retParam)) + && !GenUtility::isArrayType(pFunc->nameSpace(), &retParam) + && !GenUtility::isStdOptionalType(pFunc->nameSpace(), &retParam); + bool needsReset = GenUtility::isStdOptionalType(pFunc->nameSpace(), &retParam); + + if (needsClear) + { + gen.writeMethodImplementation(retParamName+".clear();"); + } + else if (needsReset) + { + gen.writeMethodImplementation(retParamName+".reset();"); + } + std::string retName (GenUtility::getReturnParameterName(pFunc)); + if (retName != Poco::RemotingNG::SerializerBase::RETURN_PARAM) + { + // static const std::string REMOTING__RETURN_PARAM_NAME("$retName") + std::string line("static const std::string REMOTING__RETURN_PARAM_NAME(\""); + line.append(retName); + line.append("\");"); + gen.writeMethodImplementation(line); + } + Poco::CppParser::Symbol* pSym = pFunc->nameSpace()->lookup(retParamType); + bool enumMode = false; + std::string enumBaseType; + if (pSym && pSym->kind() == Poco::CppParser::Symbol::SYM_ENUM) + { + enumMode = true; + enumBaseType = static_cast(pSym)->baseType(); + if (enumBaseType.empty()) enumBaseType = "int"; + } + else + { + retParamType = retParam.declType(); + } + std::string line("Poco::RemotingNG::TypeDeserializer<"); + if (enumMode) + line.append(enumBaseType); + else + line.append(retParamType); + if (retParam.isPointer()) + line.append("*"); + bool doInline = GenUtility::getInlineReturnParam(pFunc); + if (doInline) + line.append(">::deserializeImpl("); + else + line.append(">::deserialize("); + if (retName == Poco::RemotingNG::SerializerBase::RETURN_PARAM) + line.append("Poco::RemotingNG::SerializerBase::RETURN_PARAM"); + else + line.append("REMOTING__RETURN_PARAM_NAME"); + line.append(", true, remoting__deser, "); + if (enumMode) + { + gen.writeMethodImplementation("int remoting__tmpReturn;"); + line.append("remoting__tmpReturn);"); + gen.writeMethodImplementation(line); + gen.writeMethodImplementation(retParamName + " = static_cast<" + retParamType + ">(remoting__tmpReturn);"); + } + else + { + line.append(retParamName +");"); + gen.writeMethodImplementation(line); + } + if (!location.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LOCATION);"); + } + if (!format.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_FORMAT);"); + } + if (!contentType.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_CONTENT_TYPE);"); + } + if (!length.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_LENGTH);"); + } + if (!xsdType.empty()) + { + gen.writeMethodImplementation("remoting__deser.popProperty(Poco::RemotingNG::SerializerBase::PROP_XSDTYPE);"); + } + } +} + + +void ProxyGenerator::writePrepareAttribute(const OrderedParameters& attrs, const std::map& outParams, const std::string& indentation, CodeGenerator& gen) +{ + OrderedParameters::const_iterator itAttrs = attrs.begin(); + OrderedParameters::const_iterator itAttrsEnd = attrs.end(); + for (; itAttrs != itAttrsEnd; ++itAttrs) + { + if (outParams.find(itAttrs->second.pParam->name()) != outParams.end()) + { + //deser.pushAttribute(ns, name, bool) + std::string code("remoting__deser.pushAttribute("); + if (itAttrs->second.nameSpacePos < 0) + { + code.append("DEFAULT_NS, "); + } + else + { + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itAttrs->second.nameSpacePos)); + code.append("], "); + } + + code.append("REMOTING__NAMES["); + code.append(Poco::NumberFormatter::format(itAttrs->second.namePos)); + code.append("], "); + + if (itAttrs->second.mandatory) + code.append("true);"); + else + code.append("false);"); + + gen.writeMethodImplementation(indentation+code); + } + } +} + + +void ProxyGenerator::detectOutParams(const Poco::CppParser::Function* pFunc, std::map& outParams) +{ + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + for (; it != itEnd; ++it) + { + // add all non-const refs, add all pointers + Poco::CppParser::Parameter* pParam = *it; + if ( (pParam->isReference()||pParam->isPointer()) && !pParam->isConst()) + { + outParams.insert(std::make_pair(pParam->name(), pParam)); + } + } +} + + +bool ProxyGenerator::hasAnyOutParams(const Poco::CppParser::Function* pFunc) +{ + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + for (; it != itEnd; ++it) + { + // add all non-const refs, add all pointers + Poco::CppParser::Parameter* pParam = *it; + if ( (pParam->isReference()||pParam->isPointer()) && !pParam->isConst()) + { + return true; + } + } + return pFunc->getReturnParameter() != Poco::CodeGeneration::Utility::TYPE_VOID && !pFunc->getReturnParameter().empty(); +} + + +void ProxyGenerator::doElemAttrSplit(const Poco::CppParser::Function* pFunc, OrderedParameters& attrs, OrderedParameters& elems, std::set& nameSpaces) +{ + nameSpaces.clear(); + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + CodeGenerator::Properties structProps; + GeneratorEngine::parseProperties(pFunc->nameSpace(), structProps); + CodeGenerator::Properties funcProps(structProps); + GeneratorEngine::parseProperties(pFunc, funcProps); + Poco::UInt32 paramCnt = 0; + const Poco::UInt32 unknownOrderOffset = 0xffff0000; + std::string structDefaultNS; + GeneratorEngine::getStringProperty(structProps, Utility::NAMESPACE, structDefaultNS); + std::string funcDefaultNS(structDefaultNS); + GeneratorEngine::getStringProperty(funcProps, Utility::NAMESPACE, funcDefaultNS); + + for (; it != itEnd; ++it, ++paramCnt) + { + Poco::UInt32 order = unknownOrderOffset + paramCnt; + std::string aName((*it)->name()); + std::string aNS(funcDefaultNS); + bool mandatory = true; + std::string direction; + CodeGenerator::Properties::iterator itProp = funcProps.find("$" + aName); + + if (itProp != funcProps.end()) + { + CodeGenerator::Properties paramProps; // we need type and order + GeneratorEngine::parseElementProperties("$" + itProp->second, paramProps); + + GeneratorEngine::getStringProperty(paramProps, Utility::NAME, aName); + GeneratorEngine::getStringProperty(paramProps, Utility::NAMESPACE, aNS); + mandatory = GenUtility::getIsMandatory(paramProps); + GeneratorEngine::getStringProperty(paramProps, Utility::DIRECTION, direction); + if (!(direction.empty() || direction == "in" || direction == "out" || direction == "inout")) + throw Poco::InvalidArgumentException("direction must be one of \"in\", \"out\" or \"inout\""); + if (!aNS.empty() && aNS != structDefaultNS) + nameSpaces.insert(aNS); + + std::string type; + bool hasType = GeneratorEngine::getStringProperty(paramProps, Utility::TYPE, type); + bool isAttr = false; // the default is elem + if (hasType && type == Utility::VAL_ATTR) + isAttr = true; + + GeneratorEngine::getUInt32Property(paramProps, Utility::ORDER, order); + if (isAttr) + attrs.insert(std::make_pair(order, ExtParam((*it)->name(), aName, aNS, *it, mandatory, direction))); + else + elems.insert(std::make_pair(order, ExtParam((*it)->name(), aName, aNS, *it, mandatory, direction))); + } + else + { + elems.insert(std::make_pair(order, ExtParam((*it)->name(), aName, aNS, *it, mandatory, direction))); + } + } +} + + +void ProxyGenerator::checkForEventMembers(const Poco::CppParser::Struct* pStruct) +{ + Poco::CppParser::NameSpace::SymbolTable tbl; + pStruct->variables(tbl); + Poco::CppParser::NameSpace::SymbolTable::const_iterator it = tbl.begin(); + Poco::CppParser::NameSpace::SymbolTable::const_iterator itEnd = tbl.end(); + for (; it != itEnd; ++it) + { + Poco::CppParser::Variable* pVar = static_cast(it->second); + const std::string& varType = pVar->declType(); + if (pVar->getAccess() == Poco::CppParser::Variable::ACC_PUBLIC && !(pVar->flags() & Poco::CppParser::Variable::VAR_STATIC)) + { + if (varType.find("Poco::BasicEvent") == 0 || varType.find("Poco::FIFOEvent") == 0) + { + _events.push_back(pVar->name()); + } + } + + } + + if (_hasEvents) + { + Poco::Path file (Poco::CodeGeneration::Utility::createInclude(_pStruct, true)); + + std::string newFileName = EventSubscriberGenerator::generateClassName(_pStructIn); + file.setBaseName(newFileName); + std::string inclFile = file.toString(Poco::Path::PATH_UNIX); + _cppGen.addSrcIncludeFile(inclFile); + } +} + + +void ProxyGenerator::checkForParentEventMembers(const Poco::CppParser::Struct* pStruct) +{ + checkForParentEventMembersImpl(pStruct); + + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + for (; itB != itBEnd; ++itB) + { + const Poco::CppParser::Struct* pParent = itB->pClass; + if (pParent && Utility::hasAnyRemoteProperty(pParent)) + { + checkForParentEventMembers(pParent); + } + } +} + + +void ProxyGenerator::checkForParentEventMembersImpl(const Poco::CppParser::Struct* pStruct) +{ + Poco::CppParser::NameSpace::SymbolTable tbl; + pStruct->variables(tbl); + Poco::CppParser::NameSpace::SymbolTable::const_iterator it = tbl.begin(); + Poco::CppParser::NameSpace::SymbolTable::const_iterator itEnd = tbl.end(); + for (; it != itEnd; ++it) + { + Poco::CppParser::Variable* pVar = static_cast(it->second); + const std::string& varType = pVar->declType(); + if (pVar->getAccess() == Poco::CppParser::Variable::ACC_PUBLIC && !(pVar->flags() & Poco::CppParser::Variable::VAR_STATIC)) + { + if (varType.find("Poco::BasicEvent") == 0 || varType.find("Poco::FIFOEvent") == 0) + { + _hasEvents = true; + } + } + } +} + + +std::string ProxyGenerator::generateEventFunctionName(const std::string& eventVarname) +{ + return "event__" + Poco::trim(eventVarname); +} + + +void ProxyGenerator::eventCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + ProxyGenerator* pProxy = dynamic_cast(pAGen); + poco_check_ptr (pProxy); + + // only forward to the network if the network is not the sender + gen.writeMethodImplementation ("if (pSender) " + pFunc->name() + "Impl(var);"); +} + + +void ProxyGenerator::remotingEventsCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + ProxyGenerator* pProxy = dynamic_cast(pAGen); + poco_check_ptr (pProxy); + const Poco::CppParser::Struct* pStructIn = pProxy->_pStructIn; + poco_check_ptr (pStructIn); + + gen.writeMethodImplementation("std::string subscriberURI;"); + gen.writeMethodImplementation("if ((_pEventListener && !enable) || (!_pEventListener && enable))"); + gen.writeMethodImplementation("{"); + gen.writeMethodImplementation("\tPoco::RemotingNG::EventListener::Ptr pEventListener = pListener.cast();"); + gen.writeMethodImplementation("\tif (pEventListener)"); + gen.writeMethodImplementation("\t{"); + gen.writeMethodImplementation("\t\tif (enable)"); + gen.writeMethodImplementation("\t\t{"); + gen.writeMethodImplementation("\t\t\tstd::string eventURI = remoting__getEventURI().empty() ? remoting__getURI().toString() : remoting__getEventURI().toString();"); + std::string className = EventSubscriberGenerator::generateClassName(pStructIn); + gen.writeMethodImplementation("\t\t\t_pEventSubscriber = new " + className + "(eventURI, this);"); + gen.writeMethodImplementation("\t\t\tsubscriberURI = pEventListener->subscribeToEvents(_pEventSubscriber);"); + gen.writeMethodImplementation("\t\t\t_pEventListener = pEventListener;"); + gen.writeMethodImplementation("\t\t}"); + gen.writeMethodImplementation("\t\telse if (_pEventListener == pEventListener)"); + gen.writeMethodImplementation("\t\t{"); + gen.writeMethodImplementation("\t\t\ttry"); + gen.writeMethodImplementation("\t\t\t{"); + gen.writeMethodImplementation("\t\t\t\t_pEventListener->unsubscribeFromEvents(_pEventSubscriber);"); + gen.writeMethodImplementation("\t\t\t}"); + gen.writeMethodImplementation("\t\t\tcatch (...)"); + gen.writeMethodImplementation("\t\t\t{"); + gen.writeMethodImplementation("\t\t\t\t_pEventSubscriber.reset();"); + gen.writeMethodImplementation("\t\t\t\t_pEventListener.reset();"); + gen.writeMethodImplementation("\t\t\t\tthrow;"); + gen.writeMethodImplementation("\t\t\t}"); + gen.writeMethodImplementation("\t\t\t_pEventSubscriber.reset();"); + gen.writeMethodImplementation("\t\t\t_pEventListener.reset();"); + gen.writeMethodImplementation("\t\t}"); + gen.writeMethodImplementation("\t\telse throw Poco::RemotingNG::RemotingException(\"EventListener mismatch\");"); + gen.writeMethodImplementation("\t}"); + gen.writeMethodImplementation("\telse throw Poco::RemotingNG::RemotingException(\"Listener is not an EventListener\");"); + gen.writeMethodImplementation("}"); + gen.writeMethodImplementation("return subscriberURI;"); +} diff --git a/RemotingNG/RemoteGen/src/ProxyGenerator.h b/RemotingNG/RemoteGen/src/ProxyGenerator.h new file mode 100644 index 0000000000..a2acb15a1c --- /dev/null +++ b/RemotingNG/RemoteGen/src/ProxyGenerator.h @@ -0,0 +1,157 @@ +// +// ProxyGenerator.h +// +// Definition of the ProxyGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef RemoteGen_ProxyGenerator_INCLUDED +#define RemoteGen_ProxyGenerator_INCLUDED + + +#include "AbstractGenerator.h" +#include "Poco/CodeGeneration/CppGenerator.h" +#include + + +class ProxyGenerator: public AbstractGenerator + /// ProxyGenerator generates a proxy for a given class definition. C++ specific. +{ +public: + //static const std::string PARAM_RETURN; + struct ExtParam + { + std::string varName; + /// The original name + std::string name; + /// The name after renaming. + int namePos; + std::string nameSpace; + int nameSpacePos; + const Poco::CppParser::Parameter* pParam; + bool mandatory; + std::string direction; + ExtParam(const std::string& origName, const std::string& aName, const std::string& aNS, const Poco::CppParser::Parameter* aParam, bool isMandatory, const std::string& aDirection): + varName(origName), + name(aName), + namePos(-1), + nameSpace(aNS), + nameSpacePos(-1), + pParam(aParam), + mandatory(isMandatory), + direction(aDirection) + { + poco_check_ptr (pParam); + } + }; + + typedef std::map OrderedParameters; + /// maps orderid to a a pair of name and parameter + + ProxyGenerator(Poco::CodeGeneration::CppGenerator& cppGen); + /// Creates the ProxyGenerator. + + ~ProxyGenerator(); + /// Destroys the ProxyGenerator. + + static std::string generateClassName(const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + static std::string generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// Must not write the namespace + + void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Writes the method header. Properties contains the properties found in the functions docuementation and in the class documentation. + + void registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e); + + std::string newClassName(const Poco::CppParser::Struct* pStruct); + /// generates the new class name based on the old one + + std::vector newBaseClasses(const Poco::CppParser::Struct* pStruct); + + static std::string generateStaticIdString(const Poco::CppParser::Function* pFunc, const std::set& nameSpaces, OrderedParameters& attrs, OrderedParameters& elems, std::map& nsIndex); + /// Generates a static ids vector containing as first element the fucntion name, followed by parameter names sorted by order. Set namespacePos and namePos in attrs and elems and converts the namespaces set to a map of namespaces ->stringIdx + + static void doElemAttrSplit(const Poco::CppParser::Function* pFunc, OrderedParameters& attrs, OrderedParameters& elems, std::set& nameSpaces); + + static void writePrepareAttribute(const OrderedParameters& attrs, const std::map& outParams, const std::string& indentation, CodeGenerator& gen); + + static void detectOutParams(const Poco::CppParser::Function* pFunc, std::map& outParams); + + static void writeTypeDeserializers(const Poco::CppParser::Function* pFunc, + const OrderedParameters& params, + const std::map& outParams, + bool useCache, + const std::string& indentation, + CodeGenerator& gen); + + static bool hasAnyOutParams(const Poco::CppParser::Function* pFunc); + + static std::string generateEventFunctionName(const std::string& eventVarname); + /// generates a fct name for an event member + +private: + static void serializeCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static void eventCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static void remotingEventsCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static void constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + /// Code generator for constructor + + static void destructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + /// Code generator for destructor + + static void staticMembersInitializer(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static std::string generateOutParamName(const Poco::CppParser::Parameter* pParam, const std::string& functionName); + + static std::string generateRetParamName(const Poco::CppParser::Function* pFunc); + + static std::string generateFunctResultName(const Poco::CppParser::Function* pFunc); + + static void writeCachingBlock(const Poco::CppParser::Function* pFunc, CodeGenerator& gen, bool cacheCanExpire); + static void writeSerializingBlock(const Poco::CppParser::Function* pFunc, const OrderedParameters& attrs, const OrderedParameters& elems, const std::map& nsIdx, CodeGenerator& gen, bool isOneWay, bool isEvent); + static void writeTypeSerializer(const Poco::CppParser::Function* pFunc, const OrderedParameters& params, bool isAttr, int funcNsIdx, CodeGenerator& gen); + static void writeDeserializingBlock(const Poco::CppParser::Function* pFunc, const OrderedParameters& attrs, const OrderedParameters& elems, const std::map& nsIdx, CodeGenerator& gen, bool isOneWay, bool useCache, bool cacheCanExpire, Poco::UInt64 expireTime, bool isEvent); + /// expireTime is in microsec + + static void writeDeserializeReturnParam(const Poco::CppParser::Function* pFunc, CodeGenerator& gen); + + void checkForEventMembers(const Poco::CppParser::Struct* pStruct); + /// checks if the class or any parent contains public BasicEvents + + void checkForParentEventMembers(const Poco::CppParser::Struct* pStruct); + void checkForParentEventMembersImpl(const Poco::CppParser::Struct* pStruct); + + void methodStartImpl(Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& methodProperties); + + bool _cacheVariableSet; + std::vector _boolsToInit; + std::vector _events; + std::vector _outerEventFunctions; + std::set _functions; + bool _hasEvents; +}; + + +// +// inlines +// +inline std::string ProxyGenerator::newClassName(const Poco::CppParser::Struct* pStruct) +{ + return ProxyGenerator::generateClassName(pStruct); +} + + +#endif // RemoteGen_ProxyGenerator_INCLUDED diff --git a/RemotingNG/RemoteGen/src/RemoteBridgeGenerator.cpp b/RemotingNG/RemoteGen/src/RemoteBridgeGenerator.cpp new file mode 100644 index 0000000000..52b5b0cb05 --- /dev/null +++ b/RemotingNG/RemoteGen/src/RemoteBridgeGenerator.cpp @@ -0,0 +1,392 @@ +// +// RemoteBridgeGenerator.cpp +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "RemoteBridgeGenerator.h" +#include "InterfaceGenerator.h" +#include "EventDispatcherGenerator.h" +#include "GenUtility.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/CppGenerator.h" +#include "Poco/CppParser/Function.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/Exception.h" +#include "Poco/Path.h" +#include "Poco/String.h" +#include "Poco/Util/LayeredConfiguration.h" +#include "Poco/Util/Application.h" + + +using Poco::CodeGeneration::Utility; + + +RemoteBridgeGenerator::RemoteBridgeGenerator(Poco::CodeGeneration::CppGenerator& cppGen, bool forceSynchronized): + AbstractGenerator(cppGen), + _forceSynchronized(forceSynchronized), + _hasEvents(false) +{ +} + + +RemoteBridgeGenerator::~RemoteBridgeGenerator() +{ +} + + +std::string RemoteBridgeGenerator::generateClassName(const Poco::CppParser::Struct* pStruct) +{ + poco_assert_dbg (pStruct); + std::string newClassName(pStruct->name()); + newClassName.append("RemoteBridge"); + return newClassName; +} + + +std::string RemoteBridgeGenerator::generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct) +{ + if (ns.empty()) + return RemoteBridgeGenerator::generateClassName(pStruct); + + return ns + "::" + RemoteBridgeGenerator::generateClassName(pStruct); +} + + +void RemoteBridgeGenerator::structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + AbstractGenerator::structStart(pStruct, properties); + _codeInjectors.clear(); + // add constructor/destructor + Poco::CppParser::Function* pConstr = new Poco::CppParser::Function(_pStruct->name(), _pStruct); + //const Identifiable::ObjectId& oid + Poco::CppParser::Parameter* pParam1 = new Poco::CppParser::Parameter("const Poco::RemotingNG::Identifiable::ObjectId& oid", pConstr); + Poco::CppParser::Parameter* pParam2 = new Poco::CppParser::Parameter("Poco::AutoPtr<" + InterfaceGenerator::generateQualifiedClassName(nameSpace(), pStruct) + "> pInterface", pConstr); + pConstr->addParameter(pParam1); + pConstr->addParameter(pParam2); + + pConstr->addDocumentation( " Creates a " + _pStruct->name() + "."); + + Poco::CppParser::Function* pDestr = new Poco::CppParser::Function(std::string("virtual ~")+_pStruct->name(), _pStruct); + pDestr->addDocumentation( " Destroys the " + _pStruct->name() + "."); + + Poco::CppParser::TypeAlias* pTypeAlias = new Poco::CppParser::TypeAlias("using Ptr = Poco::AutoPtr<" + generateClassName(pStruct) + ">", _pStruct); + poco_check_ptr (pTypeAlias); // just avoid unused variable warning + + // adds the member var + _cppGen.addIncludeFile("Poco/AutoPtr.h"); + _cppGen.addIncludeFile("Poco/RemotingNG/RemoteObject.h"); + _cppGen.addIncludeFile("Poco/RemotingNG/Identifiable.h"); + Poco::CppParser::Variable* pVar = new Poco::CppParser::Variable("Poco::AutoPtr<" + InterfaceGenerator::generateQualifiedClassName(nameSpace(), pStruct) + "> _pInterface", _pStruct); + pVar->setAccess(Poco::CppParser::Symbol::ACC_PRIVATE); + // add a method virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const + Poco::CppParser::Function* pTypeId = new Poco::CppParser::Function("virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId", _pStruct); + pTypeId->makeConst(); + pTypeId->makeInline(); + + if (GenUtility::hasEvents(pStruct)) + { + Poco::CppParser::Function* pEvents = new Poco::CppParser::Function("virtual std::string remoting__enableEvents", _pStruct); + Poco::CppParser::Parameter* pParam = new Poco::CppParser::Parameter("Poco::RemotingNG::Listener::Ptr pListener", 0); + pEvents->addParameter(pParam); + pParam = new Poco::CppParser::Parameter("bool enable = true", 0); + pEvents->addParameter(pParam); + + Poco::CppParser::Function* pHasEvents = new Poco::CppParser::Function("virtual bool remoting__hasEvents", _pStruct); + pHasEvents->makeConst(); + + Poco::CppParser::Function* pRemoteEvents = new Poco::CppParser::Function("virtual void remoting__enableRemoteEvents", _pStruct); + pParam = new Poco::CppParser::Parameter("const std::string& protocol", 0); + pRemoteEvents->addParameter(pParam); + + std::string inc = Utility::createInclude(_pStruct, _cppGen.usePocoIncludeStyle()); + Poco::replaceInPlace(inc, "RemoteBridge", "EventDispatcher"); + _cppGen.addSrcIncludeFile(inc); + } + + handleParentFunctions(_pStructIn); + checkForEventMembers(pStruct, properties); +} + + +void RemoteBridgeGenerator::registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e) +{ + // for all other methods we want the simple fwd implementation + e.registerDefaultCallback(&RemoteBridgeGenerator::fwdCodeGen); + e.registerCallback(_pStruct->name(), &RemoteBridgeGenerator::constructorCodeGen); + e.registerCallback("~"+_pStruct->name(), &RemoteBridgeGenerator::destructorCodeGen); + e.registerCallback("remoting__typeId", &AbstractGenerator::typeIdCodeGen); + if (eventsFound()) + { + e.registerCallback("remoting__enableEvents", &RemoteBridgeGenerator::enableEventsCodeGen); + e.registerCallback("remoting__hasEvents", &RemoteBridgeGenerator::hasEventsCodeGen); + e.registerCallback("remoting__enableRemoteEvents", &RemoteBridgeGenerator::enableRemoteEventsCodeGen); + } + + std::vector::const_iterator itE = _events.begin(); + for (; itE != _events.end(); ++itE) + { + e.registerCallback(RemoteBridgeGenerator::generateEventFunctionName(*itE), &RemoteBridgeGenerator::eventCodeGen); + } + + // now register others + std::map::const_iterator it = _codeInjectors.begin(); + std::map::const_iterator itEnd = _codeInjectors.end(); + + for (; it != itEnd; ++it) + { + e.registerCallback(it->first, it->second); + } + _codeInjectors.clear(); +} + + +void RemoteBridgeGenerator::methodStart(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& properties) +{ + if (_functions.find(pFuncOld->name()) != _functions.end()) + return; + + if (GenUtility::isRemoteMethod(pFuncOld, properties)) + { + _functions.insert(pFuncOld->name()); + Poco::CppParser::Function* pFunc = methodClone(pFuncOld, properties); + pFunc->makeInline(); // impl is just one single line + Poco::CodeGeneration::CodeGenerator::Properties::const_iterator itSync = properties.find(Poco::CodeGeneration::Utility::SYNCHRONIZED); + if (_forceSynchronized || (itSync != properties.end() && (itSync->second == Utility::VAL_TRUE || itSync->second.empty() || itSync->second == "all" || itSync->second == "remote" || itSync->second == "bridge"))) + { + _codeInjectors.insert(std::make_pair(pFunc->name(), &RemoteBridgeGenerator::syncFwdCodeGen)); + } + else + { + _codeInjectors.insert(std::make_pair(pFunc->name(), &RemoteBridgeGenerator::fwdCodeGen)); + } + } +} + + +std::vector RemoteBridgeGenerator::newBaseClasses(const Poco::CppParser::Struct* pStruct) +{ + std::vector bases; + bases.push_back(InterfaceGenerator::generateQualifiedClassName(nameSpace(), pStruct)); + bases.push_back("Poco::RemotingNG::RemoteObject"); + return bases; +} + + +void RemoteBridgeGenerator::fwdCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + // we only write one line + // either _pInterface->method (params) or return _pInterface->method (params) + std::string codeLine; + if (pFunc->getReturnParameter() != Poco::CodeGeneration::Utility::TYPE_VOID) + { + codeLine.append(Poco::CodeGeneration::Utility::RETURN+" "); + } + codeLine.append("_pInterface->"); + codeLine.append(pFunc->name()); + codeLine.append("("); + Poco::CppParser::Function::Iterator it = pFunc->begin(); + Poco::CppParser::Function::Iterator itEnd = pFunc->end(); + + for (; it != itEnd; ++it) + { + Poco::CppParser::Parameter* pParam = *it; + Poco::CppParser::Function::Iterator itBeforeEnd = pFunc->end(); + --itBeforeEnd; + codeLine.append(pParam->name()); + if (it != itBeforeEnd) + codeLine.append(", "); + } + codeLine.append(");"); + gen.writeMethodImplementation(codeLine); +} + + +void RemoteBridgeGenerator::syncFwdCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("Poco::FastMutex::ScopedLock lock(mutex());"); + RemoteBridgeGenerator::fwdCodeGen(pFunc, pStruct, gen, addParam); +} + + +void RemoteBridgeGenerator::checkForEventMembers(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + checkForEventMembersImpl(pStruct, properties); + + Poco::CppParser::Struct::BaseIterator itB = pStruct->baseBegin(); + Poco::CppParser::Struct::BaseIterator itBEnd = pStruct->baseEnd(); + for (; itB != itBEnd; ++itB) + { + const Poco::CppParser::Struct* pParent = itB->pClass; + if (pParent && Utility::hasAnyRemoteProperty(pParent)) + { + Poco::CodeGeneration::CodeGenerator::Properties parentProperties; + Poco::CodeGeneration::GeneratorEngine::parseProperties(pParent, parentProperties); + checkForEventMembers(pParent, parentProperties); + } + } +} + + +void RemoteBridgeGenerator::checkForEventMembersImpl(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties) +{ + Poco::CppParser::NameSpace::SymbolTable tbl; + pStruct->variables(tbl); + Poco::CppParser::NameSpace::SymbolTable::const_iterator it = tbl.begin(); + Poco::CppParser::NameSpace::SymbolTable::const_iterator itEnd = tbl.end(); + for (; it != itEnd; ++it) + { + Poco::CppParser::Variable* pVar = static_cast(it->second); + Poco::CodeGeneration::CodeGenerator::Properties eventProperties(properties); + Poco::CodeGeneration::GeneratorEngine::parseProperties(pVar, eventProperties); + if (GenUtility::isRemoteEvent(pVar, eventProperties)) + { + _hasEvents = true; + _events.push_back(pVar->name()); + _cppGen.addSrcIncludeFile("Poco/RemotingNG/ORB.h"); + _cppGen.addSrcIncludeFile("Poco/Delegate.h"); + // generate a serializer method for that member too + // call methodStart(const Poco::CppParser::Function* pFuncOld, const CodeGenerator::Properties& methodProperties) + // convert the basicevent to a private function + std::string funcDecl("void "); + std::string fctName = generateEventFunctionName(pVar->name()); + funcDecl.append(fctName); + std::vector templTypes = GenUtility::getResolvedInnerTemplateTypes(pStruct, pVar->declType()); + if (templTypes.size() != 1) + throw Poco::InvalidArgumentException("Illegal remote event param: " + pVar->fullName()); + std::string paramDecl = templTypes[0]; + if (paramDecl != "void") + { + paramDecl.append("& data"); + } + Poco::CppParser::Function* pFunc = new Poco::CppParser::Function(funcDecl, _pStruct); + pFunc->setAccess(Poco::CppParser::Symbol::ACC_PROTECTED); + if (paramDecl != "void") + { + Poco::CppParser::Parameter* pParam = new Poco::CppParser::Parameter(paramDecl, 0); + pFunc->addParameter(pParam); + } + } + } +} + + +std::string RemoteBridgeGenerator::generateEventFunctionName(const std::string& eventVarname) +{ + return "event__" + Poco::trim(eventVarname); +} + + +void RemoteBridgeGenerator::constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + RemoteBridgeGenerator* pProxy = dynamic_cast(pAGen); + poco_check_ptr (pProxy); + + const Poco::CppParser::Struct* pDataType = pProxy->_pStructIn; // returns the data type for which pStruct was generated + const std::vector& events = pProxy->_events; + std::vector::const_iterator it = events.begin(); + for (; it != events.end(); ++it) + { + std::string line("_pInterface->"); + line.append(*it); + line.append(" += "); + line.append("Poco::delegate(this, &"); + line.append(RemoteBridgeGenerator::generateClassName(pDataType)); + line.append("::"); + line.append(RemoteBridgeGenerator::generateEventFunctionName(*it)); + line.append(");"); + gen.writeMethodImplementation(line); + } +} + + +void RemoteBridgeGenerator::destructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + RemoteBridgeGenerator* pProxy = dynamic_cast(pAGen); + poco_check_ptr (pProxy); + + gen.writeMethodImplementation("try"); + gen.writeMethodImplementation("{"); + const Poco::CppParser::Struct* pDataType = pProxy->_pStructIn; // returns the data type for which pStruct was generated + const std::vector& events = pProxy->_events; + std::vector::const_iterator it = events.begin(); + for (; it != events.end(); ++it) + { + std::string line("\t_pInterface->"); + line.append(*it); + line.append(" -= "); + line.append("Poco::delegate(this, &"); + line.append(RemoteBridgeGenerator::generateClassName(pDataType)); + line.append("::"); + line.append(RemoteBridgeGenerator::generateEventFunctionName(*it)); + line.append(");"); + gen.writeMethodImplementation(line); + } + gen.writeMethodImplementation("}"); + gen.writeMethodImplementation("catch (...)"); + gen.writeMethodImplementation("{"); + gen.writeMethodImplementation("\tpoco_unexpected();"); + gen.writeMethodImplementation("}"); +} + + +void RemoteBridgeGenerator::eventCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_check_ptr (addParam); + + AbstractGenerator* pAGen = reinterpret_cast(addParam); + RemoteBridgeGenerator* pProxy = dynamic_cast(pAGen); + poco_check_ptr (pProxy); + + const std::vector& events = pProxy->_events; + + std::vector::const_iterator it = events.begin(); + for (; it != events.end(); ++it) + { + std::string name = RemoteBridgeGenerator::generateEventFunctionName(*it); + if (name == pFunc->name()) + { + // jep, we found the value + if (pFunc->countParameters() == 0) // void event + gen.writeMethodImplementation(*it + "(this);"); + else + gen.writeMethodImplementation(*it + "(this, data);"); + return; + } + } +} + + +void RemoteBridgeGenerator::hasEventsCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("return true;"); +} + + +void RemoteBridgeGenerator::enableEventsCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + gen.writeMethodImplementation("return std::string();"); +} + + +void RemoteBridgeGenerator::enableRemoteEventsCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam) +{ + poco_assert (addParam); + AbstractGenerator* pAGen = reinterpret_cast(addParam); + RemoteBridgeGenerator* pGen = dynamic_cast(pAGen); + poco_check_ptr (pGen); + const Poco::CppParser::Struct* pStructIn = pGen->_pStructIn; + + gen.writeMethodImplementation("Poco::RemotingNG::EventDispatcher::Ptr pEventDispatcher = new " + EventDispatcherGenerator::generateClassName(pStructIn) + "(this, remoting__objectId(), protocol);"); + gen.writeMethodImplementation("Poco::RemotingNG::ORB::instance().registerEventDispatcher(remoting__getURI().toString(), pEventDispatcher);"); +} diff --git a/RemotingNG/RemoteGen/src/RemoteBridgeGenerator.h b/RemotingNG/RemoteGen/src/RemoteBridgeGenerator.h new file mode 100644 index 0000000000..3a870e5afe --- /dev/null +++ b/RemotingNG/RemoteGen/src/RemoteBridgeGenerator.h @@ -0,0 +1,98 @@ +// +// RemoteBridgeGenerator.h +// +// Definition of the RemoteBridgeGenerator class. +// +// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#ifndef RemoteGen_RemoteBridgeGenerator_INCLUDED +#define RemoteGen_RemoteBridgeGenerator_INCLUDED + + +#include "AbstractGenerator.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include + + +class RemoteBridgeGenerator: public AbstractGenerator + /// RemoteBridgeGenerator generates a wrapper extending RemoteObject for a given interface class definition. +{ +public: + RemoteBridgeGenerator(Poco::CodeGeneration::CppGenerator& cppGen, bool forceSynchronized = true); + /// Creates the RemoteBridgeGenerator. + + ~RemoteBridgeGenerator(); + /// Destroys the RemoteBridgeGenerator. + + static std::string generateClassName(const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + static std::string generateQualifiedClassName(const std::string& ns, const Poco::CppParser::Struct* pStruct); + /// Generates for a given class, its interface class name. + + static std::string generateEventFunctionName(const std::string& eventVarname); + + void structStart(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// Must not write the namespace + + void methodStart(const Poco::CppParser::Function* pFunc, const CodeGenerator::Properties& properties); + /// Writes the method header. Properties contains the properties found in the functions docuementation and in the class documentation. + + void registerCallbacks(Poco::CodeGeneration::GeneratorEngine& e); + + std::string newClassName(const Poco::CppParser::Struct* pStruct); + /// generates the new class name based on the old one + + std::vector newBaseClasses(const Poco::CppParser::Struct* pStruct); + + bool eventsFound() const; + /// Returns true if events were found + +private: + static void fwdCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void syncFwdCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void eventCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void hasEventsCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void enableEventsCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + static void enableRemoteEventsCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + + static void constructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + /// Code generator for constructor + + static void destructorCodeGen(const Poco::CppParser::Function* pFunc, const Poco::CppParser::Struct* pStruct, CodeGenerator& gen, void* addParam); + /// Code generator for destructor + + void checkForEventMembers(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + /// checks if the class contains public BasicEvents + + void checkForEventMembersImpl(const Poco::CppParser::Struct* pStruct, const CodeGenerator::Properties& properties); + + bool _forceSynchronized; + std::map _codeInjectors; + std::set _functions; + std::vector _events; + bool _hasEvents; +}; + + +// +// inlines +// +inline std::string RemoteBridgeGenerator::newClassName(const Poco::CppParser::Struct* pStruct) +{ + return RemoteBridgeGenerator::generateClassName(pStruct); +} + + +inline bool RemoteBridgeGenerator::eventsFound() const +{ + return _hasEvents; +} + + +#endif // RemoteGen_RemoteBridgeGenerator_INCLUDED diff --git a/RemotingNG/RemoteGen/src/RemoteGen.cpp b/RemotingNG/RemoteGen/src/RemoteGen.cpp new file mode 100644 index 0000000000..58e94026db --- /dev/null +++ b/RemotingNG/RemoteGen/src/RemoteGen.cpp @@ -0,0 +1,1151 @@ +// +// RemoteGen.cpp +// +// Copyright (c) 2006-2024, Applied Informatics Software Engineering GmbH. +// All rights reserved. +// +// License: Applied Informatics Software and Source Code License Agreement +// + + +#include "Poco/StringTokenizer.h" +#include "Poco/Path.h" +#include "Poco/String.h" +#include "Poco/File.h" +#include "Poco/Process.h" +#include "Poco/Environment.h" +#include "Poco/NumberFormatter.h" +#include "Poco/Exception.h" +#include "Poco/NullStream.h" +#include "Poco/FileStream.h" +#include "Poco/Delegate.h" +#include "Poco/Format.h" +#include "Poco/XML/XMLWriter.h" +#include "Poco/Util/Application.h" +#include "Poco/Util/Option.h" +#include "Poco/Util/OptionSet.h" +#include "Poco/Util/HelpFormatter.h" +#include "Poco/Util/AbstractConfiguration.h" +#include "Poco/Util/OptionException.h" +#include "Poco/CppParser/Parser.h" +#include "Poco/CppParser/NameSpace.h" +#include "Poco/CppParser/BuiltIn.h" +#include "Poco/CppParser/Struct.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CppParser/Utility.h" +#include "Poco/CodeGeneration/Utility.h" +#include "Poco/CodeGeneration/GeneratorEngine.h" +#include "Poco/CodeGeneration/MethodPropertyFilter.h" +#include "InterfaceGenerator.h" +#include "RemoteObjectGenerator.h" +#include "RemoteBridgeGenerator.h" +#include "ProxyGenerator.h" +#include "BundleActivatorGenerator.h" +#include "ProxyFactoryGenerator.h" +#include "SkeletonGenerator.h" +#include "ClientHelperGenerator.h" +#include "ServerHelperGenerator.h" +#include "SerializerGenerator.h" +#include "DeserializerGenerator.h" +#include "XSDGenerator.h" +#include "WSDLGenerator.h" +#include "SwaggerGenerator.h" +#include "ExtensionsGenerator.h" +#include "EventDispatcherGenerator.h" +#include "EventSubscriberGenerator.h" +#if defined(POCO_REQUIRE_LICENSE) +#include "Poco/Licensing/License.h" +#endif +#include +#include +#include + + +using Poco::StringTokenizer; +using Poco::Path; +using Poco::File; +using Poco::Process; +using Poco::ProcessHandle; +using Poco::Environment; +using Poco::NumberFormatter; +using Poco::Exception; +using Poco::format; +using Poco::Util::Application; +using Poco::Util::Option; +using Poco::Util::OptionCallback; +using Poco::Util::OptionSet; +using Poco::Util::HelpFormatter; +using Poco::Util::AbstractConfiguration; +using Poco::CppParser::NameSpace; +using Poco::CppParser::Function; +using Poco::CppParser::Struct; +using Poco::CppParser::Symbol; +using Poco::CodeGeneration::GeneratorEngine; +using Poco::CodeGeneration::MethodPropertyFilter; +using namespace std::string_literals; + + +class RemoteGenApp: public Application +{ +public: + RemoteGenApp(): + _helpRequested(false), + _noGlobalConfig(false), + _enableOSP(false), + _enableBridge(false), + _enableBridgeSync(true), + _bundlePath("bundle"), + _enableTimestamps(true) + { + Poco::CppParser::NameSpace* pNS = new Poco::CppParser::NameSpace("Poco", Poco::CppParser::NameSpace::root()); + new Poco::CppParser::BuiltIn("Int8"s, pNS); + new Poco::CppParser::BuiltIn("UInt8"s, pNS); + new Poco::CppParser::BuiltIn("Int16"s, pNS); + new Poco::CppParser::BuiltIn("UInt16"s, pNS); + new Poco::CppParser::BuiltIn("Int32"s, pNS); + new Poco::CppParser::BuiltIn("UInt32"s, pNS); + new Poco::CppParser::BuiltIn("Int64"s, pNS); + new Poco::CppParser::BuiltIn("UInt64"s, pNS); + new Poco::CppParser::BuiltIn("IntPtr"s, pNS); + new Poco::CppParser::BuiltIn("UIntPtr"s, pNS); + } + + ~RemoteGenApp() + { + } + +protected: + void initialize(Application& self) + { + if (!_noGlobalConfig) + { + loadConfiguration(); + } + + Application::initialize(self); + AbstractGenerator::EError += Poco::Delegate(this, &RemoteGenApp::onError); + } + + void uninitialize() + { + AbstractGenerator::EError -= Poco::Delegate(this, &RemoteGenApp::onError); + Application::uninitialize(); + } + + void reinitialize(Application& self) + { + Application::reinitialize(self); + } + + void defineOptions(OptionSet& options) + { + Application::defineOptions(options); + + options.addOption( + Option("help"s, "h"s, "Display help information on command line arguments."s) + .required(false) + .repeatable(false) + .callback(OptionCallback(this, &RemoteGenApp::handleHelp))); + + options.addOption( + Option("define"s, "D"s, + "Define a configuration property. A configuration property " + "defined with this option can be referenced in the configuration " + "file, using the following syntax: ${}."s) + .required(false) + .repeatable(true) + .argument("="s) + .callback(OptionCallback(this, &RemoteGenApp::handleDefine))); + + options.addOption( + Option("config"s, "c"s, + "Load configuration from the given file specified by . " + "This option is supported for backwards compatibility only."s) + .required(false) + .repeatable(false) + .argument(""s) + .callback(OptionCallback(this, &RemoteGenApp::handleConfig))); + + options.addOption( + Option("mode"s, "m"s, + "Override generation mode specified in configuration file. " + "Valid values for are \"client\", \"server\", \"both\", \"skeleton\" or \"interface\"."s) + .required(false) + .repeatable(false) + .argument(""s) + .callback(OptionCallback(this, &RemoteGenApp::handleMode))); + + options.addOption( + Option("compiler"s, "C"s, + "Specify the compiler to use. Compilers are defined in the (global) configuration file. " + "If not specified, the first compiler defined in the configuration file will be used."s) + .required(false) + .repeatable(false) + .argument(""s) + .callback(OptionCallback(this, &RemoteGenApp::handleCompiler))); + + options.addOption( + Option("osp"s, "o"s, "Create services for Applied Informatics Open Service Platform (OSP)."s) + .required(false) + .repeatable(false) + .callback(OptionCallback(this, &RemoteGenApp::handleOSP))); + + options.addOption( + Option("bridge"s, "b"s, "Create remote bridge classes."s) + .required(false) + .repeatable(false) + .callback(OptionCallback(this, &RemoteGenApp::handleBridge))); + + options.addOption( + Option("noglobal"s, "n"s, "Do not load global configuration. If specified, compilers must be configured in the project configuration."s) + .required(false) + .repeatable(false) + .callback(OptionCallback(this, &RemoteGenApp::handleNoGlobal))); + } + + void handleConfig(const std::string& name, const std::string& value) + { + loadConfiguration(value); + } + + void handleCompiler(const std::string& name, const std::string& value) + { + _compiler = value; + } + + void handleNoGlobal(const std::string& name, const std::string& value) + { + _noGlobalConfig = true; + } + + void handleDefine(const std::string& name, const std::string& value) + { + defineProperty(value); + } + + void defineProperty(const std::string& def) + { + std::string name; + std::string value; + std::string::size_type pos = def.find('='); + if (pos != std::string::npos) + { + name.assign(def, 0, pos); + value.assign(def, pos + 1, def.length() - pos); + } + else name = def; + config().setString(name, value); + } + + void handleMode(const std::string& name, const std::string& value) + { + _mode = Poco::toLower(value); + if (_mode != BOTH && _mode != SERVER && _mode != CLIENT && _mode != INTERFACE && _mode != SKELETON) + { + throw Poco::InvalidArgumentException("invalid option value for mode: only use client|server|both|skeleton|interface"); + _mode.clear(); + } + } + + void handleHelp(const std::string& name, const std::string& value) + { + _helpRequested = true; + displayHelp(); + stopOptionsProcessing(); + } + + void displayHelp() + { + HelpFormatter helpFormatter(options()); + helpFormatter.setCommand(commandName()); + helpFormatter.setUsage("[