Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
|
Macros | |
#define | COMMENT(exp, num) { } |
Use COMMENT to write comments throughout your code, in order to keep it self explanatory. Use instead of C or C++ default comments in the begining of code blocks to describe what the block is expected to do. If you want to make a small comment in the end of a line, then, do not use COMMENT. COMMENT was designed to both describe the code and for debugging purposes. Therefore, use it strictly according to the instructions here to avoid having a code that is unclear or too verbose. More... | |
#define | BIAL_WARNING(exp) std::cerr << __FILE__ << ": " << __LINE__ << ": " << __FUNCTION__ << " Warning: " << exp << std::endl; |
Use BIAL_WARNING to print a message to the output stream warn the user that something bad may have happend, but the program will continue to be executed. More... | |
#define | BIAL_ERROR(exp) std::string( __FILE__ ) + ": " + std::to_string( __LINE__ ) + ": " + std::string( __FUNCTION__ ) + ": Error: " + exp |
Use BIAL_ERROR to compose runtime error messages. Note that ERROR generates a string, instead of a stream, because it is better to throw an exception, rather than exiting the program. This way, the exception may be threated by a higher level program, like an user IDE. More... | |
#define BIAL_ERROR | ( | exp | ) | std::string( __FILE__ ) + ": " + std::to_string( __LINE__ ) + ": " + std::string( __FUNCTION__ ) + ": Error: " + exp |
Use BIAL_ERROR to compose runtime error messages. Note that ERROR generates a string, instead of a stream, because it is better to throw an exception, rather than exiting the program.
This way, the exception may be threated by a higher level program, like an user IDE.
Definition at line 161 of file Common.hpp.
#define BIAL_WARNING | ( | exp | ) | std::cerr << __FILE__ << ": " << __LINE__ << ": " << __FUNCTION__ << " Warning: " << exp << std::endl; |
Use BIAL_WARNING to print a message to the output stream warn the user that something bad may have happend, but the program will continue to be executed.
Definition at line 158 of file Common.hpp.
#define COMMENT | ( | exp, | |
num | |||
) | { } |
Use COMMENT to write comments throughout your code, in order to keep it self explanatory.
Use instead of C or C++ default comments in the begining of code blocks to describe what the block is expected to do.
If you want to make a small comment in the end of a line, then, do not use COMMENT.
COMMENT was designed to both describe the code and for debugging purposes. Therefore, use it strictly according to the instructions here to avoid having a code that is unclear or too verbose.
COMMENT has two parameters. The first is a stream containg the comment describing what the block does, and possibly print variable's values for debugging. The second parameter is the verbosity level. Level 0, means that the comment will always be printed in debugging mode. Higher levels may or may not be printed, depending on the verbosity level selected during code compilation.
Therefore, follow the instructions to select the level of verbosity of your comment:
Here follow some examples. Note that they are hypothetical, because this depends on the context.
To get verbose results while compiling your code, compile it setting BIAL_DEBUG with a non-negative value. If you are using makefile in tst subfolder, type: make <your_program> verbose=<level> where <your_program> is the name of the program, and <level> is the verbosity level you want to print. If you want to use a debugger of sanity checker along with BIAL comments, than compile with make <your_program> debug=<level> where again <your_program> is the name of the program, and <level> is the verbosity level you want to print.
exp | Explanatory |
num | Verbosity level |
Definition at line 154 of file Common.hpp.