7 #ifndef __FWATOMS_NUMERIC_HPP__ 8 #define __FWATOMS_NUMERIC_HPP__ 10 #include "fwAtoms/Base.hpp" 11 #include "fwAtoms/config.hpp" 12 #include "fwAtoms/factory/new.hpp" 14 #include <boost/blank.hpp> 15 #include <boost/variant/variant.hpp> 40 typedef ::boost::variant< ::boost::blank, std::int64_t, std::uint64_t, float, double > ValueType;
62 template<
typename T >
63 static Numeric::sptr New(T value);
68 FWATOMS_API
virtual Base::sptr clone()
const override;
73 ::fwAtoms::Base::AtomType
type()
const override 75 return ::fwAtoms::Base::NUMERIC;
83 return static_cast< NumericType
>(m_value.which());
99 FWATOMS_API
virtual std::string getString()
const override;
104 FWATOMS_API
void setFromString(
const std::string& s, NumericType type = EMPTY);
119 FWATOMS_API
static ValueType valueFromString(
const std::string& s, NumericType type = EMPTY);
129 template <
typename T>
Numeric(::fwAtoms::Base::Key key)
Constructor.
virtual ~Numeric()
Destructor.
fwAtoms contains basic objects to represent any other kind of object
NumericType variantType() const
Returns currently held numeric type.
::fwAtoms::Base::AtomType type() const override
returns Atom type
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
const ValueType & getVariant() const
Returns const reference to numeric's variant.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
Base class for all Atom classes.