Change Attribute::value from raw pointer to std::variant<std::unique_ptr>
BREAKING CHANGE
The get_value_storage() template function has been correctly moved to the "privatesection", so that it no longer appears in the documentation. This function template is only intended for internal use in cppTango as was incorrectly exposed previously. The API of the function template has also changed in this release, so external users of the function will be broken.
The protected members value and value_flag have been removed from Tango::Attribute and replaced with the protected member attribute_value. Sub-classes of Tango::Attribute can replace uses of value with calls to attribute_value.get<T>() and replace
tests of value_flag with calls to attribute_value.has_value(). Sub-classes which were setting value_flag will be broken, as
it is no longer possible to independently set the value_flag from whether the value of the attribute is engaged.
Closes #1407 (closed)
The quick and dirty solution will be uncommenting for unknown reason commented set_value_flag (false)
But in general, I found the way, how we save value superugly. We have raw pointer, which we somewhere set and clear. And we have value_flag, which should indicate, if pointer is set. But the flag is set and released in other pieces of code. It is clumsy.
I do understand, that in the mid-90 there was no even std lib, not speaking about smart pointers. But should we at some point use modern achievements?
I propose, that we save value in the separate class with std::variant<std::unique_ptr>, and then we do not need to separate value_flag anymore. But: we change Attribute API, in particular get_value_storage, get_..._value methods. I am not sure, that we should offer users the opportunity to modify stored value, but it was present.
And there will be no set_value_flag, but reset_value instead, and get_value_flag is changed to value_is_set
And the new code compiles only with pybind11 branch of pytango. Somehow, boost cannot deal with it...