Moved local getters to base class, making them accessible from all the subclasses

This commit is contained in:
rexy712
2019-07-28 12:08:37 -07:00
parent e72658e5b9
commit 788600a883
5 changed files with 28 additions and 29 deletions

View File

@@ -48,23 +48,6 @@ namespace matrix{
client& operator=(const client&) = default;
client& operator=(client&&) = default;
/*
* NOT thread safe.
* Returns: the current access token.
*/
const raii::rjp_string& access_token(void)const;
/*
* NOT thread safe
* Returns: the logged in user's userid.
*/
const raii::rjp_string& userid(void)const;
/*
* NOT thread safe
* Returns: the current useragent.
*/
const raii::string& useragent(void)const;
/*
* Sets the display name on the homeserver.
* Note name must be safe to be placed in a json string.

View File

@@ -43,6 +43,22 @@ namespace matrix{
public:
~connection(void) = default;
/*
* NOT thread safe.
* Returns: the current access token.
*/
const raii::rjp_string& access_token(void)const;
/*
* NOT thread safe
* Returns: the logged in user's userid.
*/
const raii::rjp_string& userid(void)const;
/*
* NOT thread safe
* Returns: the current useragent.
*/
const raii::string& useragent(void)const;
/*
* Returns: the http status code of the last operation performed.
*/

View File

@@ -31,7 +31,7 @@
namespace matrix{
//Manages connection to homeserver and user login.
//Shares states with any spawned clients and syncers.
class session : protected connection
class session : public connection
{
private:
bool m_valid = false;