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]

List of all members.

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 88 of file OSOutput.h.


Constructor & Destructor Documentation

OSOutputChannel::OSOutputChannel ( std::string  name  ) 

Constructor.

Parameters:
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 56 of file OSOutput.cpp.


Member Function Documentation

std::string OSOutputChannel::Name (  ) 

Get the name of the output channel.

Definition at line 60 of file OSOutput.cpp.

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

Set the print level for a particular area.

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

Definition at line 65 of file OSOutput.cpp.

bool OSOutputChannel::setAllPrintLevels ( ENUM_OUTPUT_LEVEL  level  ) 

Set the print level for all areas.

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

Definition at line 75 of file OSOutput.cpp.

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

Set different print levels for all areas.

Parameters:
level holds an array of valid print levels
dim holds the number of entries in the array level
Returns:
whether the set() was successful

Definition at line 92 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 110 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 115 of file OSOutput.cpp.

void OSOutputChannel::flushBuffer (  ) 

Flush output buffer.

Definition at line 132 of file OSOutput.cpp.

bool OSOutputChannel::Open (  ) 

Definition at line 141 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 94 of file OSOutput.h.

FILE* OSOutputChannel::file [private]

holds a pointer to the file or device

Definition at line 99 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 104 of file OSOutput.h.


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

Generated on 24 Jul 2013 by  doxygen 1.6.1