class UserProfile

August 13, 2019 ยท View on GitHub

Member values

Member nameData typeDescription
handleUserProfileHandleUser handle (no need to set it with CreateUserProfile())
usernamestringUsername, which is used to connect to robot (or login via Web App)
firstnamestringUser's first name
lastnamestringUser's last name
application_datastringApplication data (reserved for use by Web App)

Member functions

Function nameReturn typeInput typeDescription
has_handle() constboolvoidReturns true if handle is set.
handle()const UserProfileHandle&voidReturns the current value of handle. If handle is not set, returns a UserProfileHandle with none of its fields set (possibly handle::default_instance()).
mutable_handle()UserProfileHandle *voidReturns a pointer to the mutable UserProfileHandle object that stores the field's value. If the field was not set prior to the call, then the returned UserProfileHandle will have none of its fields set (i.e. it will be identical to a newly-allocated UserProfileHandle). After calling this, has_handle() will return true and handle() will return a reference to the same instance of UserProfileHandle.
clear_handle()voidvoidClears the value of the field. After calling this, has_handle() will return false and handle() will return the default value.
set_allocated_handle()voidUserProfileHandle *Sets the UserProfileHandle object to the field and frees the previous field value if it exists. If the UserProfileHandle pointer is not NULL, the message takes ownership of the allocated UserProfileHandle object and has_ UserProfileHandle() will return true. Otherwise, if the handle is NULL, the behavior is the same as calling clear_handle().
release_handle()UserProfileHandle *voidReleases the ownership of the field and returns the pointer of the UserProfileHandle object. After calling this, caller takes the ownership of the allocated UserProfileHandle object, has_handle() will return false, and handle() will return the default value.
username()const string&voidReturns the current value of username. If username is not set, returns the empty string/empty bytes.
set_username()voidconst string&Sets the value of username. After calling this, username() will return a copy of value.
set_username()voidstring&&(C++11 and beyond): Sets the value of username, moving from the passed string. After calling this, username() will return a copy of value.
set_username()voidconst char*Sets the value of username using a C-style null-terminated string. After calling this, username() will return a copy of value.
mutable_username()string *voidReturns a pointer to the mutable string object that stores username's value. If the field was not set prior to the call, then the returned string will be empty. After calling this, username() will return whatever value is written into the given string.
clear_username()voidvoidClears the value of username. After calling this, username() will return the empty string/empty bytes.
set_allocated_username()voidstring*Sets the string object to the field and frees the previous field value if it exists. If the string pointer is not NULL, the message takes ownership of the allocated string object. The message is free to delete the allocated string object at any time, so references to the object may be invalidated. Otherwise, if the value is NULL, the behavior is the same as calling clear_username().
release_username()string *voidReleases the ownership of username and returns the pointer of the string object. After calling this, caller takes the ownership of the allocated string object and username() will return the empty string/empty bytes.
firstname()const string&voidReturns the current value of firstname. If firstname is not set, returns the empty string/empty bytes.
set_firstname()voidconst string&Sets the value of firstname. After calling this, firstname() will return a copy of value.
set_firstname()voidstring&&(C++11 and beyond): Sets the value of firstname, moving from the passed string. After calling this, firstname() will return a copy of value.
set_firstname()voidconst char*Sets the value of firstname using a C-style null-terminated string. After calling this, firstname() will return a copy of value.
mutable_firstname()string *voidReturns a pointer to the mutable string object that stores firstname's value. If the field was not set prior to the call, then the returned string will be empty. After calling this, firstname() will return whatever value is written into the given string.
clear_firstname()voidvoidClears the value of firstname. After calling this, firstname() will return the empty string/empty bytes.
set_allocated_firstname()voidstring*Sets the string object to the field and frees the previous field value if it exists. If the string pointer is not NULL, the message takes ownership of the allocated string object. The message is free to delete the allocated string object at any time, so references to the object may be invalidated. Otherwise, if the value is NULL, the behavior is the same as calling clear_firstname().
release_firstname()string *voidReleases the ownership of firstname and returns the pointer of the string object. After calling this, caller takes the ownership of the allocated string object and firstname() will return the empty string/empty bytes.
lastname()const string&voidReturns the current value of lastname. If lastname is not set, returns the empty string/empty bytes.
set_lastname()voidconst string&Sets the value of lastname. After calling this, lastname() will return a copy of value.
set_lastname()voidstring&&(C++11 and beyond): Sets the value of lastname, moving from the passed string. After calling this, lastname() will return a copy of value.
set_lastname()voidconst char*Sets the value of lastname using a C-style null-terminated string. After calling this, lastname() will return a copy of value.
mutable_lastname()string *voidReturns a pointer to the mutable string object that stores lastname's value. If the field was not set prior to the call, then the returned string will be empty. After calling this, lastname() will return whatever value is written into the given string.
clear_lastname()voidvoidClears the value of lastname. After calling this, lastname() will return the empty string/empty bytes.
set_allocated_lastname()voidstring*Sets the string object to the field and frees the previous field value if it exists. If the string pointer is not NULL, the message takes ownership of the allocated string object. The message is free to delete the allocated string object at any time, so references to the object may be invalidated. Otherwise, if the value is NULL, the behavior is the same as calling clear_lastname().
release_lastname()string *voidReleases the ownership of lastname and returns the pointer of the string object. After calling this, caller takes the ownership of the allocated string object and lastname() will return the empty string/empty bytes.
application_data()const string&voidReturns the current value of application_data. If application_data is not set, returns the empty string/empty bytes.
set_application_data()voidconst string&Sets the value of application_data. After calling this, application_data() will return a copy of value.
set_application_data()voidstring&&(C++11 and beyond): Sets the value of application_data, moving from the passed string. After calling this, application_data() will return a copy of value.
set_application_data()voidconst char*Sets the value of application_data using a C-style null-terminated string. After calling this, application_data() will return a copy of value.
mutable_application_data()string *voidReturns a pointer to the mutable string object that stores application_data's value. If the field was not set prior to the call, then the returned string will be empty. After calling this, application_data() will return whatever value is written into the given string.
clear_application_data()voidvoidClears the value of application_data. After calling this, application_data() will return the empty string/empty bytes.
set_allocated_application_data()voidstring*Sets the string object to the field and frees the previous field value if it exists. If the string pointer is not NULL, the message takes ownership of the allocated string object. The message is free to delete the allocated string object at any time, so references to the object may be invalidated. Otherwise, if the value is NULL, the behavior is the same as calling clear_application_data().
release_application_data()string *voidReleases the ownership of application_data and returns the pointer of the string object. After calling this, caller takes the ownership of the allocated string object and application_data() will return the empty string/empty bytes.

Parent topic: Base (C++)