pion-net  4.0.9
Public Member Functions | Protected Types | Protected Attributes
pion::net::PionUserManager Class Reference

#include <PionUser.hpp>

Inherits noncopyable.

List of all members.

Public Member Functions

 PionUserManager (void)
 construct a new PionUserManager object
virtual ~PionUserManager ()
 virtual destructor
bool empty (void) const
 returns true if no users are defined
virtual bool addUser (const std::string &username, const std::string &password)
virtual bool updateUser (const std::string &username, const std::string &password)
virtual bool removeUser (const std::string &username)
virtual PionUserPtr getUser (const std::string &username)
virtual PionUserPtr getUser (const std::string &username, const std::string &password)

Protected Types

typedef std::map< std::string,
PionUserPtr > 
UserMap
 data type for a map of usernames to user objects

Protected Attributes

boost::mutex m_mutex
 mutex used to protect access to the user list
UserMap m_users
 user records container

Detailed Description

PionUserManager base class for PionUser container/manager

Definition at line 147 of file PionUser.hpp.


Member Function Documentation

virtual bool pion::net::PionUserManager::addUser ( const std::string &  username,
const std::string &  password 
) [inline, virtual]

used to add a new user with plaintext password

Parameters:
usernamename or identifier of the user to add
passwordplaintext password of the user to add
Returns:
false if user with such a name already exists

Definition at line 172 of file PionUser.hpp.

References m_mutex, and m_users.

virtual PionUserPtr pion::net::PionUserManager::getUser ( const std::string &  username) [inline, virtual]

Used to locate user object by username

Definition at line 262 of file PionUser.hpp.

References m_mutex, and m_users.

virtual PionUserPtr pion::net::PionUserManager::getUser ( const std::string &  username,
const std::string &  password 
) [inline, virtual]

Used to locate user object by username and password

Definition at line 274 of file PionUser.hpp.

References m_mutex, and m_users.

virtual bool pion::net::PionUserManager::removeUser ( const std::string &  username) [inline, virtual]

used to remove given user

Returns:
false if no user with such username

Definition at line 250 of file PionUser.hpp.

References m_mutex, and m_users.

virtual bool pion::net::PionUserManager::updateUser ( const std::string &  username,
const std::string &  password 
) [inline, virtual]

update password for given user

Parameters:
usernamename or identifier of the user to update
passwordplaintext password of the user to update
Returns:
false if user with such a name doesn't exist

Definition at line 192 of file PionUser.hpp.

References m_mutex, and m_users.


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