6 #ifndef CPPIPC_COMMON_MESSAGE_TYPES_HPP 7 #define CPPIPC_COMMON_MESSAGE_TYPES_HPP 12 #include <core/system/nanosockets/zmq_msg_vector.hpp> 14 #include <core/system/exceptions/error_types.hpp> 15 #include <core/export.hpp> 32 bool construct(nanosockets::zmq_msg_vector& vec);
38 void emit(nanosockets::zmq_msg_vector& vec);
107 bool construct(nanosockets::zmq_msg_vector& vec);
113 void emit(nanosockets::zmq_msg_vector& vec);
143 assert(zmqbodyused ==
false);
144 if (!body) free(body);
145 body = (
char*)malloc(s.length());
146 memcpy(body, s.c_str(), s.length());
147 bodylen = s.length();
150 inline void copy_body_from(
const char* c,
size_t len) {
151 assert(zmqbodyused ==
false);
152 if (!body) free(body);
153 body = (
char*)malloc(len);
154 memcpy(body, c, len);
169 class ipcexception :
public std::exception {
172 std::string custom_errstring =
"")
173 :status(s), errorcode(0), custom_errstring(custom_errstring) {
178 std::string custom_errstring =
"")
179 :status(s), errorcode(errorcode), custom_errstring(custom_errstring){
183 virtual ~ipcexception()
throw() { }
185 const char* what()
const throw() {
186 return errstring.c_str();
199 int get_zeromq_errorcode() {
206 std::string errstring;
207 std::string custom_errstring;
209 void make_error_string() {
210 std::stringstream strm;
211 if (errorcode == 0) {
213 <<
". " << custom_errstring;
216 <<
". " << custom_errstring;
219 errstring = strm.str();
Other general exception. Body will contain the exception message.
std::map< std::string, std::string > properties
The status of the call.
nanosockets::nn_msg_t bodybuf
Other properties.
call_message()
Default constructor.
std::string function_name
the object to call
The object requested did not exist.
nanosockets::nn_msg_t bodybuf
Other properties.
reply_message()
Default constructor.
std::string reply_status_to_string(reply_status)
The object requested did not exist.
The function requested did not exist.
std::map< std::string, std::string > properties
the function to call on the object
size_t bodylen
The serialized arguments of the call. May point into bodybuf.
void copy_body_from(const std::string &s)
True if bodybuf is used and body is from bodybuf.
bool zmqbodyused
The length of the body.
bool zmqbodyused
The length of the body.
size_t bodylen
The serialized contents of the reply. May point into bodybuf.