This is Unofficial EPICS BASE Doxygen Site
epics::pvData::PVScalar Class Referenceabstract

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

#include "pvData.h"

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

Public Types

typedef PVScalarreference
 
typedef const PVScalarconst_reference
 
- Public Types inherited from epics::pvData::PVField
enum  { isPVField =1 }
 

Public Member Functions

 POINTER_DEFINITIONS (PVScalar)
 
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. More...
 
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
 POINTER_DEFINITIONS (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 FieldConstPtrgetField () const
 
PVStructuregetParent ()
 
const PVStructuregetParent () 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

Definition at line 284 of file pvData.h.

Definition at line 283 of file pvData.h.

Constructor & Destructor Documentation

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

Destructor

Definition at line 22 of file PVScalar.cpp.

22 {}
epics::pvData::PVScalar::PVScalar ( ScalarConstPtr const &  scalar)
explicitprotected

Definition at line 24 of file PVScalar.cpp.

25  : PVField(scalar) {}
PVField(FieldConstPtr field)
Definition: PVField.cpp:30

Member Function Documentation

virtual void epics::pvData::PVScalar::assign ( const PVScalar )
pure virtual
virtual void epics::pvData::PVScalar::copy ( const PVScalar from)
pure virtual
virtual void epics::pvData::PVScalar::copyUnchecked ( const PVScalar from)
pure virtual
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.

302  {
303  T result;
304  this->getAs((void*)&result, (ScalarType)ScalarTypeID<T>::value);
305  return result;
306  }
pvac::PutEvent result
Definition: clientSync.cpp:117
T getAs() const
Definition: pvData.h:302
virtual void epics::pvData::PVScalar::getAs ( void *  ,
ScalarType   
) const
protectedpure virtual
virtual void epics::pvData::PVScalar::getAs ( AnyScalar v) const
pure virtual
const ScalarConstPtr epics::pvData::PVScalar::getScalar ( ) const

Get the Scalar introspection interface for the PVScalar.

Returns
the interface.

Definition at line 27 of file PVScalar.cpp.

28  {
29  return static_pointer_cast<const Scalar>(PVField::getField());
30  }
const FieldConstPtr & getField() const
Definition: pvData.h:208
shared_ptr< T > static_pointer_cast(shared_ptr< U > const &r) BOOST_NOEXCEPT
Definition: shared_ptr.hpp:788
epics::pvData::PVScalar::POINTER_DEFINITIONS ( PVScalar  )
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.

324  {
325  this->putFrom((const void*)&val, (ScalarType)ScalarTypeID<T>::value);
326  }
void putFrom(T val)
Definition: pvData.h:324
virtual void epics::pvData::PVScalar::putFrom ( const void *  ,
ScalarType   
)
pure virtual
void epics::pvData::PVScalar::putFrom ( const AnyScalar v)
inline

Definition at line 331 of file pvData.h.

331  {
332  if(v)
333  putFrom(v.unsafe(), v.type());
334  }
void putFrom(T val)
Definition: pvData.h:324

Friends And Related Function Documentation

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 files: