10#ifndef SENZING_SDK_CORE_SZCOREENVIRONMENT_HPP
11#define SENZING_SDK_CORE_SZCOREENVIRONMENT_HPP
24class SzCoreConfigManager;
25class SzCoreDiagnostic;
46 std::unique_ptr<SzCoreEnvironment>
Build();
51 bool verboseLogging_{
false};
52 std::optional<int64_t> configID_;
81 [[nodiscard]] const std::
string&
GetSettings() const noexcept;
90 [[nodiscard]] std::optional<int64_t>
GetConfigID() const noexcept;
102 bool verboseLogging, std::optional<int64_t> configID);
106 void EnsureActiveLocked() const;
113 std::
string instanceName_;
114 std::
string settings_;
115 bool verboseLogging_;
116 std::optional<int64_t> configID_;
118 mutable std::mutex monitor_;
119 bool destroyed_{
false};
122 static std::mutex s_classMutex_;
125 std::unique_ptr<SzCoreProduct> coreProduct_;
126 std::unique_ptr<SzCoreConfigManager> coreConfigManager_;
127 std::unique_ptr<SzCoreDiagnostic> coreDiagnostic_;
128 std::unique_ptr<SzCoreEngine> coreEngine_;
Manages persisted Senzing configurations and the default config registry.
Definition SzConfigManager.hpp:18
Diagnostic operations against the Senzing repository.
Definition SzDiagnostic.hpp:11
The core Senzing entity-resolution engine.
Definition SzEngine.hpp:28
Factory + lifecycle for the Senzing SDK subsystems.
Definition SzEnvironment.hpp:20
Provides access to the Senzing product version and license metadata.
Definition SzProduct.hpp:10
Core implementation of SzEngine backed by the native Sz_* module.
Definition SzCoreEngine.hpp:27
Fluent builder for constructing an SzCoreEnvironment.
Definition SzCoreEnvironment.hpp:37
Builder & VerboseLogging(bool verboseLogging)
Builder & InstanceName(const std::string &instanceName)
Builder & Settings(const std::string &settings)
std::unique_ptr< SzCoreEnvironment > Build()
Builder & ConfigID(int64_t configID)
Pins an explicit configuration ID for native initialization (mirrors C# AbstractBuilder....
Core implementation of SzEnvironment backed by the native libSz modules.
Definition SzCoreEnvironment.hpp:29
bool IsDestroyed() override
Returns true once Destroy() has been initiated/completed.
static constexpr const char * kDefaultSettings
Default settings when none are supplied (mirrors C#).
Definition SzCoreEnvironment.hpp:34
static constexpr const char * kDefaultInstanceName
Default native instance name when none is supplied (mirrors C#).
Definition SzCoreEnvironment.hpp:32
static Builder NewBuilder()
Creates a new builder.
~SzCoreEnvironment() override
const std::string & GetSettings() const noexcept
SzEngine & GetEngine() override
Returns the env-owned SzEngine (lazily created).
void Destroy() override
Destroys the environment and all owned subsystems. Idempotent.
int64_t GetActiveConfigID() override
Returns the currently active configuration ID.
SzCoreEnvironment & operator=(const SzCoreEnvironment &)=delete
const std::string & GetInstanceName() const noexcept
std::optional< int64_t > GetConfigID() const noexcept
The explicit configuration ID this environment is pinned to, or std::nullopt to use the repository's ...
static SzCoreEnvironment * GetActiveInstance()
The single active environment instance for this process, or nullptr if none is active.
SzConfigManager & GetConfigManager() override
Returns the env-owned SzConfigManager (lazily created).
SzProduct & GetProduct() override
Returns the env-owned SzProduct (lazily created).
void Reinitialize(int64_t configID) override
Reinitializes the engine/diagnostic with the given configuration ID.
SzCoreEnvironment(const SzCoreEnvironment &)=delete
bool IsVerboseLogging() const noexcept
SzDiagnostic & GetDiagnostic() override
Returns the env-owned SzDiagnostic (lazily created).
void EnsureActive()
Locks the environment mutex and throws SzEnvironmentDestroyedException if this environment has been d...
Definition SzCoreConfig.hpp:20