EII Message Bus C Reference
|
Go to the documentation of this file.
27 #ifndef _EII_MSGENVELOPE_HPP_
28 #define _EII_MSGENVELOPE_HPP_
68 const char *
what() const noexcept
override {
81 class MsgEnvelopeObject;
82 class MsgEnvelopeList;
245 void put_integer(
const std::string key, int64_t value);
255 void put_float(
const std::string key,
double value);
265 void put_string(
const std::string key,
const std::string value);
275 void put_bool(
const std::string key,
bool value);
299 std::vector<T>
const& value) {
300 if (m_msgenv == NULL) {
302 "Message Envelope already consumed, "
303 "unable to add to message envelope");
308 "Failed to create underlying msg envelope array");
311 for (
int i = 0; i < value.size(); i++) {
313 if (
typeid(value).name() ==
typeid(std::vector<int>).name()) {
315 if (ret != MSG_SUCCESS) {
317 "into msg envelope array");
319 }
else if (
typeid(value).name() ==
typeid(std::vector<double>).name()) {
321 if (ret != MSG_SUCCESS) {
323 "into msg envelope array");
325 }
else if (
typeid(value).name() ==
typeid(std::vector<bool>).name()) {
327 if (ret != MSG_SUCCESS) {
329 "into msg envelope array");
334 }
catch (
const std::exception& e) {
339 if (m_msgenv == NULL) {
341 "Message Envelope already consumed, "
342 "unable to add to message envelope");
345 if (ret != MSG_SUCCESS) {
346 throw MsgbusException(ret,
"Failed to add array into message envelope");
368 void put_blob(
char* value,
size_t size);
377 void remove(
const std::string key);
388 int64_t
get_int(
const std::string key);
410 const char*
get_string(
const std::string key);
421 bool get_bool(
const std::string key);
430 char*
get_blob(
const std::string key);
590 int64_t
get_int(int64_t index);
709 void put_integer(
const std::string key, int64_t value);
719 void put_float(
const std::string key,
double value);
729 void put_string(
const std::string key,
const std::string value);
739 void put_bool(
const std::string key,
bool value);
748 void remove(
const std::string key);
759 int64_t
get_int(
const std::string key);
781 const char*
get_string(
const std::string key);
792 bool get_bool(
const std::string key);
831 #endif // _EII_MSGENVELOPE_HPP_
bool get_bool(const std::string key)
MsgEnvelopeElement * get_msg_envelope_element(const std::string key)
const char * get_type_str()
void remove(const std::string key)
msg_envelope_elem_body_t * get_msg_envelope_array()
const char * what() const noexcept override
Definition: msg_envelope.hpp:68
double get_float(const std::string key)
int64_t get_int(const std::string key)
double get_float(const std::string key)
void put_integer(const std::string key, int64_t value)
void remove_at(int64_t index)
Messaging envelope abstraction.
void put_float(const std::string key, double value)
void put_bool(const std::string key, bool value)
MsgEnvelopeElement * get_msg_envelope_element(const std::string key)
MsgEnvelopeObject * get_msg_envelope_object(int64_t index)
Definition: msg_envelope.h:93
Definition: msg_envelope.hpp:203
bool get_bool(int64_t index)
Definition: msg_envelope.hpp:88
MsgbusException(msgbus_ret_t ret, const char *msg)
const char * get_string(const std::string key)
msgbus_ret_t get_msgbus_ret()
MsgEnvelopeList * to_array()
char * get_blob(const std::string key)
double get_float(int64_t index)
const char * get_string(int64_t index)
msgbus_ret_t
Definition: msgbusret.h:36
bool get_bool(const std::string key)
Definition: msg_envelope.h:111
void put_integer(const std::string key, int64_t value)
msgbus_ret_t msgbus_msg_envelope_put(msg_envelope_t *env, const char *key, msg_envelope_elem_body_t *data)
msg_envelope_data_type_t
Definition: msg_envelope.h:57
MsgEnvelopeElement * get_msg_envelope_element(int64_t index)
void put_string(const std::string key, const std::string value)
Definition: msg_envelope.hpp:662
msg_envelope_t * get_msg_envelope()
void put_float(double value)
MsgEnvelopeObject * get_object(const std::string key)
void put_object(MsgEnvelopeObject *value)
Definition: msg_envelope.hpp:484
msgbus_ret_t msgbus_msg_envelope_elem_array_add_float(msg_envelope_elem_body_t *arr, double value)
void put_string(const std::string value)
int64_t get_int(const std::string key)
Definition: msg_envelope.hpp:46
void put_bool(bool value)
MsgEnvelopeObject * to_object()
void put_float(const std::string key, double value)
void put_vector(const std::string key, std::vector< T > const &value)
Definition: msg_envelope.hpp:298
void put_array(const std::string key, MsgEnvelopeList *value)
void put_blob(char *value, size_t size)
msgbus_ret_t msgbus_msg_envelope_elem_array_add_integer(msg_envelope_elem_body_t *arr, int64_t value)
content_type_t
Definition: msg_envelope.h:43
void put_bool(const std::string key, bool value)
void put_string(const std::string key, const std::string value)
const char * msgbus_msg_envelope_elem_type_str(msg_envelope_data_type_t dt)
msgbus_ret_t msgbus_msg_envelope_elem_array_add_bool(msg_envelope_elem_body_t *arr, bool value)
msg_envelope_data_type_t get_type()
const char * get_string(const std::string key)
msg_envelope_elem_body_t * msgbus_msg_envelope_new_array()
void remove(const std::string key)
int64_t get_int(int64_t index)
msg_envelope_elem_body_t * get_msg_envelope_object()
void put_object(const std::string key, MsgEnvelopeObject *value)
MsgEnvelopeList * get_array(const std::string key)
void put_integer(int64_t value)