Senzing C++ SDK
C++ SDK for Senzing v4, patterned after the official C# SDK
Loading...
Searching...
No Matches
SzCoreConfig.hpp
Go to the documentation of this file.
1// SzCoreConfig.hpp -- native-backed SzConfig implementation.
2//
3// Ports core/SzCoreConfig.cs. An SzCoreConfig is an in-memory configuration
4// document, represented (as in C#) by its exported JSON config definition
5// string rather than a live native handle. Each mutating/reading operation
6// loads the definition into a native config handle (SzConfig_load_helper),
7// performs the work, re-exports the (possibly updated) definition, and closes
8// the handle. Native config handles are freed by SzConfig_close_helper, NOT
9// SzHelper_free; a RAII guard guarantees the handle always closes.
10//
11// Constructed only by SzCoreConfigManager (obtain via
12// SzConfigManager::CreateConfig); not constructed directly by SDK users.
13#ifndef SENZING_SDK_CORE_SZCORECONFIG_HPP
14#define SENZING_SDK_CORE_SZCORECONFIG_HPP
15
16#include <string>
17
19
21
22class SzCoreEnvironment;
23
25class SzCoreConfig final : public SzConfig {
26public:
30 SzCoreConfig(SzCoreEnvironment& env, std::string configDefinition);
31 ~SzCoreConfig() override = default;
32
33 SzCoreConfig(const SzCoreConfig&) = delete;
35
36 std::string Export() override;
37 std::string GetDataSourceRegistry() override;
38 std::string RegisterDataSource(const std::string& dataSourceCode) override;
39 void UnregisterDataSource(const std::string& dataSourceCode) override;
40
41private:
43 std::string configDefinition_;
44};
45
46} // namespace senzing::sdk::core
47
48#endif // SENZING_SDK_CORE_SZCORECONFIG_HPP
In-memory Senzing configuration document.
Definition SzConfig.hpp:13
Core implementation of SzConfig backed by the native SzConfig_* module.
Definition SzCoreConfig.hpp:25
~SzCoreConfig() override=default
std::string Export() override
Exports this configuration as a JSON definition string.
void UnregisterDataSource(const std::string &dataSourceCode) override
Unregisters the data source identified by dataSourceCode.
std::string GetDataSourceRegistry() override
Returns JSON describing the data sources registered in this config.
std::string RegisterDataSource(const std::string &dataSourceCode) override
Registers a data source by code and returns the JSON describing it.
SzCoreConfig & operator=(const SzCoreConfig &)=delete
SzCoreConfig(SzCoreEnvironment &env, std::string configDefinition)
Constructs from the owning environment and an exported config definition (called by SzCoreConfigManag...
SzCoreConfig(const SzCoreConfig &)=delete
Core implementation of SzEnvironment backed by the native libSz modules.
Definition SzCoreEnvironment.hpp:29
Definition SzCoreConfig.hpp:20