dxFeed Graal CXX API v4.0.0
Loading...
Searching...
No Matches
DXEndpoint::Builder Class Reference

Builder class for DXEndpoint that supports additional configuration properties. More...

#include <DXEndpoint.hpp>

+ Inheritance diagram for DXEndpoint::Builder:

Public Member Functions

 ~Builder () noexcept override
 Releases the GraalVM handle.
 
std::shared_ptr< BuilderwithName (const std::string &name)
 Changes name that is used to distinguish multiple endpoints in the same process (GraalVM Isolate) in logs and in other diagnostic means.
 
std::shared_ptr< BuilderwithRole (Role role)
 Sets role for the created DXEndpoint.
 
std::shared_ptr< BuilderwithProperty (const std::string &key, const std::string &value)
 Sets the specified property.
 
template<typename Properties >
std::shared_ptr< BuilderwithProperties (Properties &&properties)
 Sets all supported properties from the provided properties object.
 
bool supportsProperty (const std::string &key)
 Checks if a property is supported.
 
std::shared_ptr< DXEndpointbuild ()
 Builds DXEndpoint instance.
 
- 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.
 

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.
 
- Static Public Member Functions inherited from RequireMakeShared< Builder >
static auto createShared (Args &&...args)
 Creates smart pointer to object.
 

Detailed Description

Builder class for DXEndpoint that supports additional configuration properties.

Some methods that are not marked noexcept may throw exceptions:

Exceptions
InvalidArgumentExceptionif handle is invalid.
JavaExceptionif something happened with the dxFeed API backend
GraalExceptionif something happened with the GraalVM

Member Function Documentation

◆ build()

std::shared_ptr< DXEndpoint > DXEndpoint::Builder::build ( )

Builds DXEndpoint instance.

Returns
the created endpoint.
Exceptions
InvalidArgumentException
JavaException
GraalException

◆ supportsProperty()

bool DXEndpoint::Builder::supportsProperty ( const std::string & key)

Checks if a property is supported.

Parameters
keyThe property's key to be checked for support
Returns
true if the corresponding property key is supported.
See also
withProperty(const std::string&, const std::string&)
Exceptions
InvalidArgumentException
JavaException
GraalException

◆ withName()

std::shared_ptr< DXEndpoint::Builder > DXEndpoint::Builder::withName ( const std::string & name)

Changes name that is used to distinguish multiple endpoints in the same process (GraalVM Isolate) in logs and in other diagnostic means.

This is a shortcut for withProperty(NAME_PROPERTY, name)

Parameters
nameThe endpoint's name
Returns
this endpoint builder.
Exceptions
InvalidArgumentException
JavaException
GraalException

◆ withProperties()

template<typename Properties >
std::shared_ptr< Builder > DXEndpoint::Builder::withProperties ( Properties && properties)
inline

Sets all supported properties from the provided properties object.

Template Parameters
PropertiesThe properties' type (std::map, std::unordered_map etc)
Parameters
propertiesThe endpoint's properties
Returns
this endpoint builder.
See also
withProperty(const std::string&, const std::string&)
Exceptions
InvalidArgumentException
JavaException
GraalException

◆ withProperty()

std::shared_ptr< DXEndpoint::Builder > DXEndpoint::Builder::withProperty ( const std::string & key,
const std::string & value )

Sets the specified property.

Unsupported properties are ignored.

Parameters
keyThe endpoint's property key
valueThe endpoint's property value
Returns
this endpoint builder.
See also
supportsProperty(const std::string&)
Exceptions
InvalidArgumentException
JavaException
GraalException

◆ withRole()

std::shared_ptr< DXEndpoint::Builder > DXEndpoint::Builder::withRole ( DXEndpoint::Role role)

Sets role for the created DXEndpoint.

Default role is FEED.

Parameters
roleThe endpoint's role
Returns
this endpoint builder.
Exceptions
InvalidArgumentException
JavaException
GraalException