mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-22 12:59:07 -06:00
Update ghoul to account for removed boost dependency
This commit is contained in:
@@ -312,7 +312,7 @@ bool NumericalProperty<T>::setStringValue(std::string value) {
|
||||
bool success = false;
|
||||
T thisValue = PropertyDelegate<NumericalProperty<T>>::template fromString<T>(value, success);
|
||||
if (success)
|
||||
TemplateProperty<T>::set(boost::any(thisValue));
|
||||
TemplateProperty<T>::set(ghoul::any(thisValue));
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <openspace/properties/propertydelegate.h>
|
||||
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <boost/any.hpp>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
@@ -92,11 +91,11 @@ public:
|
||||
/**
|
||||
* This method returns the encapsulated value of the Property to the caller. The type
|
||||
* that is returned is determined by the type function and is up to the developer of
|
||||
* the derived class. The default implementation returns an empty boost::any object.
|
||||
* \return The value that is encapsulated by this Property, or an empty boost::any
|
||||
* the derived class. The default implementation returns an empty ghoul::any object.
|
||||
* \return The value that is encapsulated by this Property, or an empty ghoul::any
|
||||
* object if the method was not overritten.
|
||||
*/
|
||||
virtual boost::any get() const;
|
||||
virtual ghoul::any get() const;
|
||||
|
||||
/**
|
||||
* Sets the value encapsulated by this Property to the <code>value</code> passed to
|
||||
@@ -106,7 +105,7 @@ public:
|
||||
* implementation of this method ignores the input.
|
||||
* \param value The new value that should be stored in this Property
|
||||
*/
|
||||
virtual void set(boost::any value);
|
||||
virtual void set(ghoul::any value);
|
||||
|
||||
/**
|
||||
* This method returns the type that is requested by this Property for the set method.
|
||||
|
||||
@@ -83,22 +83,22 @@ public:
|
||||
virtual std::string className() const override;
|
||||
|
||||
/**
|
||||
* Returns the stored value packed into a <code>boost::any</code> object.
|
||||
* \return The stored value packed into a <code>boost::any</code> object
|
||||
* Returns the stored value packed into a ghoul::any object.
|
||||
* \return The stored value packed into a ghoul::any object
|
||||
*/
|
||||
virtual boost::any get() const override;
|
||||
virtual ghoul::any get() const override;
|
||||
|
||||
/**
|
||||
* Sets the value fro the provided <code>boost::any</code> object. If the types
|
||||
* between <code>T</code> and <code>value</code> disagree, an error is logged and the
|
||||
* stored value remains unchanged.
|
||||
* Sets the value fro the provided ghoul::any object. If the types between
|
||||
* <code>T</code> and <code>value</code> disagree, an error is logged and the stored
|
||||
* value remains unchanged.
|
||||
*/
|
||||
virtual void set(boost::any value) override;
|
||||
virtual void set(ghoul::any value) override;
|
||||
|
||||
/**
|
||||
* Returns the <code>std::type_info</code> describing the template parameter
|
||||
* <code>T</code>. It can be used to test against a <code>boost::any</code> value
|
||||
* before trying to assign it.
|
||||
* <code>T</code>. It can be used to test against a ghoul::any value before trying to
|
||||
* assign it.
|
||||
* \return The type info object describing the template parameter <code>T</code>
|
||||
*/
|
||||
virtual const std::type_info& type() const override;
|
||||
|
||||
@@ -212,20 +212,20 @@ std::ostream& operator<<(std::ostream& os, const TemplateProperty<T>& obj) {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
boost::any TemplateProperty<T>::get() const {
|
||||
return boost::any(_value);
|
||||
ghoul::any TemplateProperty<T>::get() const {
|
||||
return ghoul::any(_value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TemplateProperty<T>::set(boost::any value) {
|
||||
void TemplateProperty<T>::set(ghoul::any value) {
|
||||
try {
|
||||
T v = boost::any_cast<T>(std::move(value));
|
||||
T v = ghoul::any_cast<T>(std::move(value));
|
||||
if (v != _value) {
|
||||
_value = std::move(v);
|
||||
notifyListener();
|
||||
}
|
||||
}
|
||||
catch (boost::bad_any_cast&) {
|
||||
catch (ghoul::bad_any_cast&) {
|
||||
LERRORC("TemplateProperty", "Illegal cast from '" << value.type().name()
|
||||
<< "' to '" << typeid(T).name() << "'");
|
||||
}
|
||||
@@ -247,7 +247,7 @@ bool TemplateProperty<T>::setLuaValue(lua_State* state) {
|
||||
bool success = false;
|
||||
T thisValue = PropertyDelegate<TemplateProperty<T>>::template fromLuaValue<T>(state, success);
|
||||
if (success)
|
||||
set(boost::any(thisValue));
|
||||
set(ghoul::any(thisValue));
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ bool TemplateProperty<T>::setStringValue(std::string value) {
|
||||
bool success = false;
|
||||
T thisValue = PropertyDelegate<TemplateProperty<T>>::template fromString<T>(value, success);
|
||||
if (success)
|
||||
set(boost::any(thisValue));
|
||||
set(ghoul::any(thisValue));
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
* listeners regardless of the value
|
||||
* \param value The ignored value
|
||||
*/
|
||||
void set(boost::any value);
|
||||
void set(ghoul::any value);
|
||||
};
|
||||
|
||||
} // namespace properties
|
||||
|
||||
Reference in New Issue
Block a user