jay/component/core.h
2025-03-28 23:12:34 +02:00

38 lines
853 B
C++

// SPDX-FileCopyrightText: 2024 Yury Gubich <blue@macaw.me>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <string>
#include <memory>
#include "shared/logger.h"
#include "config.h"
#include "router.h"
class Connection;
class Core {
public:
Core(const std::string& configPath);
void send(const std::string& jid, const std::string& body);
void initialize(const std::shared_ptr<Connection>& connection);
void setGroup(const std::string& jid, const std::string& group);
void publish(const std::string& service, const std::string& node, const std::string& title, const std::string& body);
public:
Config config;
Shared::Logger logger;
Router router;
private:
void initializeActors();
void initializeResponses();
private:
bool initialized;
std::weak_ptr<Connection> connection;
};