OpenPit C++ SDK
C++17 SDK for the OpenPit pre-trade risk engine
Loading...
Searching...
No Matches
openpit::param::Asset Class Reference

Validated asset or currency identifier. More...

#include <param.hpp>

Public Member Functions

 Asset (std::string_view value)
 Validates and owns an asset identifier.
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.
std::string_view View () const noexcept
 Returns the borrowed asset text.

Static Public Member Functions

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

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()

Asset openpit::param::Asset::FromRaw ( OpenPitStringView raw)
inlinestaticnodiscard

Copies and validates a borrowed native asset view.

◆ operator!=()

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

◆ operator<()

bool openpit::param::Asset::operator< ( const Asset & other) const
inlinenodiscardnoexcept

◆ operator==()

bool openpit::param::Asset::operator== ( const Asset & other) const
inlinenodiscardnoexcept

◆ Raw()

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

Returns the borrowed native representation.

◆ View()

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

Returns the borrowed asset text.