RobWorkProject
23.9.11-
|
Standard type for user messages of robwork. More...
#include <Message.hpp>
Public Member Functions | |
Message (const std::string &file, int line, const std::string &message="") | |
Constructor. More... | |
const std::string & | getFile () const |
The name of source file within which the message was constructed. More... | |
int | getLine () const |
The line number for the file at where the message was constructed. More... | |
const std::string & | getText () const |
The message text meant for the user. More... | |
std::string | getFullText () const |
Returns a full description of the message containing file, line number and message. | |
template<class T > | |
Message & | operator<< (T t) |
general stream operator | |
Standard type for user messages of robwork.
Messages are used for exception, warnings, and other things that are reported to the user.
Message values should contain the source file name and line number so that it is easy to look up the place in the code responsible for the generation of the message.
RW_THROW and RW_WARN of macros.hpp have been introduced for the throwing of exceptions and emission of warnings.
Message | ( | const std::string & | file, |
int | line, | ||
const std::string & | message = "" |
||
) |
Constructor.
Messages of RobWork are all annotated by the originating file name, the originating line number, and a message text for the user.
Supplying all the file, line, and message parameters can be a little painfull, so a utility for creating messages is available from the file macros.hpp.
file | [in] The source file name. |
line | [in] The source file line number. |
message | [in] A message for a user. |
|
inline |
The name of source file within which the message was constructed.
|
inline |
The line number for the file at where the message was constructed.
|
inline |
The message text meant for the user.