// ============================================================================ // // = LIBRARY // ULib - c++ library // // = FILENAME // rpc_parser.h - RPC parser // // = AUTHOR // Stefano Casazza // // ============================================================================ #ifndef ULIB_RPC_PARSER_H #define ULIB_RPC_PARSER_H 1 #include #include /** @class URPCParser @brief URPCParser is a parser RPC */ class URPCObject; class U_EXPORT URPCParser { public: // Check for memory error U_MEMORY_TEST // Allocator e Deallocator U_MEMORY_ALLOCATOR U_MEMORY_DEALLOCATOR // COSTRUTTORI URPCParser(UVector* arg = 0); ~URPCParser() { U_TRACE_UNREGISTER_OBJECT(0, URPCParser) clearData(); U_INTERNAL_ASSERT_POINTER(envelope.arg) delete envelope.arg; } // SERVICES void clearData(); UVector& getArgument() { return *(envelope.arg); } UString getNsName() const { return envelope.nsName; } // return the name of namespace qualified // element information UString getMethodName() const { return envelope.methodName; } // return the name of the method // the caller wants to execute // --------------------------------------------------------------------- // Given a URPCObject this calls the appropriate URPCMethod. // If this fails, ask for a URPCFault. Returns a RPC send-ready response // --------------------------------------------------------------------- // bContainsFault: Indicates if the returned string contains a fault // --------------------------------------------------------------------- UString processMessage(const UString& msg, URPCObject& object, bool& bContainsFault); // DEBUG #if defined(U_STDCPP_ENABLE) && defined(DEBUG) const char* dump(bool reset) const; #endif protected: URPCEnvelope envelope; private: #ifdef U_COMPILER_DELETE_MEMBERS URPCParser(const URPCParser&) = delete; URPCParser& operator=(const URPCParser&) = delete; #else URPCParser(const URPCParser&) {} URPCParser& operator=(const URPCParser&) { return *this; } #endif }; #endif