summaryrefslogtreecommitdiffstats
path: root/mmss/mmss.hpp
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-07-27 14:21:46 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-07-27 14:21:46 +0200
commit49652b9e2882a1c3cd5203ea91f90cdd32a090e9 (patch)
tree81bedb0a0eda97edfab1d34cc93035780b7bbb74 /mmss/mmss.hpp
parenta7ccec3fefe1c01cf238a3c0931459a54c2ff3a3 (diff)
downloadgmrf-49652b9e2882a1c3cd5203ea91f90cdd32a090e9.tar
gmrf-49652b9e2882a1c3cd5203ea91f90cdd32a090e9.zip
Some changes in memory management
Diffstat (limited to 'mmss/mmss.hpp')
-rw-r--r--mmss/mmss.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/mmss/mmss.hpp b/mmss/mmss.hpp
index d7202e7..723e0d6 100644
--- a/mmss/mmss.hpp
+++ b/mmss/mmss.hpp
@@ -34,13 +34,13 @@
struct gmrf {
private:
- gmrf(MMSS::context_t *mmss0, const std::string &name0, unsigned rand_seed0, const MMSS::protocol_t *proto0) :
+ gmrf(MMSS::context_t *mmss0, const std::string &name0, unsigned rand_seed0, const std::shared_ptr<const MMSS::protocol_t> &proto0) :
mmss(mmss0), name(name0), rand_seed(rand_seed0), proto(proto0) {}
gmrf(gmrf const&) = delete;
gmrf& operator=(gmrf const&) = delete;
public:
- static std::shared_ptr<MMSS::node_t> create(MMSS::context_t *mmss, const std::string &name, unsigned rand_seed, const MMSS::protocol_t *proto) {
+ static std::shared_ptr<MMSS::node_t> create(MMSS::context_t *mmss, const std::string &name, unsigned rand_seed, const std::shared_ptr<const MMSS::protocol_t> &proto) {
MMSS::node_t *node = new MMSS::node_t(mmss, name, rand_seed, proto);
std::shared_ptr<MMSS::node_t> ptr(node);
@@ -60,7 +60,7 @@ public:
unsigned rand_seed;
- const MMSS::protocol_t *proto;
+ std::shared_ptr<const MMSS::protocol_t> proto;
};
struct gmrf_iface {
@@ -84,8 +84,8 @@ public:
std::string name;
gmrf_addr_t address;
- std::weak_ptr<MMSS::node_t> node;
- std::weak_ptr<MMSS::network_t> net;
+ MMSS::node_t *node;
+ MMSS::network_t *net;
};
@@ -132,7 +132,7 @@ public:
};
-const protocol_t* load_protocol(const char *module);
+std::shared_ptr<const protocol_t> load_protocol(const char *module);
bool read_config(context_t *mmss, config_t *conf, const char *filename);