RobWorkProject  24.5.15-
Public Member Functions | List of all members
Message Class Reference

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 >
Messageoperator<< (T t)
 general stream operator
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Message()

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.

Parameters
file[in] The source file name.
line[in] The source file line number.
message[in] A message for a user.

Member Function Documentation

◆ getFile()

const std::string& getFile ( ) const
inline

The name of source file within which the message was constructed.

Returns
The exception file name.

◆ getLine()

int getLine ( ) const
inline

The line number for the file at where the message was constructed.

Returns
The exception line number.

◆ getText()

const std::string& getText ( ) const
inline

The message text meant for the user.

Returns
The message text.

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