My Project
OSOutputChannel Class Reference

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

#include <OSOutput.h>

Public Member Functions

 OSOutputChannel (std::string name)
 Constructor.
 
 ~OSOutputChannel ()
 Destructor.
 
std::string Name ()
 Get the name of the output channel.
 
bool setPrintLevel (ENUM_OUTPUT_AREA area, ENUM_OUTPUT_LEVEL level)
 Set the print level for a particular area.
 
bool setAllPrintLevels (ENUM_OUTPUT_LEVEL level)
 Set the print level for all areas.
 
bool setAllPrintLevels (ENUM_OUTPUT_LEVEL *level, int dim)
 Set different print levels for all areas.
 
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)
 
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.
 
void flushBuffer ()
 Flush output buffer.
 
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
 
FILE * file
 holds a pointer to the file or device
 
int printLevel [ENUM_OUTPUT_AREA_NUMBER_OF_AREAS]
 vector of integers indicating the level for each area
 

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::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::~OSOutputChannel ( )

Destructor.

Definition at line 55 of file OSOutput.cpp.

Member Function Documentation

◆ Name()

std::string OSOutputChannel::Name ( )

Get the name of the output channel.

Definition at line 59 of file OSOutput.cpp.

◆ setPrintLevel()

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.

◆ setAllPrintLevels() [1/2]

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.

◆ setAllPrintLevels() [2/2]

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.

◆ isAccepted()

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.

◆ OSPrintf()

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
areathe area in which the output string originated
levelthe print level associated with the string
strthe string that is to be printed

Definition at line 114 of file OSOutput.cpp.

◆ flushBuffer()

void OSOutputChannel::flushBuffer ( )

Flush output buffer.

Definition at line 131 of file OSOutput.cpp.

◆ Open()

bool OSOutputChannel::Open ( )

Definition at line 140 of file OSOutput.cpp.

Member Data Documentation

◆ name

std::string OSOutputChannel::name
private

used to give a name to the file or device

Definition at line 47 of file OSOutput.h.

◆ file

FILE* OSOutputChannel::file
private

holds a pointer to the file or device

Definition at line 52 of file OSOutput.h.

◆ printLevel

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: