summaryrefslogtreecommitdiff
path: root/ucoolib
diff options
context:
space:
mode:
authorNicolas Schodet2013-02-21 19:26:55 +0100
committerNicolas Schodet2019-10-06 23:29:59 +0200
commita238c74df1042c7f3b0c2e6aafa037649f79ab95 (patch)
treeb92487a18048a3bd82203b22ec04e693d6173291 /ucoolib
parent850e3632931d7555f80b6a84eada7952c7482dab (diff)
ucoolib/arch/host/mex: use std::string
Diffstat (limited to 'ucoolib')
-rw-r--r--ucoolib/arch/host/mex/mex_node.hh3
-rw-r--r--ucoolib/arch/host/mex/mex_node.host.cc4
2 files changed, 4 insertions, 3 deletions
diff --git a/ucoolib/arch/host/mex/mex_node.hh b/ucoolib/arch/host/mex/mex_node.hh
index fecb8c0..26fd5a2 100644
--- a/ucoolib/arch/host/mex/mex_node.hh
+++ b/ucoolib/arch/host/mex/mex_node.hh
@@ -29,6 +29,7 @@
#include <memory>
#include <map>
+#include <string>
namespace ucoo {
namespace mex {
@@ -89,7 +90,7 @@ class Node
/// Send a response while handling a request.
void response (Msg &msg);
/// Reserve a message type.
- mtype_t reserve (const char *name);
+ mtype_t reserve (const std::string &name);
/// Register an handler for a message type.
void handler_register (mtype_t mtype, Handler &handler);
private:
diff --git a/ucoolib/arch/host/mex/mex_node.host.cc b/ucoolib/arch/host/mex/mex_node.host.cc
index 5fdd81a..d1a4c70 100644
--- a/ucoolib/arch/host/mex/mex_node.host.cc
+++ b/ucoolib/arch/host/mex/mex_node.host.cc
@@ -124,11 +124,11 @@ Node::response (Msg &msg)
}
mtype_t
-Node::reserve (const char *name)
+Node::reserve (const std::string &name)
{
// Send request.
Msg msg (MTYPE_RES);
- msg.push (name, std::strlen (name));
+ msg.push (name.data (), name.size ());
send (msg);
// Wait for response.
std::auto_ptr<Msg> rsp;