return ret_val;
}
-int BusMessage::add_long_parameter(const char *arg_name_param, long value_param)
+int BusMessage::add_long_parameter(string arg_name_param, long value_param)
{
long length;
int ret_val;
ret_val = 0;
seq = (DataItemSequence *)_dataItemSeq;
- if (arg_name_param != NULL) {
+ if (arg_name_param.empty() == false) {
length = seq->length();
item = new DataItem();
- item->name = strdup(arg_name_param);
+ item->name = strdup(arg_name_param.c_str());
item->value <<= value_param;
seq->length(length + 1);
return ret_val;
}
-int BusMessage::add_double_parameter(const char *arg_name_param, double value_param)
+int BusMessage::add_double_parameter(string arg_name_param, double value_param)
{
long length;
int ret_val;
ret_val = 0;
log_debug("add_double_parameter() started\n");
seq = (DataItemSequence *)_dataItemSeq;
- if (arg_name_param != NULL) {
+ if (arg_name_param.empty() == false) {
length = seq->length();
item = new DataItem();
- item->name = strdup(arg_name_param);
- item->value <<= (long)value_param;
+ item->name = strdup(arg_name_param.c_str());
+ item->value <<= (double)value_param;
seq->length(length + 1);
(*seq)[length] = *item;
return ret_val;
}
-int BusMessage::add_float_parameter(const char *arg_name_param, float value_param)
+int BusMessage::add_float_parameter(string arg_name_param, float value_param)
{
long length;
int ret_val;
ret_val = 0;
seq = (DataItemSequence *)_dataItemSeq;
- if (arg_name_param != NULL) {
+ if (arg_name_param.empty() == false) {
length = seq->length();
item = new DataItem();
- item->name = strdup(arg_name_param);
- item->value <<= (long)value_param;
+ item->name = strdup(arg_name_param.c_str());
+ item->value <<= (float)value_param;
seq->length(length + 1);
(*seq)[length] = *item;
BusMessage(long type_param, const char *arg_name_param, const char *arg_string_value_param);
virtual ~BusMessage();
int add_string_parameter(std::string arg_name_param, std::string string_value_param);
- int add_long_parameter(const char *arg_name_param, long value_param);
+ int add_long_parameter(std::string arg_name_param, long value_param);
int add_int_parameter(std::string arg_name_param, int value_param);
- int add_double_parameter(const char *arg_name_param, double value_param);
- int add_float_parameter(const char *arg_name_param, float value_param);
+ int add_double_parameter(std::string arg_name_param, double value_param);
+ int add_float_parameter(std::string arg_name_param, float value_param);
long get_type(int *err_flg);
std::string get_string_parameter(std::string arg_name_param, int *err_flg);
long get_long_parameter(std::string arg_name_param, int *err_flg);