aboutsummaryrefslogtreecommitdiff
path: root/src/Group.cpp
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 /src/Group.cpp
parent80a9c135b8bdca64246f147f22d98485e0f05ee5 (diff)
Sync time with ntp server, starting with basic operations
Diffstat (limited to 'src/Group.cpp')
-rw-r--r--src/Group.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Group.cpp b/src/Group.cpp
index 213a0bb..c87be1e 100644
--- a/src/Group.cpp
+++ b/src/Group.cpp
@@ -1,8 +1,17 @@
#include "../include/Group.hpp"
#include "../include/User.hpp"
+using namespace std;
+
namespace odhtdb
{
+ Group::Group(const string &_name) :
+ name(_name)
+ {
+ if(name.size() > 255)
+ throw GroupNameTooLongException(name);
+ }
+
Group::~Group()
{
for(User *user : users)
@@ -10,4 +19,19 @@ namespace odhtdb
delete user;
}
}
+
+ void Group::addUser(User *user)
+ {
+ users.push_back(user);
+ }
+
+ const string& Group::getName() const
+ {
+ return name;
+ }
+
+ const vector<User*>& Group::getUsers() const
+ {
+ return users;
+ }
} \ No newline at end of file