aboutsummaryrefslogtreecommitdiff
path: root/src/Group.cpp
diff options
context:
space:
mode:
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