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

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

#include <DXEndpoint.hpp>

Inherits std::enable_shared_from_this< Builder >.

Public Member Functions

virtual ~Builder ()
 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.
 

Detailed Description

Builder class for DXEndpoint that supports additional configuration properties.

Member Function Documentation

◆ build()

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

Builds DXEndpoint instance.

Returns
the created endpoint.

◆ supportsProperty()

bool dxfcpp::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&)

◆ withName()

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

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.

◆ withProperties()

template<typename Properties >
std::shared_ptr< Builder > dxfcpp::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&)

◆ withProperty()

std::shared_ptr< DXEndpoint::Builder > dxfcpp::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&)

◆ withRole()

std::shared_ptr< DXEndpoint::Builder > dxfcpp::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.