Represents a unique DHCP user This class is used to represent a specific DHCP user who is identified by a unique id and who possesses a set of properties.
More...
#include <user.h>
|
| User (const UserId &user_id) |
| Constructor.
|
|
| User (UserId::UserIdType id_type, const std::string &id_str) |
| Constructor.
|
|
| User (UserId::UserIdType id_type, const std::vector< uint8_t > &id) |
| Constructor.
|
|
| ~User () |
| Destructor.
|
|
void | delProperty (const std::string &name) |
| Removes the given property from the property map.
|
|
const PropertyMap & | getProperties () const |
| Returns a reference to the map of properties.
|
|
std::string | getProperty (const std::string &name) const |
| Fetches the string value for a given property name.
|
|
const UserId & | getUserId () const |
| Returns the user's id.
|
|
void | setProperties (const PropertyMap &properties) |
| Sets the user's properties from a given property map.
|
|
void | setProperty (const std::string &name, const std::string &value) |
| Sets a given property to the given value.
|
|
Represents a unique DHCP user This class is used to represent a specific DHCP user who is identified by a unique id and who possesses a set of properties.
Definition at line 150 of file user.h.
◆ User() [1/3]
user_chk::User::User |
( |
const UserId & | user_id | ) |
|
Constructor.
Constructs a new User from a given id with an empty set of properties.
- Parameters
-
user_id | Id to assign to the user |
- Exceptions
-
Definition at line 155 of file user.cc.
◆ User() [2/3]
Constructor.
Constructs a new User from a given id type and vector containing the id data with an empty set of properties.
- Parameters
-
id_type | Type of id contained in the id vector |
id | Vector of data representing the user's id |
- Exceptions
-
Definition at line 158 of file user.cc.
◆ User() [3/3]
Constructor.
Constructs a new User from a given id type and string containing the id data with an empty set of properties.
- Parameters
-
id_type | Type of id contained in the id vector |
id_str | string of hex digits representing the user's id |
- Exceptions
-
Definition at line 162 of file user.cc.
◆ ~User()
user_chk::User::~User |
( |
| ) |
|
Destructor.
Definition at line 166 of file user.cc.
◆ delProperty()
void user_chk::User::delProperty |
( |
const std::string & | name | ) |
|
Removes the given property from the property map.
Removes the given property from the map if found. If not, no harm no foul.
- Parameters
-
name | property name to remove |
Definition at line 202 of file user.cc.
◆ getProperties()
const PropertyMap & user_chk::User::getProperties |
( |
| ) |
const |
Returns a reference to the map of properties.
Note that this reference can go out of scope and should not be relied upon other than for momentary use.
Definition at line 170 of file user.cc.
◆ getProperty()
std::string user_chk::User::getProperty |
( |
const std::string & | name | ) |
const |
Fetches the string value for a given property name.
- Parameters
-
name | property name to fetch |
- Returns
- Returns the string value for the given name or an empty string if the property is not found in the property map.
Definition at line 189 of file user.cc.
◆ getUserId()
const UserId & user_chk::User::getUserId |
( |
| ) |
const |
Returns the user's id.
Note that this reference can go out of scope and should not be relied upon other than for momentary use.
Definition at line 210 of file user.cc.
◆ setProperties()
void user_chk::User::setProperties |
( |
const PropertyMap & | properties | ) |
|
Sets the user's properties from a given property map.
Replaces the contents of the user's property map with the given property map.
- Parameters
-
properties | property map to assign to the user |
Definition at line 175 of file user.cc.
◆ setProperty()
void user_chk::User::setProperty |
( |
const std::string & | name, |
|
|
const std::string & | value ) |
Sets a given property to the given value.
Adds or updates the given property to the given value.
- Parameters
-
name | string by which the property is identified (keyed) |
value | string data to associate with the property |
- Exceptions
-
Definition at line 179 of file user.cc.
References isc_throw.
The documentation for this class was generated from the following files: