This class handles all the output from OSSolverService, OSAmplClient and other executables derived from them. Every output statement in the code uses methods in this class, passing information about the area that originated the request as well as the print, verbosity or severity level of the message. The message creates output only if the print level matches the user specifications. The main advantage of doing things this way is that multiple output streams can be maintained, each tailored to a specific need and containing only output that the user really wants to see. There can be as many output streams as needed; each one has an identifying name ("stdout" and "stderr" are reserved names) and an array of print levels, one for each area. The class is implemented as a Singleton, which means that two private methods must be defined in the header but must never be implemented: a copy constructor, and an equality operator.
More...
#include <OSOutput.h>
This class handles all the output from OSSolverService, OSAmplClient and other executables derived from them. Every output statement in the code uses methods in this class, passing information about the area that originated the request as well as the print, verbosity or severity level of the message. The message creates output only if the print level matches the user specifications. The main advantage of doing things this way is that multiple output streams can be maintained, each tailored to a specific need and containing only output that the user really wants to see. There can be as many output streams as needed; each one has an identifying name ("stdout" and "stderr" are reserved names) and an array of print levels, one for each area. The class is implemented as a Singleton, which means that two private methods must be defined in the header but must never be implemented: a copy constructor, and an equality operator.
Definition at line 146 of file OSOutput.h.
◆ OSOutput()
◆ ~OSOutput()
◆ OSPrint()
This is the main method to output a string All output generated by the program should ultimately use this method.
- Parameters
-
level | the print level associated with the string |
area | the area of the code in which the output was generated |
outStr | the string to be output
|
- Returns
- whether the output operation was successful
◆ FlushAllBuffers()
void OSOutput::FlushAllBuffers |
( |
| ) |
|
◆ SetPrintLevel() [1/2]
Modify all print levels associated with a channel.
- Parameters
-
name | The name of the channel ("stdout" and "stderr" are reserved names) |
level | The array of print levels used for the output to this channel |
dim | The number of entries in this array |
- Returns
- whether the operation was successful
◆ SetPrintLevel() [2/2]
set the print level associated with a channel
- Parameters
-
name | The name of the channel ("stdout" and "stderr" are reserved names) |
level | The print level used for the output to this channel if < ENUM_OUTPUT_LEVEL_NUMBER_OF_LEVELS, set the (same) print level in all areas otherwise set the print level only in one particular area |
- Returns
- whether the operation was successful
◆ AddChannel()
int OSOutput::AddChannel |
( |
std::string |
name | ) |
|
Add a channel to the array outputChannel.
- Parameters
-
name | The name of the channel ("stdout" and "stderr" are reserved names) |
- Returns
- the status of the operation: 0: completed successfully 1: channel previously defined 2: out of memory 3: other error condition
◆ DeleteChannel()
bool OSOutput::DeleteChannel |
( |
std::string |
name | ) |
|
Delete a channel from the array outputChannel.
- Parameters
-
name | The name of the channel |
- Returns
- whether the operation was completed successfully
◆ FindChannel()
int OSOutput::FindChannel |
( |
std::string |
name | ) |
|
Find the position of a channel within the array *outputChannel.
- Parameters
-
name | The name of the channel |
- Returns
- the position if found; -1 otherwise
The documentation for this class was generated from the following file:
- /builddir/build/BUILD/OS-2.10.2/src/OSUtils/OSOutput.h