ldas-tools-al 2.6.7
Loading...
Searching...
No Matches
UserInfoCache Class Reference

Cache system information about users. More...

#include <UserInfoCache.hh>

Collaboration diagram for UserInfoCache:

Classes

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

Public Member Functions

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

Static Public Member Functions

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

Private Types

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

Private Member Functions

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

Private Attributes

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

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/2]

Container to hold cached infomation.

◆ cache_type [2/2]

Container to hold cached infomation.

◆ name_mapping_type [1/2]

Container to hold mapping from system name to uid.

◆ name_mapping_type [2/2]

Container to hold mapping from system name to uid.

Constructor & Destructor Documentation

◆ ~UserInfoCache() [1/2]

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/2]

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

Destructor to release system resources.

Member Function Documentation

◆ create() [1/2]

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/2]

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

Create new entry.

◆ init() [1/2]

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

Initiazation routine.

◆ init() [2/2]

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

Initiazation routine.

◆ Name() [1/2]

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

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

◆ Name() [2/2]

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/2]

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

◆ SINGLETON_TS_DECL() [2/2]

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

◆ UID() [1/2]

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() [2/2]

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

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

◆ uid() [1/2]

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

Return the user identifier.

◆ uid() [2/2]

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:
  • /home/abuild/rpmbuild/BUILD/ldas-tools-al-2.6.7-build/ldas-tools-al-2.6.7/build/include/ldastoolsal/UserInfoCache.hh
  • /home/abuild/rpmbuild/BUILD/ldas-tools-al-2.6.7-build/ldas-tools-al-2.6.7/src/UserInfoCache.hh
  • /home/abuild/rpmbuild/BUILD/ldas-tools-al-2.6.7-build/ldas-tools-al-2.6.7/src/UserInfoCache.cc