Leosac  0.8.0
Open Source Access Control
Leosac::Auth::Zone Class Reference

A Zone is a container for doors and other zone. More...

#include <Zone.hpp>

+ Inheritance diagram for Leosac::Auth::Zone:
+ Collaboration diagram for Leosac::Auth::Zone:

Public Member Functions

 Zone ()
 
virtual ZoneId id () const override
 
virtual std::string alias () const override
 
virtual std::string description () const override
 
virtual void alias (const std::string &alias) override
 
virtual void description (const std::string &desc) override
 
virtual Type type () const override
 
virtual void type (Type t) override
 
virtual std::vector< ZoneLPtrchildren () const override
 Retrieve the children zones. More...
 
virtual std::vector< DoorLPtrdoors () const override
 Retrieve the doors associated with the zones. More...
 
virtual void clear_children () override
 
virtual void clear_doors () override
 
virtual void add_door (DoorLPtr door) override
 
virtual void add_child (ZoneLPtr zone) override
 
void validation_callback (odb::callback_event e, odb::database &) const
 Callback function called by ODB before/after database operation against a Zone object. More...
 
- Public Member Functions inherited from Leosac::Auth::IZone
virtual void type (Type t)=0
 

Protected Attributes

ZoneId id_
 
std::string alias_
 
std::string description_
 
Type type_
 
std::vector< ZoneLPtrchildren_
 
std::vector< DoorLPtrdoors_
 
std::vector< ZoneLWPtrparents_
 
const size_t version_
 

Friends

class odb::access
 
class Leosac::TestAccess
 
class ZoneValidator
 

Additional Inherited Members

- Public Types inherited from Leosac::Auth::IZone
enum  Type { Type::PHYSICAL = 0x00, Type::LOGICAL = 0x01 }
 Zone's type. More...
 

Detailed Description

A Zone is a container for doors and other zone.

This is the ODB-aware implementation.

Definition at line 60 of file Zone.hpp.

Constructor & Destructor Documentation

◆ Zone()

Leosac::Auth::Zone::Zone ( )

Definition at line 28 of file Zone.cpp.

Member Function Documentation

◆ add_child()

void Leosac::Auth::Zone::add_child ( ZoneLPtr  zone)
overridevirtual

Implements Leosac::Auth::IZone.

Definition at line 95 of file Zone.cpp.

◆ add_door()

void Leosac::Auth::Zone::add_door ( DoorLPtr  door)
overridevirtual

Implements Leosac::Auth::IZone.

Definition at line 90 of file Zone.cpp.

◆ alias() [1/2]

std::string Leosac::Auth::Zone::alias ( ) const
overridevirtual

Implements Leosac::Auth::IZone.

Definition at line 40 of file Zone.cpp.

◆ alias() [2/2]

void Leosac::Auth::Zone::alias ( const std::string &  alias)
overridevirtual

Implements Leosac::Auth::IZone.

Definition at line 50 of file Zone.cpp.

◆ children()

std::vector< ZoneLPtr > Leosac::Auth::Zone::children ( ) const
overridevirtual

Retrieve the children zones.

Implements Leosac::Auth::IZone.

Definition at line 70 of file Zone.cpp.

◆ clear_children()

void Leosac::Auth::Zone::clear_children ( )
overridevirtual

Implements Leosac::Auth::IZone.

Definition at line 80 of file Zone.cpp.

◆ clear_doors()

void Leosac::Auth::Zone::clear_doors ( )
overridevirtual

Implements Leosac::Auth::IZone.

Definition at line 85 of file Zone.cpp.

◆ description() [1/2]

std::string Leosac::Auth::Zone::description ( ) const
overridevirtual

Implements Leosac::Auth::IZone.

Definition at line 45 of file Zone.cpp.

◆ description() [2/2]

void Leosac::Auth::Zone::description ( const std::string &  desc)
overridevirtual

Implements Leosac::Auth::IZone.

Definition at line 55 of file Zone.cpp.

◆ doors()

std::vector< DoorLPtr > Leosac::Auth::Zone::doors ( ) const
overridevirtual

Retrieve the doors associated with the zones.

Implements Leosac::Auth::IZone.

Definition at line 75 of file Zone.cpp.

◆ id()

ZoneId Leosac::Auth::Zone::id ( ) const
overridevirtual

Implements Leosac::Auth::IZone.

Definition at line 35 of file Zone.cpp.

◆ type() [1/2]

IZone::Type Leosac::Auth::Zone::type ( ) const
overridevirtual

Implements Leosac::Auth::IZone.

Definition at line 60 of file Zone.cpp.

◆ type() [2/2]

virtual void Leosac::Auth::Zone::type ( Type  t)
overridevirtual

◆ validation_callback()

void Leosac::Auth::Zone::validation_callback ( odb::callback_event  e,
odb::database &   
) const

Callback function called by ODB before/after database operation against a Zone object.

This function will perform some validation wrt parent/child relationship of the object.

Definition at line 100 of file Zone.cpp.

Friends And Related Function Documentation

◆ Leosac::TestAccess

friend class Leosac::TestAccess
friend

Definition at line 121 of file Zone.hpp.

◆ odb::access

friend class odb::access
friend

Definition at line 120 of file Zone.hpp.

◆ ZoneValidator

friend class ZoneValidator
friend

Definition at line 122 of file Zone.hpp.

Member Data Documentation

◆ alias_

std::string Leosac::Auth::Zone::alias_
protected

Definition at line 103 of file Zone.hpp.

◆ children_

std::vector<ZoneLPtr> Leosac::Auth::Zone::children_
protected

Definition at line 108 of file Zone.hpp.

◆ description_

std::string Leosac::Auth::Zone::description_
protected

Definition at line 104 of file Zone.hpp.

◆ doors_

std::vector<DoorLPtr> Leosac::Auth::Zone::doors_
protected

Definition at line 111 of file Zone.hpp.

◆ id_

ZoneId Leosac::Auth::Zone::id_
protected

Definition at line 101 of file Zone.hpp.

◆ parents_

std::vector<ZoneLWPtr> Leosac::Auth::Zone::parents_
protected

Definition at line 114 of file Zone.hpp.

◆ type_

Type Leosac::Auth::Zone::type_
protected

Definition at line 105 of file Zone.hpp.

◆ version_

const size_t Leosac::Auth::Zone::version_
protected

Definition at line 117 of file Zone.hpp.


The documentation for this class was generated from the following files: