Operator Console
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
CriticalCString Class Reference

A null-terminated string class for which all access is controlled by critical sections. More...

#include <CriticalCString.h>

Inheritance diagram for CriticalCString:
[legend]

Public Member Functions

 CriticalCString (void)
 
virtual ~CriticalCString (void)
 
bool Append (CString &str)
 
bool Append (const char *str, int len)
 
void Clear ()
 
void Get (CString &str, bool clear=false)
 copy m_string into str, then optionally clear m_string More...
 
void Set (CString &str)
 
void Set (std::string &str)
 
void Set (const char *str)
 
void Set (const char *str, int len)
 
 CriticalCString (void)
 
virtual ~CriticalCString (void)
 
bool Append (CString &str)
 
bool Append (const char *str, int len)
 
void Clear ()
 
void Get (CString &str, bool clear=false)
 copy m_string into str, then optionally clear m_string More...
 
void Set (CString &str)
 
void Set (std::string &str)
 
void Set (const char *str)
 
void Set (const char *str, int len)
 

Private Attributes

CString m_string
 

Detailed Description

A null-terminated string class for which all access is controlled by critical sections.

Constructor & Destructor Documentation

CriticalCString::CriticalCString ( void  )
24 {
25 }
CriticalCString::~CriticalCString ( void  )
virtual
29 {
30 }
CriticalCString::CriticalCString ( void  )
virtual CriticalCString::~CriticalCString ( void  )
virtual

Member Function Documentation

bool CriticalCString::Append ( CString &  str)

References m_string.

Referenced by ImageTest::GetDataNode(), ImageTest::GetPassFailNode(), ImageTest::GetString(), ImageTest::ParseFailures(), and StdoutThread::ThreadProc().

88 {
89  bool wasEmpty;
90 
91  Lock();
92  wasEmpty = m_string.IsEmpty();
93 
94  if (!str.IsEmpty())
95  {
96  m_string.Append(str); // concatenate str onto the end of m_string
97  }
98 
99  Unlock();
100 
101  return wasEmpty;
102 }
CString m_string
Definition: CriticalCString.h:42

Here is the caller graph for this function:

bool CriticalCString::Append ( CString &  str)
bool CriticalCString::Append ( const char *  str,
int  len 
)

References m_string.

105 {
106  bool wasEmpty;
107 
108  Lock();
109  wasEmpty = m_string.IsEmpty();
110 
111  if (str != NULL)
112  {
113  m_string.Append(str,len); // concatenate str onto the end of m_string
114  }
115 
116  Unlock();
117 
118  return wasEmpty;
119 }
CString m_string
Definition: CriticalCString.h:42
bool CriticalCString::Append ( const char *  str,
int  len 
)
void CriticalCString::Clear ( )
void CriticalCString::Clear ( )

References m_string.

Referenced by ImageTest::InitResults().

33 {
34  Lock();
35  m_string.Empty();
36  Unlock();
37 }
CString m_string
Definition: CriticalCString.h:42

Here is the caller graph for this function:

void CriticalCString::Get ( CString &  str,
bool  clear = false 
)

copy m_string into str, then optionally clear m_string

References m_string.

Referenced by StdoutThread::Get().

41 {
42  Lock();
43  dest = m_string; // copy m_string into dest str
44 
45  if (clear)
46  {
47  m_string.Empty();
48  }
49  Unlock();
50 }
CString m_string
Definition: CriticalCString.h:42

Here is the caller graph for this function:

void CriticalCString::Get ( CString &  str,
bool  clear = false 
)

copy m_string into str, then optionally clear m_string

void CriticalCString::Set ( CString &  str)
void CriticalCString::Set ( CString &  str)

References m_string.

Referenced by ImageTest::ParseFailures(), and StdoutThread::ThreadProc().

53 {
54  Lock();
55  m_string = src; // copy src into m_string
56  Unlock();
57 }
CString m_string
Definition: CriticalCString.h:42

Here is the caller graph for this function:

void CriticalCString::Set ( std::string &  str)
void CriticalCString::Set ( std::string &  str)

References m_string.

60 {
61  Lock();
62  m_string.SetString(src.c_str()); // copy src into m_string
63  Unlock();
64 }
CString m_string
Definition: CriticalCString.h:42
void CriticalCString::Set ( const char *  str)
void CriticalCString::Set ( const char *  str)

References m_string.

67 {
68  if (src != NULL)
69  {
70  Lock();
71  m_string.SetString(src); // copy src into m_string
72  Unlock();
73  }
74 }
CString m_string
Definition: CriticalCString.h:42
void CriticalCString::Set ( const char *  str,
int  len 
)

References m_string.

77 {
78  if (str != NULL)
79  {
80  Lock();
81  m_string.SetString(str, len); // copy len characters of str into m_string
82  m_string.AppendChar('\0');
83  Unlock();
84  }
85 }
CString m_string
Definition: CriticalCString.h:42
void CriticalCString::Set ( const char *  str,
int  len 
)

Member Data Documentation

CString CriticalCString::m_string
private

Referenced by Append(), Clear(), Get(), and Set().


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