OpenPit C++ SDK
C++17 SDK for the OpenPit pre-trade risk engine
openpit::param::Asset Class Reference

Validated asset or currency identifier. More...

Public Member Functions

 Asset (std::string_view value)
 Validates and owns an asset identifier. More...
 
bool operator!= (const Asset &other) const noexcept
 
bool operator< (const Asset &other) const noexcept
 
bool operator== (const Asset &other) const noexcept
 
OpenPitStringView Raw () const noexcept
 Returns the borrowed native representation. More...
 
std::string_view View () const noexcept
 Returns the borrowed asset text. More...
 

Static Public Member Functions

static Asset FromRaw (OpenPitStringView raw)
 Copies and validates a borrowed native asset view. More...
 

Detailed Description

Validated asset or currency identifier.

Construction delegates validation to the native runtime. The returned native handle is shared by copies and released with the matching Asset destructor when the last C++ value goes away.

Constructor & Destructor Documentation

◆ Asset()

openpit::param::Asset::Asset ( std::string_view  value)
inlineexplicit

Validates and owns an asset identifier.

Throws openpit::Error when value is empty or whitespace-only.

Member Function Documentation

◆ FromRaw()

static Asset openpit::param::Asset::FromRaw ( OpenPitStringView  raw)
inlinestatic

Copies and validates a borrowed native asset view.

◆ operator!=()

bool openpit::param::Asset::operator!= ( const Asset other) const
inlinenoexcept

◆ operator<()

bool openpit::param::Asset::operator< ( const Asset other) const
inlinenoexcept

◆ operator==()

bool openpit::param::Asset::operator== ( const Asset other) const
inlinenoexcept

◆ Raw()

OpenPitStringView openpit::param::Asset::Raw ( ) const
inlinenoexcept

Returns the borrowed native representation.

◆ View()

std::string_view openpit::param::Asset::View ( ) const
inlinenoexcept

Returns the borrowed asset text.