numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
num_collect::util::source_info_view Class Reference

Class to hold information of source codes. More...

#include <num_collect/util/source_info_view.h>

+ Collaboration diagram for num_collect::util::source_info_view:

Public Member Functions

constexpr source_info_view (std::string_view file_path=NUM_COLLECT_BUILTIN_FILE(), index_type line=NUM_COLLECT_BUILTIN_LINE(), index_type column=NUM_COLLECT_BUILTIN_COLUMN(), std::string_view function_name=NUM_COLLECT_BUILTIN_FUNCTION())
 Constructor.
 
constexpr auto column () const -> index_type
 Get the column number.
 
constexpr auto file_path () const -> std::string_view
 Get the file path.
 
constexpr auto function_name () const -> std::string_view
 Get the function name.
 
constexpr auto line () const -> index_type
 Get the line number.
 

Private Attributes

index_type column_
 Column number.
 
std::string_view file_path_
 File path.
 
std::string_view function_name_
 Function name.
 
index_type line_
 Line number.
 

Detailed Description

Class to hold information of source codes.

Note
This class won't manage memory for strings.
This class is a wrapper of std::source_location.

Definition at line 35 of file source_info_view.h.

Constructor & Destructor Documentation

◆ source_info_view()

num_collect::util::source_info_view::source_info_view ( std::string_view file_path = NUM_COLLECT_BUILTIN_FILE(),
index_type line = NUM_COLLECT_BUILTIN_LINE(),
index_type column = NUM_COLLECT_BUILTIN_COLUMN(),
std::string_view function_name = NUM_COLLECT_BUILTIN_FUNCTION() )
inlineexplicitconstexpr

Constructor.

Parameters
[in]file_pathFile path.
[in]lineLine number.
[in]columnColumn number.
[in]function_nameFunction name.

Definition at line 45 of file source_info_view.h.

Member Function Documentation

◆ column()

auto num_collect::util::source_info_view::column ( ) const -> index_type
inlinenodiscardconstexpr

Get the column number.

Returns
Column number.

Definition at line 76 of file source_info_view.h.

◆ file_path()

auto num_collect::util::source_info_view::file_path ( ) const -> std::string_view
inlinenodiscardconstexpr

Get the file path.

Returns
File path.

Definition at line 60 of file source_info_view.h.

◆ function_name()

auto num_collect::util::source_info_view::function_name ( ) const -> std::string_view
inlinenodiscardconstexpr

Get the function name.

Returns
Function name.

Definition at line 85 of file source_info_view.h.

◆ line()

auto num_collect::util::source_info_view::line ( ) const -> index_type
inlinenodiscardconstexpr

Get the line number.

Returns
Line number.

Definition at line 69 of file source_info_view.h.

Member Data Documentation

◆ column_

index_type num_collect::util::source_info_view::column_
private

Column number.

Definition at line 97 of file source_info_view.h.

◆ file_path_

std::string_view num_collect::util::source_info_view::file_path_
private

File path.

Definition at line 91 of file source_info_view.h.

◆ function_name_

std::string_view num_collect::util::source_info_view::function_name_
private

Function name.

Definition at line 100 of file source_info_view.h.

◆ line_

index_type num_collect::util::source_info_view::line_
private

Line number.

Definition at line 94 of file source_info_view.h.


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