This is Unofficial EPICS BASE Doxygen Site
epics::pvAccess::AuthenticationRegistry Class Reference

#include "security.h"

Public Types

typedef std::vector< map_t::mapped_type > list_t
 

Public Member Functions

 AuthenticationRegistry ()
 
 ~AuthenticationRegistry ()
 
void snapshot (list_t &plugmap) const
 Save a copy of the current registry in order of increasing priority. More...
 
void add (int prio, const std::string &name, const AuthenticationPlugin::shared_pointer &plugin)
 Add a new plugin to this registry. More...
 
bool remove (const AuthenticationPlugin::shared_pointer &plugin)
 Remove an existing entry. Remove true if the entry was actually removed. More...
 
AuthenticationPlugin::shared_pointer lookup (const std::string &name) const
 

Static Public Member Functions

static AuthenticationRegistryclients ()
 The client side of the conversation. More...
 
static AuthenticationRegistryservers ()
 The server side of the conversation. More...
 

Detailed Description

Registry(s) for plugins

Definition at line 228 of file security.h.

Member Typedef Documentation

typedef std::vector<map_t::mapped_type> epics::pvAccess::AuthenticationRegistry::list_t

Definition at line 239 of file security.h.

Constructor & Destructor Documentation

epics::pvAccess::AuthenticationRegistry::AuthenticationRegistry ( )
inline

Definition at line 246 of file security.h.

246 {}
epics::pvAccess::AuthenticationRegistry::~AuthenticationRegistry ( )

Definition at line 152 of file security.cpp.

152 {}

Member Function Documentation

void epics::pvAccess::AuthenticationRegistry::add ( int  prio,
const std::string &  name,
const AuthenticationPlugin::shared_pointer &  plugin 
)

Add a new plugin to this registry.

Parameters
prioOrder in which plugins are considered. highest is preferred.
nameName under which this plugin will be known
pluginPlugin instance

Definition at line 221 of file security.cpp.

223 {
224  Guard G(mutex);
225  if(map.find(prio)!=map.end())
226  THROW_EXCEPTION2(std::logic_error, "Authentication plugin already registered with this priority");
227  map[prio] = std::make_pair(name, plugin);
228 }
#define THROW_EXCEPTION2(TYPE, MSG)
epicsMutex mutex
Definition: security.cpp:160
AuthenticationRegistry & epics::pvAccess::AuthenticationRegistry::clients ( )
static

The client side of the conversation.

Definition at line 197 of file security.cpp.

198 {
199  epicsThreadOnce(&authGblOnce, &authGblInit, 0);
200  assert(authGbl);
201  return authGbl->clients;
202 }
#define assert(exp)
Declare that a condition should be true.
Definition: epicsAssert.h:70
LIBCOM_API void epicsStdCall epicsThreadOnce(epicsThreadOnceId *id, EPICSTHREADFUNC, void *arg)
AuthenticationPlugin::shared_pointer epics::pvAccess::AuthenticationRegistry::lookup ( const std::string &  name) const

Fetch a single plugin explicitly by name.

Returns
NULL if no entry for this name is available.

Definition at line 242 of file security.cpp.

243 {
244  Guard G(mutex);
245  // assuming the number of plugins is small, we don't index by name.
246  for(map_t::const_iterator it(map.begin()), end(map.end()); it!=end; ++it) {
247  if(it->second.first==name)
248  return it->second.second;
249  }
250  return AuthenticationPlugin::shared_pointer();
251 }
epicsMutex mutex
Definition: security.cpp:160
bool epics::pvAccess::AuthenticationRegistry::remove ( const AuthenticationPlugin::shared_pointer &  plugin)

Remove an existing entry. Remove true if the entry was actually removed.

Definition at line 230 of file security.cpp.

231 {
232  Guard G(mutex);
233  for(map_t::iterator it(map.begin()), end(map.end()); it!=end; ++it) {
234  if(it->second.second==plugin) {
235  map.erase(it);
236  return true;
237  }
238  }
239  return false;
240 }
epicsMutex mutex
Definition: security.cpp:160
AuthenticationRegistry & epics::pvAccess::AuthenticationRegistry::servers ( )
static

The server side of the conversation.

Definition at line 204 of file security.cpp.

205 {
206  epicsThreadOnce(&authGblOnce, &authGblInit, 0);
207  assert(authGbl);
208  return authGbl->servers;
209 }
#define assert(exp)
Declare that a condition should be true.
Definition: epicsAssert.h:70
LIBCOM_API void epicsStdCall epicsThreadOnce(epicsThreadOnceId *id, EPICSTHREADFUNC, void *arg)
void epics::pvAccess::AuthenticationRegistry::snapshot ( list_t plugmap) const

Save a copy of the current registry in order of increasing priority.

Definition at line 211 of file security.cpp.

212 {
213  plugmap.clear();
214  Guard G(mutex);
215  plugmap.reserve(map.size());
216  for(map_t::const_iterator it(map.begin()), end(map.end()); it!=end; ++it) {
217  plugmap.push_back(it->second);
218  }
219 }
epicsMutex mutex
Definition: security.cpp:160

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