PVData C++ 8.0.9
Loading...
Searching...
No Matches
epics::pvData::PVScalar Class Referenceabstract

PVScalar is the base class for each scalar field. More...

#include <pv/pvData.h>

Inheritance diagram for epics::pvData::PVScalar:
Collaboration diagram for epics::pvData::PVScalar:

Public Types

typedef std::tr1::shared_ptr< PVScalar > shared_pointer
typedef std::tr1::shared_ptr< const PVScalar > const_shared_pointer
typedef std::tr1::weak_ptr< PVScalar > weak_pointer
typedef std::tr1::weak_ptr< const PVScalar > const_weak_pointer
typedef PVScalar & reference
typedef const PVScalar & const_reference
Public Types inherited from epics::pvData::PVField
enum  { isPVField =1 }
typedef std::tr1::shared_ptr< PVField > shared_pointer
typedef std::tr1::shared_ptr< const PVField > const_shared_pointer
typedef std::tr1::weak_ptr< PVField > weak_pointer
typedef std::tr1::weak_ptr< const PVField > const_weak_pointer

Public Member Functions

virtual ~PVScalar ()
const ScalarConstPtr getScalar () const
template<typename T>
T getAs () const
virtual void getAs (AnyScalar &v) const =0
template<typename T>
void putFrom (T val)
virtual void putFrom (const void *, ScalarType)=0
 Convert and assign.
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
Public Member Functions inherited from epics::pvData::PVField
virtual ~PVField ()
const std::string & getFieldName () const
std::string getFullName () const
std::size_t getFieldOffset () const
std::size_t getNextFieldOffset () const
std::size_t getNumberFields () const
bool isImmutable () const
virtual void setImmutable ()
const FieldConstPtr & getField () const
PVStructure * getParent ()
const PVStructure * getParent () const
void postPut ()
void setPostHandler (PostHandlerPtr const &postHandler)
virtual bool equals (PVField &pv)
virtual std::ostream & dumpValue (std::ostream &o) const =0
void copy (const PVField &from)
void copyUnchecked (const PVField &from)
Public Member Functions inherited from epics::pvData::Serializable
virtual ~Serializable ()
virtual void serialize (ByteBuffer *buffer, SerializableControl *flusher) const =0
virtual void deserialize (ByteBuffer *buffer, DeserializableControl *flusher)=0

Protected Member Functions

virtual void getAs (void *, ScalarType) const =0
 PVScalar (ScalarConstPtr const &scalar)
Protected Member Functions inherited from epics::pvData::PVField
PVField::shared_pointer getPtrSelf ()
 PVField (FieldConstPtr field)
void setParentAndName (PVStructure *parent, std::string const &fieldName)

Friends

template<typename E>
class PVScalarValue

Additional Inherited Members

Static Public Attributes inherited from epics::pvData::PVField
static size_t num_instances

Detailed Description

PVScalar is the base class for each scalar field.

Definition at line 272 of file pvData.h.

Member Typedef Documentation

◆ const_reference

typedef const PVScalar& epics::pvData::PVScalar::const_reference

Definition at line 284 of file pvData.h.

◆ const_shared_pointer

typedef std::tr1::shared_ptr<const PVScalar> epics::pvData::PVScalar::const_shared_pointer

Definition at line 278 of file pvData.h.

◆ const_weak_pointer

typedef std::tr1::weak_ptr<const PVScalar> epics::pvData::PVScalar::const_weak_pointer

Definition at line 278 of file pvData.h.

◆ reference

typedef PVScalar& epics::pvData::PVScalar::reference

Definition at line 283 of file pvData.h.

◆ shared_pointer

typedef std::tr1::shared_ptr<PVScalar> epics::pvData::PVScalar::shared_pointer

Definition at line 278 of file pvData.h.

◆ weak_pointer

typedef std::tr1::weak_ptr<PVScalar> epics::pvData::PVScalar::weak_pointer

Definition at line 278 of file pvData.h.

Constructor & Destructor Documentation

◆ ~PVScalar()

virtual epics::pvData::PVScalar::~PVScalar ( )
virtual

Destructor

Member Function Documentation

◆ getAs()

template<typename T>
T epics::pvData::PVScalar::getAs ( ) const
inline

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>();
uint32_t uint32
Definition pvType.h:99

Definition at line 302 of file pvData.h.

◆ getScalar()

const ScalarConstPtr epics::pvData::PVScalar::getScalar ( ) const

Get the Scalar introspection interface for the PVScalar.

Returns
the interface.

◆ putFrom() [1/3]

void epics::pvData::PVScalar::putFrom ( const AnyScalar & v)
inline

Definition at line 331 of file pvData.h.

◆ putFrom() [2/3]

◆ putFrom() [3/3]

template<typename T>
void epics::pvData::PVScalar::putFrom ( T val)
inline

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);
void putFrom(T val)
Definition pvData.h:324
int32_t int32
Definition pvType.h:83

Definition at line 324 of file pvData.h.

◆ PVScalarValue

template<typename E>
friend class PVScalarValue
friend

Definition at line 276 of file pvData.h.


The documentation for this class was generated from the following file: