jay/component/core.h

37 lines
716 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 "config.h"
#include "router.h"
#include "logger.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);
public:
Config config;
Logger logger;
Router router;
private:
void initializeActors();
void initializeResponses();
private:
bool initialized;
std::weak_ptr<Connection> connection;
};