MsgStandardOStream Class Reference

#include <MsgStandardOStream.h>

Inheritance diagram for MsgStandardOStream:
MsgOStream

List of all members.

Public Member Functions

 MsgStandardOStream ()
 MsgStandardOStream (const char *name)
 ~MsgStandardOStream ()
const char * GetName () const
std::ostream & Os () const
void Close ()

Private Types

enum  EStdOStream { kUnknownOStream = 0, kCout = 1, kCerr = 2, kClog = 3 }
typedef enum
MsgStandardOStream::EStdOStream 
StdOStream_t

Private Attributes

StdOStream_t kStream

Detailed Description

Definition at line 16 of file MsgStandardOStream.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
kUnknownOStream 
kCout 
kCerr 
kClog 

Definition at line 28 of file MsgStandardOStream.h.

00028                            {
00029     kUnknownOStream = 0,
00030     kCout           = 1,
00031     kCerr           = 2,
00032     kClog           = 3
00033   } StdOStream_t;


Constructor & Destructor Documentation

MsgStandardOStream::MsgStandardOStream (  )  [inline]

Definition at line 19 of file MsgStandardOStream.h.

00019 { }

MsgStandardOStream::MsgStandardOStream ( const char *  name  ) 

Definition at line 17 of file MsgStandardOStream.cxx.

References kCerr, kClog, kCout, and kStream.

00018 {
00019 //======================================================================
00020 // Purpose: Create one of the standatd output streams given its name
00021 //
00022 // Inputs: name - the name of the standard stream
00023 //======================================================================
00024   if (strcmp(name,"cout") == 0) { kStream = kCout; return; }
00025   if (strcmp(name,"cerr") == 0) { kStream = kCerr; return; }
00026   if (strcmp(name,"clog") == 0) { kStream = kClog; return; }
00027   abort();
00028 }

MsgStandardOStream::~MsgStandardOStream (  )  [inline]

Definition at line 21 of file MsgStandardOStream.h.

00021 { }


Member Function Documentation

void MsgStandardOStream::Close (  )  [inline, virtual]

Reimplemented from MsgOStream.

Definition at line 26 of file MsgStandardOStream.h.

Referenced by MsgOStreamServiceValidate::TestMsgStandardOStream().

00026 { }

const char * MsgStandardOStream::GetName ( void   )  const [virtual]

Implements MsgOStream.

Definition at line 32 of file MsgStandardOStream.cxx.

References kCerr, kClog, kCout, and kStream.

Referenced by MsgOStreamServiceValidate::TestMsgStandardOStream().

00033 {
00034 //======================================================================
00035 // Purpose: Return the name of this output stream
00036 //
00037 // Returns: The name of the output stream
00038 //======================================================================
00039   switch (kStream) {
00040   case kCout: return "cout"; // break;
00041   case kCerr: return "cerr"; // break;
00042   case kClog: return "clog"; // break;
00043   default: abort();
00044   }
00045   return ""; // Should never get here but this keeps compliers happy
00046 }

std::ostream & MsgStandardOStream::Os (  )  const [virtual]

Implements MsgOStream.

Definition at line 50 of file MsgStandardOStream.cxx.

References kCerr, kClog, kCout, and kStream.

Referenced by MsgOStreamServiceValidate::TestMsgStandardOStream().

00051 {
00052 //======================================================================
00053 // Purpose: Return the output stream connected to this stream
00054 //
00055 // Returns: the output stream connected to this stream
00056 //======================================================================
00057   switch (kStream) {
00058   case kCout: return std::cout; // break;
00059   case kCerr: return std::cerr; // break;
00060   case kClog: return std::clog; // break;
00061   default:    abort();     break;
00062   }
00063   return std::cerr; // Should never get here but this keep compliers happy
00064 }


Member Data Documentation

Definition at line 35 of file MsgStandardOStream.h.

Referenced by GetName(), MsgStandardOStream(), and Os().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1