dxFeed Graal CXX API
Loading...
Searching...
No Matches
SharedEntity Struct Reference

Base abstract "shared entity" class. Has some helpers for dynamic polymorphism. More...

#include <SharedEntity.hpp>

+ Inheritance diagram for SharedEntity:

Public Types

using Ptr = std::shared_ptr<SharedEntity>
 The alias to a type of shared pointer to the SharedEntity object.
 

Public Member Functions

template<typename T >
bool is () const noexcept
 Checks that 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.
 
virtual std::string toString () const noexcept
 Returns a string representation of the current object.
 
- Public Member Functions inherited from Entity
virtual ~Entity () noexcept=default
 The default virtual d-tor.
 

Detailed Description

Base abstract "shared entity" class. Has some helpers for dynamic polymorphism.

Member Function Documentation

◆ is()

template<typename T >
bool SharedEntity::is ( ) const
inlinenoexcept

Checks that 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 Parameters
TThe type to check
Returns
true if type belongs to the type hierarchy in which the current type resides.

◆ sharedAs() [1/2]

template<typename T >
std::shared_ptr< T > SharedEntity::sharedAs ( ) const
inlinenoexcept

Returns a pointer to the current object wrapped in a smart pointer to type T.

Warning
Please do not use this method unless the object was created with std::shared_ptr<T>(new T(...)) or std::make_shared<T>(...)
Template Parameters
TThe type to convert to a pointer to
Returns
a smart pointer to type T

◆ sharedAs() [2/2]

template<typename T >
std::shared_ptr< T > SharedEntity::sharedAs ( )
inlinenoexcept

Returns a pointer to the current object wrapped in a smart pointer to type T.

Warning
Please do not use this method unless the object was created with std::shared_ptr<T>(new T(...)) or std::make_shared<T>(...)
Template Parameters
TThe type to convert to a pointer to
Returns
a smart pointer to type T

◆ toString()

virtual std::string SharedEntity::toString ( ) const
inlinevirtualnoexcept

Returns a string representation of the current object.

Returns
a string representation

Reimplemented in AnalyticOrder, Candle, DXEndpoint, DXFeed, DXFeedSubscription, DXPublisher, EventType, Greeks, Message, OptionSale, Order, OtcMarketsOrder, Profile, Quote, Series, SpreadOrder, Summary, TheoPrice, TimeAndSale, Trade, TradeETH, and Underlying.