summaryrefslogtreecommitdiffstats
path: root/mmss/iface.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'mmss/iface.hpp')
-rw-r--r--mmss/iface.hpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/mmss/iface.hpp b/mmss/iface.hpp
index c922815..45e9d6a 100644
--- a/mmss/iface.hpp
+++ b/mmss/iface.hpp
@@ -26,7 +26,7 @@
#pragma once
-#include "types.hpp"
+#include "network.hpp"
#include <memory>
#include <string>
@@ -34,17 +34,16 @@
namespace MMSS {
-class iface_t : public ::gmrf_iface, public std::enable_shared_from_this<iface_t> {
+class iface_t : public ::gmrf_iface, public std::enable_shared_from_this<iface_t>, public nocopy_t {
private:
- iface_t(iface_t const&) = delete;
- iface_t& operator=(iface_t const&) = delete;
-
node_t *node;
network_t *net;
std::string name;
gmrf_addr_t address;
+ void enqueue(context_t *mmss, const std::shared_ptr<iface_t> &dest, const void *data, size_t len);
+
public:
iface_t(node_t *node0, network_t *net0, const std::string &name0, const gmrf_addr_t *address0)
: node(node0), net(net0), name(name0), address(*address0) {}
@@ -64,9 +63,16 @@ public:
const gmrf_addr_t* get_address() const {
return &address;
}
+
+ void send(const void *data, size_t len, const gmrf_addr_t *dest) {
+ net->send(data, len, this, dest);
+ }
+
+ void send_bc(const void *data, size_t len) {
+ net->send_bc(data, len, this);
+ }
};
void add_iface(const std::shared_ptr<node_t> &node, const std::shared_ptr<network_t> &net, const std::string &name, const gmrf_addr_t *address);
-void enqueue(context_t *mmss, const std::shared_ptr<iface_t> &source, const std::shared_ptr<iface_t> &dest, const void *data, size_t len);
}