1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00
ULib/include/ulib/net/rpc/rpc_envelope.h
stefanocasazza 1e58dc49d0 fix+sync
2018-04-27 19:27:14 +02:00

73 lines
1.8 KiB
C++

// ============================================================================
//
// = LIBRARY
// ULib - c++ library
//
// = FILENAME
// rpc_envelope.h
//
// = AUTHOR
// Stefano Casazza
//
// ============================================================================
#ifndef ULIB_RPC_ENVELOPE_H
#define ULIB_RPC_ENVELOPE_H 1
#include <ulib/container/vector.h>
class URPCParser;
class USOAPParser;
class U_EXPORT URPCEnvelope {
public:
// Check for memory error
U_MEMORY_TEST
// Allocator e Deallocator
U_MEMORY_ALLOCATOR
U_MEMORY_DEALLOCATOR
URPCEnvelope()
{
U_TRACE_CTOR(0, URPCEnvelope, "", 0)
arg = U_NULLPTR;
mustUnderstand = false;
}
~URPCEnvelope()
{
U_TRACE_DTOR(0, URPCEnvelope)
}
// SERVICES
UString getNsName() const { return nsName; } // return the name of namespace qualified element information
UString getMethodName() const { return methodName; } // return the name of the method the caller wants to execute
bool isMustUnderstand() const { return mustUnderstand; }
int getNumArgument() const { return arg->size(); }
UString getArgument(int n) const { return (*arg)[n]; }
const char* getArgumentCStr(int n) const { return (*arg)[n].c_strdup(); }
#if defined(U_STDCPP_ENABLE) && defined(DEBUG)
const char* dump(bool reset) const;
#endif
protected:
UString nsName, // this contains the name of the namespace qualified element information
methodName; // this contains the name of the method the caller wants to execute
UVector<UString>* arg; // this contains the argument for the method the caller wants to execute
bool mustUnderstand;
private:
U_DISALLOW_COPY_AND_ASSIGN(URPCEnvelope)
friend class URPCParser;
friend class USOAPParser;
};
#endif