Class PVScalar

Inheritance Relationships

Base Type

Derived Types

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 Types

typedef PVScalar &reference
typedef const PVScalar &const_reference

Public Functions

POINTER_DEFINITIONS(PVScalar)
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>();

virtual void getAs(AnyScalar &v) const = 0
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.

inline void putFrom(const AnyScalar &v)
virtual void assign(const PVScalar&) = 0
virtual void copy(const PVScalar &from) = 0
virtual void copyUnchecked(const PVScalar &from) = 0

Protected Functions

virtual void getAs(void*, ScalarType) const = 0
explicit PVScalar(ScalarConstPtr const &scalar)