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

This service lets various AccessPoint backend register and provide implementation to use by the AccessPointCRUD object. More...

#include <AccessPointService.hpp>

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

Public Member Functions

void register_backend (const std::string &controller_module, AccessPointBackend *backend)
 Register an AccessPointBackend for controller_module. More...
 
void unregister_backend (const std::string &controller_module)
 
AccessPointBackendget_backend (const std::string &controller_module)
 Get the AccessPointBackend that supports the given controller_module. More...
 
- Public Member Functions inherited from Leosac::ExtensibleSerializer< json, Auth::IAccessPoint, const SecurityContext & >
json serialize (const Auth::IAccessPoint &input, AdditionalArgs &&... args) const
 
void register_serializer (Callable &&callable)
 Register a serializer for T. More...
 
void unregister_serializer ()
 

Private Attributes

std::mutex mutex_
 
std::map< std::string, AccessPointBackend * > backends_
 The various backend for various type of AccessPoint. More...
 

Additional Inherited Members

- Public Types inherited from Leosac::ExtensibleSerializer< json, Auth::IAccessPoint, const SecurityContext & >
using SerializationCallable = std::function< json(const Auth::IAccessPoint &, AdditionalArgs &&...)>
 Callable type for serialization. More...
 

Detailed Description

This service lets various AccessPoint backend register and provide implementation to use by the AccessPointCRUD object.

The registration is done by specifying the name (string) of the controller module for the type of AccessPoint.

Note
This service also manages runtime registered serializers that target AccessPoint objects.
This is a core service and therefore will always be available to modules.

Definition at line 69 of file AccessPointService.hpp.

Member Function Documentation

◆ get_backend()

AccessPointBackend * Leosac::Auth::AccessPointService::get_backend ( const std::string &  controller_module)

Get the AccessPointBackend that supports the given controller_module.

Returns
nullptr if none found.

Definition at line 28 of file AccessPointService.cpp.

◆ register_backend()

void Leosac::Auth::AccessPointService::register_backend ( const std::string &  controller_module,
AccessPointBackend backend 
)
inline

Register an AccessPointBackend for controller_module.

The backend object MUST stay alive until a corresponding call to unregister_backend() is made.

Definition at line 79 of file AccessPointService.hpp.

◆ unregister_backend()

void Leosac::Auth::AccessPointService::unregister_backend ( const std::string &  controller_module)
inline

Definition at line 89 of file AccessPointService.hpp.

Member Data Documentation

◆ backends_

std::map<std::string, AccessPointBackend *> Leosac::Auth::AccessPointService::backends_
private

The various backend for various type of AccessPoint.

Those are registered by modules.

Definition at line 110 of file AccessPointService.hpp.

◆ mutex_

std::mutex Leosac::Auth::AccessPointService::mutex_
mutableprivate

Definition at line 104 of file AccessPointService.hpp.


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