aboutsummaryrefslogtreecommitdiff
path: root/include/Group.hpp
blob: c9097282d51fb8f052bcd8dba4704d35e01e9a1f (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
#pragma once

#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:
        std::string name;
        std::vector<User*> users;
    };
}