Inviwo  0.9.10.1
Inviwo documentation
inviwo::SourceLocation Class Reference

#include <sourcecontext.h>

Public Member Functions

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
 

Detailed Description

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

Constructor & Destructor Documentation

◆ 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
filefilename path of the source file
functionname of the function in the current scope
lineline number in the current source file

Member Function Documentation

◆ 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: