aboutsummaryrefslogtreecommitdiff
path: root/src/Group.cpp
blob: c87be1ee20f749072630edc17428511fbe02d294 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#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)
        {
            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;
    }
}