PVData C++  8.0.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for epics::pvData::PVScalar:
Collaboration graph
[legend]

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 PVScalarreference
 
typedef const PVScalarconst_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 >
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::stringgetFieldName () 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 FieldConstPtrgetField () const
 
PVStructuregetParent ()
 
const PVStructuregetParent () const
 
void postPut ()
 
void setPostHandler (PostHandlerPtr const &postHandler)
 
virtual bool equals (PVField &pv)
 
virtual std::ostreamdumpValue (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.

Constructor & Destructor Documentation

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

Destructor

Member Function Documentation

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

Definition at line 302 of file pvData.h.

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

Get the Scalar introspection interface for the PVScalar.

Returns
the interface.
template<typename T >
void epics::pvData::PVScalar::putFrom ( 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);

Definition at line 324 of file pvData.h.


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