Represents a set of additional underlyings for a given option.
More...
#include <AdditionalUnderlyings.hpp>
|
| std::string | getText () const |
| | Returns textual representation of additional underlyings in the format:
|
| |
| std::unordered_map< std::string, double > | getMap () const |
| | Returns internal representation of additional underlyings as a map from the underlying symbol to its SPC.
|
| |
| double | getSPC (const StringLike &symbol) const |
| | Returns SPC for a specified underlying symbol or 0 is specified symbol is not found.
|
| |
| bool | operator== (const AdditionalUnderlyings &other) const |
| | Returns true if this object is equal to other object.
|
| |
| bool | operator== (const AdditionalUnderlyings::Ptr &other) const |
| | Returns true if this object is equal to other object.
|
| |
| std::size_t | hashCode () const noexcept |
| |
| std::string | toString () const override |
| | Returns a string representation of the current object.
|
| |
| template<typename T> |
| bool | is () const noexcept |
| | Checks that the pointer to the current type could be converted to type T* In other words: whether type T belongs to the type hierarchy in which the current type resides.
|
| |
| template<typename T> |
| std::shared_ptr< T > | sharedAs () noexcept |
| | Returns a pointer to the current object wrapped in a smart pointer to type T or std::shared_ptr<T>{nullptr} if the object is not managed by std::shared_ptr.
|
| |
| template<typename T> |
| std::shared_ptr< T > | sharedAs () const noexcept |
| | Returns a pointer to the current object wrapped in a smart pointer to type T or std::shared_ptr<T>{nullptr} if the object is not managed by std::shared_ptr.
|
| |
|
virtual | ~Entity () noexcept |
| | The default virtual d-tor.
|
| |
|
| static Ptr | valueOf (const StringLike &text) |
| | Returns an instance of additional underlyings for specified textual representation.
|
| |
template<typename MapLikeType>
requires (!std::convertible_to<MapLikeType, StringLike>) |
| static Ptr | valueOf (const MapLikeType &map) |
| | Returns an instance of additional underlyings for specified internal representation.
|
| |
| static double | getSPC (const StringLike &text, const StringLike &symbol) |
| | Returns SPC for a specified underlying symbol or 0 is specified symbol is not found.
|
| |
| static auto | createShared (Args &&...args) |
| | Creates a smart pointer to an object.
|
| |
|
|
static const Ptr | EMPTY |
| | Empty additional underlyings - it has empty text and empty map.
|
| |
Represents a set of additional underlyings for a given option.
Each additional underlying has an associated parameter called SPC (shares per contract) that specifies how many shares of additional underlying are delivered during settlement of the option. In cases when the option delivers additional cash, the SPC specifies an amount of how much cash is delivered.
See AdditionalUnderlyings::getText() and AdditionalUnderlyings::getMap() for details about used formats and representations.
◆ getMap()
| std::unordered_map< std::string, double > AdditionalUnderlyings::getMap |
( |
| ) |
const |
Returns internal representation of additional underlyings as a map from the underlying symbol to its SPC.
- Returns
- The internal representation.
◆ getSPC() [1/2]
| double AdditionalUnderlyings::getSPC |
( |
const StringLike & | symbol | ) |
const |
Returns SPC for a specified underlying symbol or 0 is specified symbol is not found.
- Parameters
-
| symbol | The underlying symbol. |
- Returns
- The SPC for the symbol.
◆ getSPC() [2/2]
Returns SPC for a specified underlying symbol or 0 is specified symbol is not found.
This method is equivalent to the expression "valueOf(text)->getSPC(symbol)" except it does not check the correctness of format.
- Parameters
-
| text | The text on which AdditionalUnderlying will be built. |
| symbol | The underlying symbol. |
- Returns
- SPC by the text and symbol.
◆ getText()
| std::string AdditionalUnderlyings::getText |
( |
| ) |
const |
Returns textual representation of additional underlyings in the format:
TEXT ::= "" | LIST
LIST ::= AU | AU "; " LIST
AU ::= UNDERLYING " " SPC
Where UNDERLYING is a symbol of an underlying instrument and SPC is a number of shares per contract of that underlying. All additional underlyings are listed in the alphabetical order of the underlying symbol. In cases when the option settles with additional cash, the underlying symbol will specify cash symbol and SPC will specify the amount of cash.
- Returns
- The textual representation of the additional underlyings.
◆ hashCode()
| std::size_t AdditionalUnderlyings::hashCode |
( |
| ) |
const |
|
noexcept |
- Returns
- A hash code value for this object.
◆ operator==() [1/2]
Returns true if this object is equal to other object.
- Parameters
-
- Returns
true if this object is equal to other object
◆ operator==() [2/2]
Returns true if this object is equal to other object.
- Parameters
-
- Returns
true if this object is equal to other object
◆ toString()
| std::string AdditionalUnderlyings::toString |
( |
| ) |
const |
|
overridevirtual |
Returns a string representation of the current object.
- Returns
- A string representation
Reimplemented from SharedEntity.
◆ valueOf()
Returns an instance of additional underlyings for specified textual representation.
See AdditionalUnderlyings::getText() for format specification.
- Parameters
-
| text | The textual representation. |
- Exceptions
-