aboutsummaryrefslogtreecommitdiff
path: root/include/Group.hpp
diff options
context:
space:
mode:
authorAleksi Lindeman <aleksi_888@hotmail.com>2018-02-01 21:15:13 +0100
committerAleksi Lindeman <aleksi_888@hotmail.com>2018-02-01 21:15:19 +0100
commit6f1089db78f14b52b869f5aaa979e52ff5e4c2d7 (patch)
treed79f7abfb0fb9f3d58f9716741512b63fb4193ec /include/Group.hpp
parent80a9c135b8bdca64246f147f22d98485e0f05ee5 (diff)
Sync time with ntp server, starting with basic operations
Diffstat (limited to 'include/Group.hpp')
-rw-r--r--include/Group.hpp19
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;
};