ldas-tools-al  2.6.7
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
LDASTools::AL::UserInfoCache Class Reference

Cache system information about users. More...

#include <UserInfoCache.hh>

Collaboration diagram for LDASTools::AL::UserInfoCache:
Collaboration graph
[legend]

Classes

class  UserInfo
 Class to manage information about a single user. More...
 

Public Member Functions

 ~UserInfoCache ()
 Destructor to release system resources. More...
 
 ~UserInfoCache ()
 Destructor to release system resources. More...
 
 ~UserInfoCache ()
 Destructor to release system resources. More...
 

Static Public Member Functions

static const UserInfoUID (UserInfo::uid_type Id)
 Locate an entry based on the identification number of the user. More...
 
static const UserInfoName (const std::string &Name)
 Locate an entry based on the system name of the user. More...
 
static const UserInfoUID (UserInfo::uid_type Id)
 Locate an entry based on the identification number of the user. More...
 
static const UserInfoName (const std::string &Name)
 Locate an entry based on the system name of the user. More...
 
static const UserInfoUID (UserInfo::uid_type Id)
 Locate an entry based on the identification number of the user. More...
 
static const UserInfoName (const std::string &Name)
 Locate an entry based on the system name of the user. More...
 

Private Types

typedef LDASTools::AL::unordered_map< INT_4U, UserInfocache_type
 Container to hold cached infomation. More...
 
typedef LDASTools::AL::unordered_map< std::string, INT_4Uname_mapping_type
 Container to hold mapping from system name to uid. More...
 
typedef LDASTools::AL::unordered_map< INT_4U, UserInfocache_type
 Container to hold cached infomation. More...
 
typedef LDASTools::AL::unordered_map< std::string, INT_4Uname_mapping_type
 Container to hold mapping from system name to uid. More...
 
typedef LDASTools::AL::unordered_map< INT_4U, UserInfocache_type
 Container to hold cached infomation. More...
 
typedef LDASTools::AL::unordered_map< std::string, INT_4Uname_mapping_type
 Container to hold mapping from system name to uid. More...
 

Private Member Functions

 SINGLETON_TS_DECL (UserInfoCache)
 
const UserInfocreate (UserInfo::uid_type Id)
 Create new entry. More...
 
bool init ()
 Initiazation routine. More...
 
const UserInfouid (UserInfo::uid_type Id)
 Return the user identifier. More...
 
 SINGLETON_TS_DECL (UserInfoCache)
 
const UserInfocreate (UserInfo::uid_type Id)
 Create new entry. More...
 
bool init ()
 Initiazation routine. More...
 
const UserInfouid (UserInfo::uid_type Id)
 Return the user identifier. More...
 
 SINGLETON_TS_DECL (UserInfoCache)
 
const UserInfocreate (UserInfo::uid_type Id)
 Create new entry. More...
 
bool init ()
 Initiazation routine. More...
 
const UserInfouid (UserInfo::uid_type Id)
 Return the user identifier. More...
 

Private Attributes

cache_type m_cache
 Storage for the cache. More...
 
name_mapping_type m_names
 Storage for the map between system name and uid. More...
 
MutexLock::baton_type m_baton
 Baton to control access. More...
 

Detailed Description

Cache system information about users.

The information stored within this class contains information about the users that have access to current machine.

Note
This information is currently static. It is gathered when the shared object is loaded and is never updated.

Member Typedef Documentation

◆ cache_type [1/3]

Container to hold cached infomation.

◆ cache_type [2/3]

Container to hold cached infomation.

◆ cache_type [3/3]

Container to hold cached infomation.

◆ name_mapping_type [1/3]

Container to hold mapping from system name to uid.

◆ name_mapping_type [2/3]

Container to hold mapping from system name to uid.

◆ name_mapping_type [3/3]

Container to hold mapping from system name to uid.

Constructor & Destructor Documentation

◆ ~UserInfoCache() [1/3]

LDASTools::AL::UserInfoCache::~UserInfoCache ( )

Destructor to release system resources.

Release resource associated with this object

Todo:
Release the m_names and m_cache resource. Need to be sure to use the baton to insure exclusive rights.

◆ ~UserInfoCache() [2/3]

LDASTools::AL::UserInfoCache::~UserInfoCache ( )

Destructor to release system resources.

◆ ~UserInfoCache() [3/3]

LDASTools::AL::UserInfoCache::~UserInfoCache ( )

Destructor to release system resources.

Member Function Documentation

◆ create() [1/3]

const UserInfoCache::UserInfo & LDASTools::AL::UserInfoCache::create ( UserInfo::uid_type  Id)
private

Create new entry.

Look up a user in the password database and cache the information to prevent excessive use of system calls. If the user id cannot be found in the password database, an entry is created with the user name being the string representation of the user id.

Note
This call is internal and is only called if nothing is known about the specified user id.

◆ create() [2/3]

const UserInfo& LDASTools::AL::UserInfoCache::create ( UserInfo::uid_type  Id)
private

Create new entry.

◆ create() [3/3]

const UserInfo& LDASTools::AL::UserInfoCache::create ( UserInfo::uid_type  Id)
private

Create new entry.

◆ init() [1/3]

bool LDASTools::AL::UserInfoCache::init ( )
private

Initiazation routine.

◆ init() [2/3]

bool LDASTools::AL::UserInfoCache::init ( )
private

Initiazation routine.

◆ init() [3/3]

bool LDASTools::AL::UserInfoCache::init ( )
private

Initiazation routine.

◆ Name() [1/3]

static const UserInfo& LDASTools::AL::UserInfoCache::Name ( const std::string &  Name)
static

Locate an entry based on the system name of the user.

◆ Name() [2/3]

static const UserInfo& LDASTools::AL::UserInfoCache::Name ( const std::string &  Name)
static

Locate an entry based on the system name of the user.

◆ Name() [3/3]

static const UserInfo& LDASTools::AL::UserInfoCache::Name ( const std::string &  Name)
static

Locate an entry based on the system name of the user.

◆ SINGLETON_TS_DECL() [1/3]

LDASTools::AL::UserInfoCache::SINGLETON_TS_DECL ( UserInfoCache  )
private

◆ SINGLETON_TS_DECL() [2/3]

LDASTools::AL::UserInfoCache::SINGLETON_TS_DECL ( UserInfoCache  )
private

◆ SINGLETON_TS_DECL() [3/3]

LDASTools::AL::UserInfoCache::SINGLETON_TS_DECL ( UserInfoCache  )
private

◆ UID() [1/3]

const UserInfoCache::UserInfo & LDASTools::AL::UserInfoCache::UID ( UserInfo::uid_type  Id)
inlinestatic

Locate an entry based on the identification number of the user.

Supply the caller with the full set of information known about the user assoicated with the giver user identification number.

◆ uid() [1/3]

const UserInfoCache::UserInfo & LDASTools::AL::UserInfoCache::uid ( UserInfo::uid_type  Id)
private

Return the user identifier.

◆ UID() [2/3]

static const UserInfo& LDASTools::AL::UserInfoCache::UID ( UserInfo::uid_type  Id)
static

Locate an entry based on the identification number of the user.

◆ uid() [2/3]

const UserInfo& LDASTools::AL::UserInfoCache::uid ( UserInfo::uid_type  Id)
private

Return the user identifier.

◆ UID() [3/3]

static const UserInfo& LDASTools::AL::UserInfoCache::UID ( UserInfo::uid_type  Id)
static

Locate an entry based on the identification number of the user.

◆ uid() [3/3]

const UserInfo& LDASTools::AL::UserInfoCache::uid ( UserInfo::uid_type  Id)
private

Return the user identifier.

Member Data Documentation

◆ m_baton

MutexLock::baton_type LDASTools::AL::UserInfoCache::m_baton
private

Baton to control access.

◆ m_cache

cache_type LDASTools::AL::UserInfoCache::m_cache
private

Storage for the cache.

◆ m_names

name_mapping_type LDASTools::AL::UserInfoCache::m_names
private

Storage for the map between system name and uid.


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