Merge topic/actor-system throug a squashed commit.

This commit is contained in:
Robin Sommer 2018-05-16 23:48:07 +00:00
parent 7a6f5020f6
commit fe7e1ee7f0
466 changed files with 12559 additions and 9655 deletions

View file

@ -4,7 +4,7 @@
#define EVENTHANDLER
#include <assert.h>
#include <map>
#include <unordered_set>
#include <string>
#include "List.h"
#include "BroList.h"
@ -22,24 +22,22 @@ public:
const char* Name() { return name; }
Func* LocalHandler() { return local; }
FuncType* FType();
FuncType* FType(bool check_export = true);
void SetLocalHandler(Func* f);
void AddRemoteHandler(SourceID peer);
void RemoveRemoteHandler(SourceID peer);
#ifdef ENABLE_BROKER
void AutoRemote(std::string topic, int flags)
void AutoPublish(std::string topic)
{
auto_remote_send[std::move(topic)] = flags;
auto_publish.insert(std::move(topic));
}
void AutoRemoteStop(const std::string& topic)
void AutoUnpublish(const std::string& topic)
{
auto_remote_send.erase(topic);
auto_publish.erase(topic);
}
#endif
void Call(val_list* vl, bool no_remote = false);
@ -81,9 +79,7 @@ private:
typedef List(SourceID) receiver_list;
receiver_list receivers;
#ifdef ENABLE_BROKER
std::map<std::string, int> auto_remote_send; // topic -> flags
#endif
std::unordered_set<std::string> auto_publish;
};
// Encapsulates a ptr to an event handler to overload the boolean operator.