Leosac  0.8.0
Open Source Access Control
AccessPointService.cpp
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 #include "AccessPointService.hpp"
22 
23 namespace Leosac
24 {
25 namespace Auth
26 {
27 AccessPointBackend *
28 AccessPointService::get_backend(const std::string &controller_module)
29 {
30  std::lock_guard<std::mutex> lg(mutex_);
31 
32  auto itr = backends_.find(controller_module);
33  if (itr != backends_.end())
34  {
35  return itr->second;
36  }
37  return nullptr;
38 }
39 }
40 }
Leosac::Auth::AccessPointService::mutex_
std::mutex mutex_
Definition: AccessPointService.hpp:104
AccessPoint.hpp
AccessPointService.hpp
Leosac::Auth::AccessPointService::backends_
std::map< std::string, AccessPointBackend * > backends_
The various backend for various type of AccessPoint.
Definition: AccessPointService.hpp:110
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::Auth::AccessPointService::get_backend
AccessPointBackend * get_backend(const std::string &controller_module)
Get the AccessPointBackend that supports the given controller_module.
Definition: AccessPointService.cpp:28