OPAL  Version 3.10.10
SafeString Class Reference

#include <safestrings.h>

Inheritance diagram for SafeString:

Public Member Functions

 SafeString ()
 
 SafeString (PString newValue)
 
void operator= (PString newValue)
 
PString Get ()
 
virtual void PrintOn (ostream &str) const
 
 operator PString ()
 
void operator+= (PString toBeAdded)
 
PString GetAndDelete ()
 
PBoolean IsEmpty () const
 

Protected Attributes

PString internal
 
PMutex mutex
 

Detailed Description

A class to handle thread safe access to a PString

Constructor & Destructor Documentation

◆ SafeString() [1/2]

SafeString::SafeString ( )
inline

Construct this class with an empty internal value

◆ SafeString() [2/2]

SafeString::SafeString ( PString  newValue)
inline

Construct this class with the internal value set to something

Member Function Documentation

◆ Get()

PString SafeString::Get ( )
inline

Retrieve the value of the internal variable

References SafeStrings::IsEmpty().

◆ GetAndDelete()

PString SafeString::GetAndDelete ( )

Retrieve and clear the value of the internal variable

◆ IsEmpty()

PBoolean SafeString::IsEmpty ( ) const

Return True if this list is empty

◆ operator PString()

SafeString::operator PString ( )

Retrive the value of the internal variable as a string

◆ operator+=()

void SafeString::operator+= ( PString  toBeAdded)

Add a new text to the string, in a thread safe fashion.

◆ operator=()

void SafeString::operator= ( PString  newValue)

Assign a new value to the internal variable

◆ PrintOn()

virtual void SafeString::PrintOn ( ostream &  str) const
virtual

print the internal string to the designated stream

Field Documentation

◆ internal

PString SafeString::internal
protected

The internal variable which is accessed in a thread safe fashion.

◆ mutex

PMutex SafeString::mutex
protected

The lock, which is used to safeguard access to this variable


The documentation for this class was generated from the following file: