summaryrefslogtreecommitdiffstats
path: root/mmss/mmss.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'mmss/mmss.hpp')
-rw-r--r--mmss/mmss.hpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/mmss/mmss.hpp b/mmss/mmss.hpp
index f131ec9..28f3ddd 100644
--- a/mmss/mmss.hpp
+++ b/mmss/mmss.hpp
@@ -24,8 +24,7 @@
*/
-#ifndef _GMRF_MMSS_MMSS_HPP_
-#define _GMRF_MMSS_MMSS_HPP_
+#pragma once
#include "queue.hpp"
@@ -92,13 +91,12 @@ public:
namespace MMSS {
-class context_t {
+class context_t : public now_t {
public:
- uint64_t now;
timeout_queue_t<packet_t> packet_queue;
timeout_queue_t<scheduled_t> scheduled_queue;
- context_t() : now(0), packet_queue(this), scheduled_queue(this) {}
+ context_t() : packet_queue(this), scheduled_queue(this) {}
};
class config_t {
@@ -140,8 +138,6 @@ bool read_config(context_t *mmss, config_t *conf, const char *filename);
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);
-uint64_t now(const context_t *mmss);
-
void dispatch(const std::shared_ptr<packet_t> &packet);
void run_scheduled(const std::shared_ptr<scheduled_t> &scheduled);
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);
@@ -149,20 +145,6 @@ void enqueue(context_t *mmss, const std::shared_ptr<iface_t> &source, const std:
void logf(context_t *mmss, int priority, const char *format, ...);
-static inline int max(int a, int b) {
- return (a > b) ? a : b;
-}
-
-static inline int min(int a, int b) {
- return (a < b) ? a : b;
-}
-
-
-static inline size_t alignto(size_t l, size_t a) {
- return ((l+a-1)/a)*a;
-}
-
-
namespace Config {
void add_network(context_t *mmss, config_t *conf, const char *name);
@@ -170,6 +152,3 @@ void add_network(context_t *mmss, config_t *conf, const char *name);
}
}
-
-
-#endif /* _GMRF_MMSS_MMSS_HPP_ */