Google APIs Client Library for C++
|
Implements a threadsafe string. More...
#include "client/auth/oauth2_authorization.h"
Public Member Functions | |
ThreadsafeString () | |
bool | empty () const |
void | clear () |
void | set (const StringPiece &value) |
string | as_string () const |
void | AppendTo (string *target) const |
Implements a threadsafe string.
This is intended for access/refresh tokens which are primarily read only to copy them into headers and such but will need to be updated at some point, perhaps in another thread. If the mutex is in the object managing the string (e.g. credential managing the access token) then the update and access operations would need to be in that class as well (or the mutex exposed externally). However pushing the mutex down to the attribute (e.g. access token) decouples the management from uses, plus allows the different attributes to be managed independent of one another. For internal use only
ThreadsafeString | ( | ) | [inline] |
void AppendTo | ( | string * | target | ) | const [inline] |
string as_string | ( | ) | const [inline] |
void clear | ( | ) | [inline] |
bool empty | ( | ) | const [inline] |
void set | ( | const StringPiece & | value | ) | [inline] |