mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 21:21:37 +00:00
feat(options): deprecate the old ProgOptions accessors
- Mark GetValue<T>(), SetValue() and GetStringValue() as deprecated in favour of the property API, as the TODO comments ask. - fairmq-modernize-progoptions-accessors migrates the calls. - List them in the migration guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -228,7 +228,8 @@ class ProgOptions
|
||||
/// @param key
|
||||
/// @return config property
|
||||
template<typename T>
|
||||
T GetValue(const std::string& key) const /* TODO: deprecate this */
|
||||
[[deprecated("Use GetProperty<T>(key, {})")]]
|
||||
T GetValue(const std::string& key) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(fMtx);
|
||||
if (fVarMap.count(key)) {
|
||||
@@ -239,11 +240,13 @@ class ProgOptions
|
||||
}
|
||||
}
|
||||
template<typename T>
|
||||
int SetValue(const std::string& key, T val) /* TODO: deprecate this */ { SetProperty(key, val); return 0; }
|
||||
[[deprecated("Use SetProperty(key, val)")]]
|
||||
int SetValue(const std::string& key, T val) { SetProperty(key, val); return 0; }
|
||||
/// @brief Read config property as string, return default-constructed object if key doesn't exist
|
||||
/// @param key
|
||||
/// @return config property
|
||||
std::string GetStringValue(const std::string& key) const; /* TODO: deprecate this */
|
||||
[[deprecated("Use GetPropertyAsString(key, {})")]]
|
||||
std::string GetStringValue(const std::string& key) const;
|
||||
|
||||
private:
|
||||
void ParseDefaults();
|
||||
|
||||
Reference in New Issue
Block a user