The Pedigree Project 0.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
User Class Reference

#include <User.h>

+ Collaboration diagram for User:

Public Member Functions

 User (size_t uid, const String &username, const String &fullName, Group *pGroup, const String &home, const String &shell)
 
virtual ~User ()
 
void join (Group *pGroup)
 
void leave (Group *pGroup)
 
bool isMember (Group *pGroup)
 
bool login ()
 
size_t getId () const
 
const StringgetUsername () const
 
const StringgetFullName () const
 
GroupgetDefaultGroup ()
 
const StringgetHome () const
 
const StringgetShell () const
 

Private Member Functions

 User ()
 
 User (const User &)
 
Useroperator= (const User &)
 

Private Attributes

size_t m_Uid
 
String m_Username
 
String m_FullName
 
Groupm_pDefaultGroup
 
String m_Home
 
String m_Shell
 
List< Group * > m_Groups
 

Detailed Description

Defines the properties of a User on the system.

Definition at line 32 of file User.h.

Constructor & Destructor Documentation

◆ User() [1/2]

User::User ( size_t  uid,
const String username,
const String fullName,
Group pGroup,
const String home,
const String shell 
)

Constructor

Parameters
uidThe user's system-wide unique ID.
nameThe user's username.
fullNameThe user's full name.
pGroupThe default group.
homeThe user's home directory.
shellThe user's default shell.

Definition at line 30 of file User.cc.

◆ ~User()

User::~User ( )
virtual

The destructor does nothing.

Definition at line 40 of file User.cc.

◆ User() [2/2]

User::User ( )
private

It doesn't make sense for a User to have a default or copy constructor.

Member Function Documentation

◆ getDefaultGroup()

Group * User::getDefaultGroup ( )
inline

Retrieves the user's default group.

Definition at line 72 of file User.h.

Referenced by UserManager::initialise().

+ Here is the caller graph for this function:

◆ getFullName()

const String & User::getFullName ( ) const
inline

Retrieves the user's full name.

Definition at line 68 of file User.h.

◆ getHome()

const String & User::getHome ( ) const
inline

Retrieves the user's home directory.

Definition at line 76 of file User.h.

◆ getId()

size_t User::getId ( ) const
inline

Retrieves the user's UID.

Definition at line 60 of file User.h.

Referenced by ProcFs::addProcess().

+ Here is the caller graph for this function:

◆ getShell()

const String & User::getShell ( ) const
inline

Retrieves the user's default shell.

Definition at line 80 of file User.h.

◆ getUsername()

const String & User::getUsername ( ) const
inline

Retrieves the user's username.

Definition at line 64 of file User.h.

Referenced by UserManager::getUser().

+ Here is the caller graph for this function:

◆ isMember()

bool User::isMember ( Group pGroup)

Queries a group membership.

Definition at line 55 of file User.cc.

References List< T, nodePoolSize >::begin(), List< T, nodePoolSize >::end(), m_Groups, and m_pDefaultGroup.

◆ join()

void User::join ( Group pGroup)

Adds a group membership.

Definition at line 42 of file User.cc.

References m_Groups, and List< T, nodePoolSize >::pushBack().

◆ leave()

void User::leave ( Group pGroup)

Removes a group membership.

Definition at line 46 of file User.cc.

References List< T, nodePoolSize >::begin(), List< T, nodePoolSize >::end(), List< T, nodePoolSize >::erase(), and m_Groups.

◆ login()

bool User::login ( )

Sets this process' identity to this user and its default group.

Definition at line 65 of file User.cc.

References ProcessorBase::information(), m_Groups, and m_pDefaultGroup.

Member Data Documentation

◆ m_FullName

String User::m_FullName
private

Full name

Definition at line 96 of file User.h.

◆ m_Groups

List<Group*> User::m_Groups
private

Set of groups (excluding default group).

Definition at line 104 of file User.h.

Referenced by isMember(), join(), leave(), and login().

◆ m_Home

String User::m_Home
private

Home directory.

Definition at line 100 of file User.h.

◆ m_pDefaultGroup

Group* User::m_pDefaultGroup
private

Default group.

Definition at line 98 of file User.h.

Referenced by isMember(), and login().

◆ m_Shell

String User::m_Shell
private

Default shell.

Definition at line 102 of file User.h.

◆ m_Uid

size_t User::m_Uid
private

User ID

Definition at line 92 of file User.h.

◆ m_Username

String User::m_Username
private

Username

Definition at line 94 of file User.h.


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