dxFeed Graal CXX API v5.0.0
Loading...
Searching...
No Matches
CFI Struct Reference

A wrapper class for Classification of Financial Instruments code as defined in ISO 10962 standard. More...

#include <CFI.hpp>

+ Inheritance diagram for CFI:

Classes

struct  Attribute
 Describes a single attribute with all values as defined in the ISO 10962 standard. More...
 
struct  Value
 Describes single value of single character of CFI code as defined in the ISO 10962 standard. More...
 

Public Types

using Ptr = std::shared_ptr<CFI>
 The alias to a type of shared pointer to the CFI object.
 
using Unique = std::unique_ptr<CFI>
 The alias to a type of unique pointer to the CFI object.
 
- Public Types inherited from SharedEntity
using Ptr = std::shared_ptr<SharedEntity>
 The alias to a type of shared pointer to the SharedEntity object.
 

Public Member Functions

std::string getCode () const
 Returns CFI code.
 
std::int32_t getIntCode () const
 Returns integer representation of CFI code.
 
std::int16_t getCategory () const
 Returns a single UTF16 character for the instrument category - the first character of the CFI code.
 
char getCategoryChar () const
 Returns a single ASCII character for the instrument category - the first character of the CFI code.
 
std::int16_t getGroup () const
 Returns a single UTF16 character for the instrument group - the second character of the CFI code.
 
char getGroupChar () const
 Returns a single ASCII character for the instrument group - the second character of the CFI code.
 
bool isEquity () const
 Returns true if the corresponding instrument is an equity.
 
bool isDebtInstrument () const
 Returns true if the corresponding instrument is a debt instrument.
 
bool isEntitlement () const
 Returns true if the corresponding instrument is an entitlement (right).
 
bool isOption () const
 Returns true if the corresponding instrument is an option.
 
bool isFuture () const
 Returns true if the corresponding instrument is a future.
 
bool isOther () const
 Returns true if the corresponding instrument is an "other" (miscellaneous) instrument.
 
std::vector< std::shared_ptr< Value > > decipher () const
 Returns container of values that explain the meaning of each character in the CFI code.
 
std::string describe () const
 Returns a short textual description of this CFI code by listing names of all values for the characters in this CFI code.
 
bool operator== (const CFI &other) const
 Returns true if this object is equal to other object.
 
bool operator== (const CFI::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.
 
- Public Member Functions inherited from SharedEntity
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.
 
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.
 
- Public Member Functions inherited from Entity
virtual ~Entity () noexcept=default
 The default virtual d-tor.
 

Static Public Member Functions

static Ptr valueOf (const StringLike &code)
 Returns an instance of CFI for specified CFI code.
 
static Ptr valueOf (std::int32_t intCode)
 Returns an instance of CFI for a specified integer representation of CFI code.
 
- Static Public Member Functions inherited from RequireMakeShared< CFI >
static auto createShared (Args &&...args)
 Creates a smart pointer to an object.
 

Static Public Attributes

static const Ptr EMPTY
 Empty CFI - it has code "XXXXXX".
 

Detailed Description

A wrapper class for Classification of Financial Instruments code as defined in ISO 10962 standard.

Main purpose is to provide code validity checks and to construct textual explanation of CFI code as defined in the standard via API. This class does not provide API-accessible constants for specific instrument attributes and values.

Member Function Documentation

◆ decipher()

std::vector< std::shared_ptr< CFI::Value > > CFI::decipher ( ) const

Returns container of values that explain the meaning of each character in the CFI code.

Array always has a length of 6, and each value explains a corresponding character. If a certain character is unapplicable, unknown or unrecognized - corresponding value will contain reference to this fact.

Returns
The values.

◆ describe()

std::string CFI::describe ( ) const

Returns a short textual description of this CFI code by listing names of all values for the characters in this CFI code.

See also the CFI::decipher () method.

Returns
The description.

◆ getCategory()

std::int16_t CFI::getCategory ( ) const

Returns a single UTF16 character for the instrument category - the first character of the CFI code.

Returns
The category.

Referenced by getCategoryChar().

◆ getCategoryChar()

char CFI::getCategoryChar ( ) const

Returns a single ASCII character for the instrument category - the first character of the CFI code.

Returns
The category.

References getCategory().

◆ getCode()

std::string CFI::getCode ( ) const

Returns CFI code.

The code always has a length of 6 characters.

Returns
CFI code.

◆ getGroup()

std::int16_t CFI::getGroup ( ) const

Returns a single UTF16 character for the instrument group - the second character of the CFI code.

Returns
The group.

Referenced by getGroupChar().

◆ getGroupChar()

char CFI::getGroupChar ( ) const

Returns a single ASCII character for the instrument group - the second character of the CFI code.

Returns
The group.

References getGroup().

◆ getIntCode()

std::int32_t CFI::getIntCode ( ) const

Returns integer representation of CFI code.

Returns
An integer representation of CFI code.

◆ hashCode()

std::size_t CFI::hashCode ( ) const
noexcept
Returns
A hash code value for this object.

◆ isDebtInstrument()

bool CFI::isDebtInstrument ( ) const

Returns true if the corresponding instrument is a debt instrument.

Returns
true if the corresponding instrument is a debt instrument.

◆ isEntitlement()

bool CFI::isEntitlement ( ) const

Returns true if the corresponding instrument is an entitlement (right).

Returns
true if the corresponding instrument is an entitlement (right).

◆ isEquity()

bool CFI::isEquity ( ) const

Returns true if the corresponding instrument is an equity.

Returns
true if the corresponding instrument is an equity.

◆ isFuture()

bool CFI::isFuture ( ) const

Returns true if the corresponding instrument is a future.

Returns
true if the corresponding instrument is a future.

◆ isOption()

bool CFI::isOption ( ) const

Returns true if the corresponding instrument is an option.

Returns
true if the corresponding instrument is an option.

◆ isOther()

bool CFI::isOther ( ) const

Returns true if the corresponding instrument is an "other" (miscellaneous) instrument.

Returns
true if the corresponding instrument is an "other" (miscellaneous) instrument.

◆ operator==() [1/2]

bool CFI::operator== ( const CFI & other) const

Returns true if this object is equal to other object.

Parameters
otherAnother object
Returns
true if this object is equal to other object

◆ operator==() [2/2]

bool CFI::operator== ( const CFI::Ptr & other) const
inline

Returns true if this object is equal to other object.

Parameters
otherAnother object
Returns
true if this object is equal to other object

◆ toString()

std::string CFI::toString ( ) const
overridevirtual

Returns a string representation of the current object.

Returns
A string representation

Reimplemented from SharedEntity.

◆ valueOf() [1/2]

CFI::Ptr CFI::valueOf ( const StringLike & code)
static

Returns an instance of CFI for specified CFI code.

Accepts short code and expands it to 6 letters by appending "X" at the end.

Parameters
codeThe CFI code.
Returns
The CFI.
Exceptions
JavaException("IllegalArgumentException")if the code is invalid.

◆ valueOf() [2/2]

CFI::Ptr CFI::valueOf ( std::int32_t intCode)
static

Returns an instance of CFI for a specified integer representation of CFI code.

Parameters
intCodeAn integer representation of CFI code.
Returns
The CFI.
Exceptions
JavaException("IllegalArgumentException")if the intCode is invalid.