context_builder.h
1 
5 #pragma once
6 
7 #include <memory>
8 
9 #include <ucxx/typedefs.h>
10 
11 namespace ucxx {
12 
13 // Forward declarations
14 class Context;
15 
16 namespace experimental {
17 
43  private:
44  ConfigMap _configMap{};
45  uint64_t _featureFlags;
46 
47  public:
53  explicit ContextBuilder(uint64_t featureFlags);
54 
62 
71  std::shared_ptr<Context> build() const;
72 
82  operator std::shared_ptr<Context>() const;
83 };
84 
109 inline ContextBuilder createContext(uint64_t featureFlags) { return ContextBuilder(featureFlags); }
110 
111 } // namespace experimental
112 
113 } // namespace ucxx
Builder class for constructing std::shared_ptr<ucxx::Context> objects.
Definition: context_builder.h:42
ContextBuilder(uint64_t featureFlags)
Constructor for ContextBuilder with required feature flags.
ContextBuilder & configMap(ConfigMap configMap)
Set the configuration map for the context.
std::shared_ptr< Context > build() const
Build and return the Context.
Definition: address.h:15
std::unordered_map< std::string, std::string > ConfigMap
A UCP configuration map.
Definition: typedefs.h:83
std::shared_ptr< Context > createContext(const ConfigMap ucxConfig, const uint64_t featureFlags)
Constructor of shared_ptr<ucxx::Context> with parameters.