summaryrefslogtreecommitdiff
path: root/src/munia_proto.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/munia_proto.cc')
-rw-r--r--src/munia_proto.cc46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/munia_proto.cc b/src/munia_proto.cc
index 333e3c9..33de8a3 100644
--- a/src/munia_proto.cc
+++ b/src/munia_proto.cc
@@ -35,13 +35,13 @@
#include "hugin.hpp"
-#include "task.h"
+#include "node.h"
#include "messageparser.h"
#include "messagehandler.h"
#include "connectionhandler.h"
-// Defines global task_manager object
-#include "taskmanager.h"
+// Defines global node_manager object
+#include "nodemanager.h"
#if 0
static void dump_handshake_info(struct lws_tokens *lwst)
@@ -93,11 +93,11 @@ typedef std::list<message_t> msgqueue_t;
static std::map<struct lws *, msgqueue_t > msgqueue;
struct lws *current_client = NULL;
-int callback_lws_task(struct lws *wsi,
+int callback_lws_node(struct lws *wsi,
enum lws_callback_reasons reason,
void *user, void *in, size_t len)
{
- task_manager.tree.toStdOut();
+ node_manager.tree.toStdOut();
DEBUG(proto, "Callback on %p\n", wsi);
@@ -139,8 +139,8 @@ int callback_lws_task(struct lws *wsi,
// collapse into move msg
if(j != msgqueue[wsi].end())
{
- taskid_t id = j->create.id;
- taskid_t parentid = j->create.parentid;
+ nodeid_t id = j->create.id;
+ nodeid_t parentid = j->create.parentid;
msgqueue[wsi].erase(j); // erase create msg
msg.cmd = cmd::move;
msg.move.id = id;
@@ -189,7 +189,7 @@ int callback_lws_task(struct lws *wsi,
// case LWS_CALLBACK_BROADCAST:
// printf("LWS_CALLBACK_BROADCAST\n");
// n = lws_write(wsi, (unsigned char*)in, len, LWS_WRITE_TEXT);
-// if (n < 0) DEBUG(proto, "task write failed\n");
+// if (n < 0) DEBUG(proto, "node write failed\n");
// break;
case LWS_CALLBACK_RECEIVE:
@@ -214,10 +214,10 @@ int callback_lws_task(struct lws *wsi,
if(omi->cmd == cmd::subscribe)
{
connection_handler.subscribe(wsi, omi->subscribe.id);
- TaskIdList ids;
+ NodeIdList ids;
try
{
- ids = task_manager.subTasks(omi->subscribe.id);
+ ids = node_manager.subNodes(omi->subscribe.id);
}
catch(...)
{
@@ -225,20 +225,20 @@ int callback_lws_task(struct lws *wsi,
omi++;
continue;
}
- TaskIdList::iterator id = ids.begin();
+ NodeIdList::iterator id = ids.begin();
while(id != ids.end())
{
- task_t task = task_manager.task(*id);
+ node_t node = node_manager.node(*id);
- message_t createmsg = create_msg_create(task);
+ message_t createmsg = create_msg_create(node);
createmsg.tid = omi->subscribe.id;
msgqueue[wsi].push_back(createmsg);
std::map<std::string, std::string>::iterator ai =
- task.attributes.begin();
- while(ai != task.attributes.end())
+ node.attributes.begin();
+ while(ai != node.attributes.end())
{
- message_t updatemsg = create_msg_update(task, ai->first);
+ message_t updatemsg = create_msg_update(node, ai->first);
DEBUG(subscribe, "%s\n", ai->first.c_str());
updatemsg.tid = omi->subscribe.id;
msgqueue[wsi].push_back(updatemsg);
@@ -251,10 +251,10 @@ int callback_lws_task(struct lws *wsi,
else if(omi->cmd == cmd::unsubscribe)
{
connection_handler.unsubscribe(wsi, omi->unsubscribe.id);
- TaskIdList ids;
+ NodeIdList ids;
try
{
- ids = task_manager.subTasks(omi->unsubscribe.id);
+ ids = node_manager.subNodes(omi->unsubscribe.id);
}
catch(...)
{
@@ -262,12 +262,12 @@ int callback_lws_task(struct lws *wsi,
omi++;
continue;
}
- TaskIdList::reverse_iterator id = ids.rbegin();
+ NodeIdList::reverse_iterator id = ids.rbegin();
while(id != ids.rend())
{
- task_t task = task_manager.task(*id);
+ node_t node = node_manager.node(*id);
- message_t removemsg = create_msg_remove(task);
+ message_t removemsg = create_msg_remove(node);
removemsg.tid = omi->unsubscribe.id;
msgqueue[wsi].push_back(removemsg);
DEBUG(unsubscribe, "remove id: %d\n", *id);
@@ -288,9 +288,9 @@ int callback_lws_task(struct lws *wsi,
while(ci != clients.end())
{
clientid_t clientid = (*ci).first;
- taskid_t tid = (*ci).second;
+ nodeid_t tid = (*ci).second;
- DEBUG(proto, "Subscriber id of task: %d\n", tid);
+ DEBUG(proto, "Subscriber id of node: %d\n", tid);
message_t msg = *omi;
msg.tid = tid;