Leosac  0.8.0
Open Source Access Control
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 }
Leosac::Auth::ZoneId
unsigned long ZoneId
Definition: AuthFwd.hpp:119
Leosac::Auth::IZone::clear_children
virtual void clear_children()=0
Leosac::Auth::IZone::children
virtual std::vector< ZoneLPtr > children() const =0
Retrieve the children zones.
Leosac::Auth::IZone::description
virtual std::string description() const =0
Leosac::Auth::IZone
The interface for zones.
Definition: IZone.hpp:47
AuthFwd.hpp
Leosac::Auth::IZone::doors
virtual std::vector< DoorLPtr > doors() const =0
Retrieve the doors associated with the zones.
Leosac::Auth::IZone::Type::LOGICAL
@ LOGICAL
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::Auth::IZone::alias
virtual std::string alias() const =0
Leosac::Auth::IZone::Type::PHYSICAL
@ PHYSICAL
Leosac::Auth::IZone::clear_doors
virtual void clear_doors()=0
Leosac::Auth::ZoneLPtr
odb::lazy_shared_ptr< Zone > ZoneLPtr
Definition: AuthFwd.hpp:123
Leosac::Auth::IZone::Type
Type
Zone's type.
Definition: IZone.hpp:53
Leosac::Auth::IZone::type
virtual Type type() const =0
Leosac::Auth::IZone::add_child
virtual void add_child(ZoneLPtr zone)=0
Leosac::Auth::IZone::id
virtual ZoneId id() const =0
Leosac::Auth::DoorLPtr
odb::lazy_shared_ptr< Door > DoorLPtr
Definition: AuthFwd.hpp:111
Leosac::Auth::IZone::add_door
virtual void add_door(DoorLPtr door)=0