Builder class for constructing std::shared_ptr<ucxx::Context> objects.
More...
#include <context_builder.h>
Public Member Functions | |
| ContextBuilder (uint64_t featureFlags) | |
Constructor for ContextBuilder with required feature flags. More... | |
| ContextBuilder & | configMap (ConfigMap configMap) |
| Set the configuration map for the context. More... | |
| std::shared_ptr< Context > | build () const |
Build and return the Context. More... | |
| operator std::shared_ptr< Context > () const | |
Implicit conversion operator to shared_ptr<Context>. More... | |
Builder class for constructing std::shared_ptr<ucxx::Context> objects.
This class implements the builder pattern for std::shared_ptr<ucxx::Context>, allowing optional parameters to be specified via method chaining. Construction happens immediately when the builder expression completes, ensuring one-time construction with immediate evaluation.
The feature flags are required and must be provided to createContext(). The configMap() method is optional.
|
explicit |
Constructor for ContextBuilder with required feature flags.
| [in] | featureFlags | feature flags to be used at UCP context construction time (required). |
| std::shared_ptr<Context> ucxx::experimental::ContextBuilder::build | ( | ) | const |
Build and return the Context.
This method constructs the Context with the specified parameters and returns it. Each call to build() creates a new Context instance with the current parameters.
shared_ptr<ucxx::Context> object. | ContextBuilder& ucxx::experimental::ContextBuilder::configMap | ( | ConfigMap | configMap | ) |
Set the configuration map for the context.
| [in] | configMap | configurations overriding UCX_* defaults and environment variables. |
| ucxx::experimental::ContextBuilder::operator std::shared_ptr< Context > | ( | ) | const |
Implicit conversion operator to shared_ptr<Context>.
This operator enables automatic construction of the Context when the builder is used in a context requiring a shared_ptr<Context>. This allows seamless use with auto variables.
shared_ptr<ucxx::Context> object.