35 #include "../Variable.h" 51 RpcEncoder(
bool forceInteger64,
bool encodeVoid);
67 void encodeRequest(
const std::string &methodName,
const std::shared_ptr<std::list<std::shared_ptr<Variable>>> ¶meters, std::vector<char> &encodedData,
const std::shared_ptr<RpcHeader> &header =
nullptr);
68 void encodeRequest(
const std::string &methodName,
const std::shared_ptr<std::list<std::shared_ptr<Variable>>> ¶meters, std::vector<uint8_t> &encodedData,
const std::shared_ptr<RpcHeader> &header =
nullptr);
69 void encodeRequest(
const std::string &methodName,
const PArray ¶meters, std::vector<char> &encodedData,
const std::shared_ptr<RpcHeader> &header =
nullptr);
70 void encodeRequest(
const std::string &methodName,
const PArray ¶meters, std::vector<uint8_t> &encodedData,
const std::shared_ptr<RpcHeader> &header =
nullptr);
71 void encodeResponse(
const std::shared_ptr<Variable> &variable, std::vector<char> &encodedData);
72 void encodeResponse(
const std::shared_ptr<Variable> &variable, std::vector<uint8_t> &encodedData);
74 bool _forceInteger64 =
false;
75 bool _encodeVoid =
false;
76 char _packetStartRequest[4];
77 char _packetStartResponse[5];
78 char _packetStartError[5];
80 static void expandPacket(std::vector<char> &packet,
size_t sizeToInsert);
81 static void expandPacket(std::vector<uint8_t> &packet,
size_t sizeToInsert);
82 static uint32_t encodeHeader(std::vector<char> &packet,
const RpcHeader &header);
83 static uint32_t encodeHeader(std::vector<uint8_t> &packet,
const RpcHeader &header);
84 void encodeVariable(std::vector<char> &packet,
const std::shared_ptr<Variable> &variable);
85 void encodeVariable(std::vector<uint8_t> &packet,
const std::shared_ptr<Variable> &variable);
86 static void encodeInteger(std::vector<char> &packet,
const std::shared_ptr<Variable> &variable);
87 static void encodeInteger(std::vector<uint8_t> &packet,
const std::shared_ptr<Variable> &variable);
88 static void encodeInteger64(std::vector<char> &packet,
const std::shared_ptr<Variable> &variable);
89 static void encodeInteger64(std::vector<uint8_t> &packet,
const std::shared_ptr<Variable> &variable);
90 static void encodeFloat(std::vector<char> &packet,
const std::shared_ptr<Variable> &variable);
91 static void encodeFloat(std::vector<uint8_t> &packet,
const std::shared_ptr<Variable> &variable);
92 static void encodeBoolean(std::vector<char> &packet,
const std::shared_ptr<Variable> &variable);
93 static void encodeBoolean(std::vector<uint8_t> &packet,
const std::shared_ptr<Variable> &variable);
94 static void encodeType(std::vector<char> &packet,
VariableType type);
95 static void encodeType(std::vector<uint8_t> &packet,
VariableType type);
96 static void encodeString(std::vector<char> &packet,
const std::shared_ptr<Variable> &variable);
97 static void encodeString(std::vector<uint8_t> &packet,
const std::shared_ptr<Variable> &variable);
98 static void encodeBase64(std::vector<char> &packet,
const std::shared_ptr<Variable> &variable);
99 static void encodeBase64(std::vector<uint8_t> &packet,
const std::shared_ptr<Variable> &variable);
100 static void encodeBinary(std::vector<char> &packet,
const std::shared_ptr<Variable> &variable);
101 static void encodeBinary(std::vector<uint8_t> &packet,
const std::shared_ptr<Variable> &variable);
102 void encodeVoid(std::vector<char> &packet);
103 void encodeVoid(std::vector<uint8_t> &packet);
104 void encodeStruct(std::vector<char> &packet,
const std::shared_ptr<Variable> &variable);
105 void encodeStruct(std::vector<uint8_t> &packet,
const std::shared_ptr<Variable> &variable);
106 void encodeArray(std::vector<char> &packet,
const std::shared_ptr<Variable> &variable);
107 void encodeArray(std::vector<uint8_t> &packet,
const std::shared_ptr<Variable> &variable);
static void insertHeader(std::vector< char > &packet, const RpcHeader &header)
Definition: RpcEncoder.cpp:189
This is the base library main class.
Definition: BaseLib.h:95
Definition: BaseLib.cpp:34
void encodeRequest(const std::string &methodName, const std::shared_ptr< std::list< std::shared_ptr< Variable >>> ¶meters, std::vector< char > &encodedData, const std::shared_ptr< RpcHeader > &header=nullptr)
Definition: RpcEncoder.cpp:59
std::shared_ptr< Array > PArray
Definition: Variable.h:72
VariableType
Definition: Variable.h:49
Definition: RpcEncoder.h:48
RpcEncoder()
Definition: RpcEncoder.cpp:37
void encodeResponse(const std::shared_ptr< Variable > &variable, std::vector< char > &encodedData)
Definition: RpcEncoder.cpp:159