Leosac  0.7.0
OpenSourceAccessControl
IZone.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2016 Leosac
3 
4  This file is part of Leosac.
5 
6  Leosac is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Affero General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Leosac is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include "core/auth/AuthFwd.hpp"
23 #include <memory>
24 #include <string>
25 
26 namespace Leosac
27 {
28 namespace Auth
29 {
30 
47 class IZone : public std::enable_shared_from_this<IZone>
48 {
49  public:
53  enum class Type
54  {
55  PHYSICAL = 0x00,
56  LOGICAL = 0x01
57  };
58  virtual ZoneId id() const = 0;
59 
60  virtual std::string alias() const = 0;
61  virtual std::string description() const = 0;
62  virtual Type type() const = 0;
63 
64  virtual void alias(const std::string &alias) = 0;
65  virtual void description(const std::string &desc) = 0;
66  virtual void type(Type t) = 0;
67 
68  virtual void clear_children() = 0;
69  virtual void clear_doors() = 0;
70 
71  virtual void add_door(DoorLPtr door) = 0;
72  virtual void add_child(ZoneLPtr zone) = 0;
73 
77  virtual std::vector<ZoneLPtr> children() const = 0;
78 
82  virtual std::vector<DoorLPtr> doors() const = 0;
83 };
84 }
85 }
virtual Type type() const =0
virtual ZoneId id() const =0
This is the header file for a generated source file, GitSHA1.cpp.
odb::lazy_shared_ptr< Door > DoorLPtr
Definition: AuthFwd.hpp:111
virtual void add_door(DoorLPtr door)=0
virtual void clear_children()=0
virtual std::string description() const =0
virtual std::string alias() const =0
virtual void clear_doors()=0
virtual std::vector< DoorLPtr > doors() const =0
Retrieve the doors associated with the zones.
odb::lazy_shared_ptr< Zone > ZoneLPtr
Definition: AuthFwd.hpp:123
Type
Zone&#39;s type.
Definition: IZone.hpp:53
virtual void add_child(ZoneLPtr zone)=0
unsigned long ZoneId
Definition: AuthFwd.hpp:119
The interface for zones.
Definition: IZone.hpp:47
virtual std::vector< ZoneLPtr > children() const =0
Retrieve the children zones.