Public Member Functions | Private Attributes | List of all members
OSOutputChannel Class Reference

a class that holds information about one output channel (file, device, stream, peripheral, etc.) More...

#include <OSOutput.h>

Collaboration diagram for OSOutputChannel:
Collaboration graph
[legend]

Public Member Functions

 OSOutputChannel (std::string name)
 Constructor. More...
 
 ~OSOutputChannel ()
 Destructor. More...
 
std::string Name ()
 Get the name of the output channel. More...
 
bool setPrintLevel (ENUM_OUTPUT_AREA area, ENUM_OUTPUT_LEVEL level)
 Set the print level for a particular area. More...
 
bool setAllPrintLevels (ENUM_OUTPUT_LEVEL level)
 Set the print level for all areas. More...
 
bool setAllPrintLevels (ENUM_OUTPUT_LEVEL *level, int dim)
 Set different print levels for all areas. More...
 
bool isAccepted (ENUM_OUTPUT_AREA area, ENUM_OUTPUT_LEVEL level)
 Test if the device accepts a particular combination of print level and area (i.e., if the output should be printed) More...
 
void OSPrintf (ENUM_OUTPUT_AREA area, ENUM_OUTPUT_LEVEL level, std::string str)
 Send one string to the output device provided that the output device "accepts" the output (i.e., the print level applicable to the area that originated the output exceeds the level of the print statement. More...
 
void flushBuffer ()
 Flush output buffer. More...
 
Open: open the channel
Returns
true if successfully opened; false otherwise
bool Open ()
 

Private Attributes

std::string name
 used to give a name to the file or device More...
 
FILE * file
 holds a pointer to the file or device More...
 
int printLevel [ENUM_OUTPUT_AREA_NUMBER_OF_AREAS]
 vector of integers indicating the level for each area More...
 

Detailed Description

a class that holds information about one output channel (file, device, stream, peripheral, etc.)

Definition at line 41 of file OSOutput.h.

Constructor & Destructor Documentation

OSOutputChannel::OSOutputChannel ( std::string  name)

Constructor.

Parameters
nameholds the name of the file or device that applies to this output device in all code areas

Definition at line 42 of file OSOutput.cpp.

OSOutputChannel::~OSOutputChannel ( )

Destructor.

Definition at line 55 of file OSOutput.cpp.

Member Function Documentation

std::string OSOutputChannel::Name ( )

Get the name of the output channel.

Definition at line 59 of file OSOutput.cpp.

bool OSOutputChannel::setPrintLevel ( ENUM_OUTPUT_AREA  area,
ENUM_OUTPUT_LEVEL  level 
)

Set the print level for a particular area.

Parameters
areaholds the area of the code to which this option is to be applied
levelholds a valid print level
Returns
whether the set() was successful

Definition at line 64 of file OSOutput.cpp.

bool OSOutputChannel::setAllPrintLevels ( ENUM_OUTPUT_LEVEL  level)

Set the print level for all areas.

Parameters
levelholds a valid print level
Returns
whether the set() was successful

Definition at line 74 of file OSOutput.cpp.

bool OSOutputChannel::setAllPrintLevels ( ENUM_OUTPUT_LEVEL level,
int  dim 
)

Set different print levels for all areas.

Parameters
levelholds an array of valid print levels
dimholds the number of entries in the array level
Returns
whether the set() was successful

Definition at line 91 of file OSOutput.cpp.

bool OSOutputChannel::isAccepted ( ENUM_OUTPUT_AREA  area,
ENUM_OUTPUT_LEVEL  level 
)

Test if the device accepts a particular combination of print level and area (i.e., if the output should be printed)

Definition at line 109 of file OSOutput.cpp.

void OSOutputChannel::OSPrintf ( ENUM_OUTPUT_AREA  area,
ENUM_OUTPUT_LEVEL  level,
std::string  str 
)

Send one string to the output device provided that the output device "accepts" the output (i.e., the print level applicable to the area that originated the output exceeds the level of the print statement.

Parameters
area,:the area in which the output string originated
level,:the print level associated with the string
str,:the string that is to be printed

Definition at line 114 of file OSOutput.cpp.

void OSOutputChannel::flushBuffer ( )

Flush output buffer.

Definition at line 131 of file OSOutput.cpp.

bool OSOutputChannel::Open ( )

Definition at line 140 of file OSOutput.cpp.

Member Data Documentation

std::string OSOutputChannel::name
private

used to give a name to the file or device

Definition at line 47 of file OSOutput.h.

FILE* OSOutputChannel::file
private

holds a pointer to the file or device

Definition at line 52 of file OSOutput.h.

int OSOutputChannel::printLevel[ENUM_OUTPUT_AREA_NUMBER_OF_AREAS]
private

vector of integers indicating the level for each area

Definition at line 57 of file OSOutput.h.


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