Loading [MathJax]/extensions/tex2jax.js
LSST Applications 28.0.0,g1653933729+a8ce1bb630,g1a997c3884+a8ce1bb630,g28da252d5a+5bd70b7e6d,g2bbee38e9b+638fca75ac,g2bc492864f+638fca75ac,g3156d2b45e+07302053f8,g347aa1857d+638fca75ac,g35bb328faa+a8ce1bb630,g3a166c0a6a+638fca75ac,g3e281a1b8c+7bbb0b2507,g4005a62e65+17cd334064,g414038480c+5b5cd4fff3,g41af890bb2+4ffae9de63,g4e1a3235cc+0f1912dca3,g6249c6f860+3c3976f90c,g80478fca09+46aba80bd6,g82479be7b0+77990446f6,g858d7b2824+78ba4d1ce1,g89c8672015+f667a5183b,g9125e01d80+a8ce1bb630,ga5288a1d22+2a6264e9ca,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc22bb204ba+78ba4d1ce1,gc28159a63d+638fca75ac,gcf0d15dbbd+32ddb6096f,gd6b7c0dfd1+3e339405e9,gda3e153d99+78ba4d1ce1,gda6a2b7d83+32ddb6096f,gdaeeff99f8+1711a396fd,gdd5a9049c5+b18c39e5e3,ge2409df99d+a5e4577cdc,ge33fd446bb+78ba4d1ce1,ge79ae78c31+638fca75ac,gf0baf85859+64e8883e75,gf5289d68f6+e1b046a8d7,gfa443fc69c+91d9ed1ecf,gfda6b12a05+8419469a56
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
lsst::modelfit::parameters Namespace Reference

Namespaces

namespace  detail
 

Classes

class  Limits
 Range-based limits for parameter values. More...
 
class  Object
 A generic object from the parameters library. More...
 
class  Parameter
 A parameter with values and metadata. More...
 
class  ParameterBase
 Interface for parameters with values and metadata. More...
 
class  Transform
 A reversible transformation of a real scalar value. More...
 
class  Unit
 A generic interface for physical units described by strings. More...
 
class  UnitTransform
 

Functions

template<typename T >
constexpr std::string_view type_name ()
 Get a string representation of an arbitrary C++ type.
 
template<>
constexpr std::string_view type_name< void > ()
 
template<typename T >
std::string type_name_str (bool strip_namespace=false, const std::string_view &namespace_str=detail::NAMESPACE_SEPARATOR)
 Get a string representation of an arbitrary C++ type, potentially modifying its namespace prefix.
 

Function Documentation

◆ type_name()

template<typename T >
std::string_view lsst::modelfit::parameters::type_name ( )
constexpr

Get a string representation of an arbitrary C++ type.

Template Parameters
TThe type to stringify
Returns
A string representation of the type's name
Note
Adapted from https://stackoverflow.com/a/64490578

Definition at line 81 of file type_name.h.

81 {
82 constexpr auto wrapped_name = detail::wrapped_type_name<T>();
83 constexpr auto prefix_length = detail::wrapped_type_name_prefix_length();
84 constexpr auto suffix_length = detail::wrapped_type_name_suffix_length();
85 constexpr auto type_name_length = wrapped_name.length() - prefix_length - suffix_length;
86 return wrapped_name.substr(prefix_length, type_name_length);
87}

◆ type_name< void >()

template<>
std::string_view lsst::modelfit::parameters::type_name< void > ( )
constexpr

Definition at line 37 of file type_name.h.

37 {
38 return "void";
39}

◆ type_name_str()

template<typename T >
std::string lsst::modelfit::parameters::type_name_str ( bool strip_namespace = false,
const std::string_view & namespace_str = detail::NAMESPACE_SEPARATOR )

Get a string representation of an arbitrary C++ type, potentially modifying its namespace prefix.

Template Parameters
TThe type to stringify.
Parameters
strip_namespaceWhether to strip the namespace prefix entirely.
namespace_strA string to replace the standard C++ namespace separator (i.e. ::) with; generally . for Python.
Returns
A string representation of the type's name, with modified namespace prefix.

Definition at line 101 of file type_name.h.

102 {
103 std::string name = std::string(type_name<T>());
104 if (strip_namespace) {
105 return name.substr(name.find_last_of(':') + 1, std::string::npos);
106 } else if (namespace_str != detail::NAMESPACE_SEPARATOR) {
107 auto pos = name.find(detail::NAMESPACE_SEPARATOR, 0);
108 const auto n_replace = namespace_str.size();
109 while (pos != std::string::npos) {
110 name.replace(pos, detail::NAMESPACE_SEPARATOR_LEN, namespace_str);
111 pos += n_replace;
112 pos = name.find(detail::NAMESPACE_SEPARATOR, pos);
113 }
114 }
115 return name;
116}
table::Key< std::string > name
Definition Amplifier.cc:116