Google APIs Client Library for C++
ThreadsafeString Class Reference

Implements a threadsafe string. More...

#include "client/auth/oauth2_authorization.h"

List of all members.

Public Member Functions

 ThreadsafeString ()
bool empty () const
void clear ()
void set (const StringPiece &value)
string as_string () const
void AppendTo (string *target) const

Detailed Description

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


Constructor & Destructor Documentation

ThreadsafeString ( ) [inline]

Member Function Documentation

void AppendTo ( string *  target) const [inline]
string as_string ( ) const [inline]
void clear ( ) [inline]
bool empty ( ) const [inline]
void set ( const StringPiece &  value) [inline]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines