diff options
Diffstat (limited to 'include/Group.hpp')
-rw-r--r-- | include/Group.hpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/Group.hpp b/include/Group.hpp index dafc05a..c909728 100644 --- a/include/Group.hpp +++ b/include/Group.hpp @@ -1,19 +1,34 @@ #pragma once -#include <opendht/crypto.h> #include <string> #include <vector> +#include <stdexcept> namespace odhtdb { class User; + class GroupNameTooLongException : public std::runtime_error + { + public: + GroupNameTooLongException(const std::string &groupName) : + std::runtime_error(std::string("The group name ") + groupName + " is longer than 255 bytes") + { + + } + }; + class Group { public: + Group(const std::string &name); ~Group(); + + void addUser(User *user); + + const std::string& getName() const; + const std::vector<User*>& getUsers() const; private: - dht::crypto::PublicKey publicKey; std::string name; std::vector<User*> users; }; |