Class PVScalar¶
Defined in File pvData.h
Inheritance Relationships¶
Base Type¶
public epics::pvData::PVField
(Class PVField)
Derived Types¶
public epics::pvData::PVScalarValue< T >
(Template Class PVScalarValue)public epics::pvData::PVScalarValue< std::string >
(Template Class PVScalarValue)
Class Documentation¶
-
class PVScalar : public epics::pvData::PVField¶
PVScalar is the base class for each scalar field.
Subclassed by epics::pvData::PVScalarValue< T >, epics::pvData::PVScalarValue< std::string >
Public Functions
-
virtual ~PVScalar()¶
Destructor
-
const ScalarConstPtr getScalar() const¶
Get the Scalar introspection interface for the PVScalar.
- Returns
the interface.
-
template<typename T>
inline T getAs() const¶ Convert and return the scalar value in the requested type. Result type is determined from the function template argument which must be one of the ScalarType enums. Uses castUnsafe<TO>() for value conversion.
PVScalar* pv = ...; uint32 val = pv->getAs<pvInt>();
-
template<typename T>
inline void putFrom(T val)¶ Convert and assign the provided value. The value type is determined from the function template argument which must be one of the ScalarType enums. Uses castUnsafe<TO>() for value conversion.
PVScalar* pv = ...; pv->putFrom<pvInt>((int32)42);
-
virtual void putFrom(const void*, ScalarType) = 0¶
Convert and assign.
Protected Functions
-
virtual void getAs(void*, ScalarType) const = 0¶
-
explicit PVScalar(ScalarConstPtr const &scalar)¶
-
virtual ~PVScalar()¶