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. 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 | |
| |
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... | |
a class that holds information about one output channel (file, device, stream, peripheral, etc.)
Definition at line 41 of file OSOutput.h.
OSOutputChannel::OSOutputChannel | ( | std::string | name | ) |
Constructor.
name | holds 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.
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.
area | holds the area of the code to which this option is to be applied |
level | holds a valid print level |
Definition at line 64 of file OSOutput.cpp.
bool OSOutputChannel::setAllPrintLevels | ( | ENUM_OUTPUT_LEVEL | level | ) |
Set the print level for all areas.
level | holds a valid print level |
Definition at line 74 of file OSOutput.cpp.
bool OSOutputChannel::setAllPrintLevels | ( | ENUM_OUTPUT_LEVEL * | level, |
int | dim | ||
) |
Set different print levels for all areas.
level | holds an array of valid print levels |
dim | holds the number of entries in the array level |
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.
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.
|
private |
used to give a name to the file or device
Definition at line 47 of file OSOutput.h.
|
private |
holds a pointer to the file or device
Definition at line 52 of file OSOutput.h.
|
private |
vector of integers indicating the level for each area
Definition at line 57 of file OSOutput.h.