#include <sourcecontext.h>
|
constexpr | SourceLocation (const char *file, const char *function, int line) |
|
constexpr const char * | getFile () const noexcept |
|
constexpr const char * | getFunction () const noexcept |
|
constexpr int | getLine () const noexcept |
|
Represents a location in source code, similar to SourceContext but much more lightweight. SourceLocation does not take ownership of its given string, and assumes they are in static storage, which is the case for the file and function macros used below. But care has to be taken if one uses this class directly. The reason for this it so allow it to be fast, lightweight and constexpr. And to avoid unnecessary copies of file and function names. For a owning version
- See also
- SourceContext
◆ SourceLocation()
constexpr inviwo::SourceLocation::SourceLocation |
( |
const char * |
file, |
|
|
const char * |
function, |
|
|
int |
line |
|
) |
| |
|
inline |
This function does now take ownership of file and function!
- Parameters
-
file | filename path of the source file |
function | name of the function in the current scope |
line | line number in the current source file |
◆ getFile()
constexpr const char* inviwo::SourceLocation::getFile |
( |
| ) |
const |
|
inlinenoexcept |
The name and path the the source file
◆ getFunction()
constexpr const char* inviwo::SourceLocation::getFunction |
( |
| ) |
const |
|
inlinenoexcept |
Name of the function in the current scope
◆ getLine()
constexpr int inviwo::SourceLocation::getLine |
( |
| ) |
const |
|
inlinenoexcept |
Line number in the current source file
The documentation for this class was generated from the following file: