pairpal
Loading...
Searching...
No Matches
chat.hpp
1#ifndef CHAT_HPP
2#define CHAT_HPP
3
4#include <vector>
5#include <map>
6#include <string>
7#include <memory>
8
9#include "message.hpp"
10#include "message_store.hpp"
11#include "dialog.hpp"
12
18class Chat {
19 public:
24
29
37 bool sendMessage(const std::string &from, const std::string &to,
38 const std::string &message);
39
45 [[nodiscard]] std::vector<Message> getSentMessages(
46 const std::string &username) const;
47
53 [[nodiscard]] std::vector<Message> getReceivedMessages(
54 const std::string &username) const;
55
56 private:
57 std::unique_ptr<Message_store> messageStore_;
58 //std::map<std::string, User> users_;
59 std::map<std::pair<std::string, std::string>, Dialog> dialogs_;
60};
61
62#endif // CHAT_HPP
A class to handle Chat_test functionalities including sending and retrieving messages.
Definition chat.hpp:18
Chat()
Constructor for the Chat class.
std::vector< Message > getReceivedMessages(const std::string &username) const
Retrieves the messages received by a specific user.
bool sendMessage(const std::string &from, const std::string &to, const std::string &message)
Sends a message from one user to another.
~Chat()
Destructor for the Chat class.
std::vector< Message > getSentMessages(const std::string &username) const
Retrieves the messages sent by a specific user.
Represents a dialog between two users.
Definition dialog.hpp:13