dxFeed Graal CXX API v4.0.0
Loading...
Searching...
No Matches
RequireMakeShared< T > Struct Template Reference

A helper class needed to construct smart pointers to objects, and does not allow explicit construction of objects. More...

#include <SharedEntity.hpp>

+ Inheritance diagram for RequireMakeShared< T >:

Static Public Member Functions

template<typename... Args>
static auto createShared (Args &&...args)
 Creates smart pointer to object.
 

Additional Inherited Members

- 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 inherited from SharedEntity
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
 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

template<typename T>
struct RequireMakeShared< T >

A helper class needed to construct smart pointers to objects, and does not allow explicit construction of objects.

Template Parameters
TThe object type.

Member Function Documentation

◆ createShared()

template<typename T >
template<typename... Args>
static auto RequireMakeShared< T >::createShared ( Args &&... args)
inlinestatic

Creates smart pointer to object.

Template Parameters
ArgsTypes or arguments.
Parameters
argsThe arguments.
Returns
A new smart pointer to object.