Module creation, message routing

This commit is contained in:
Blue 2025-03-07 23:20:06 +02:00
parent bc2dc9bf07
commit c605b3ba93
Signed by: blue
GPG key ID: 9B203B252A63EE38
14 changed files with 154 additions and 26 deletions

View file

@ -4,17 +4,33 @@
#pragma once
#include <string>
#include <memory>
#include <vector>
#include "gloox/client.h"
#include "component/actor.h"
namespace Module {
class Module {
protected:
Module();
public:
typedef std::vector<std::string> Tokens;
virtual void message(const std::string& text) = 0;
protected:
Module(const std::shared_ptr<gloox::Client>& client);
void sendMessage(const std::shared_ptr<Actor>& actor, const std::string& body);
public:
virtual ~Module() noexcept;
static Tokens split(const std::string& string, const std::string& delimiter = " ");
virtual void message(const std::shared_ptr<Actor>& actor, const Tokens& args) = 0;
protected:
std::shared_ptr<gloox::Client> client;
};
}