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

Base class for a scalarArray. More...

#include "pvData.h"

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

Public Types

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

Public Member Functions

 POINTER_DEFINITIONS (PVScalarArray)
 
virtual ~PVScalarArray ()
 
const ScalarArrayConstPtr getScalarArray () const
 
template<typename T >
void getAs (shared_vector< const T > &out) const
 
template<typename T >
void putFrom (const shared_vector< const T > &inp)
 
void assign (const PVScalarArray &pv)
 
void copy (const PVScalarArray &from)
 
void copyUnchecked (const PVScalarArray &from)
 
- Public Member Functions inherited from epics::pvData::PVArray
 POINTER_DEFINITIONS (PVArray)
 
virtual ~PVArray ()
 
virtual ArrayConstPtr getArray () const =0
 
virtual void setImmutable () OVERRIDE
 
virtual std::size_t getLength () const =0
 
virtual void setLength (std::size_t length)=0
 
virtual std::size_t getCapacity () const =0
 
bool isCapacityMutable () const
 
void setCapacityMutable (bool isMutable)
 
virtual void setCapacity (std::size_t capacity)=0
 
virtual std::ostream & dumpValue (std::ostream &o, std::size_t index) const =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
 
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
 
- Public Member Functions inherited from epics::pvData::SerializableArray
virtual ~SerializableArray ()
 
virtual void serialize (ByteBuffer *buffer, SerializableControl *flusher, std::size_t offset, std::size_t count) const =0
 

Protected Member Functions

virtual void _getAsVoid (shared_vector< const void > &) const =0
 
virtual void _putFromVoid (const shared_vector< const void > &)=0
 
 PVScalarArray (ScalarArrayConstPtr const &scalarArray)
 
- Protected Member Functions inherited from epics::pvData::PVArray
 PVArray (FieldConstPtr const &field)
 
void checkLength (size_t length) const
 
- Protected Member Functions inherited from epics::pvData::PVField
PVField::shared_pointer getPtrSelf ()
 
 PVField (FieldConstPtr field)
 
void setParentAndName (PVStructure *parent, std::string const &fieldName)
 

Friends

class PVDataCreate
 

Additional Inherited Members

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

Detailed Description

Base class for a scalarArray.

Definition at line 618 of file pvData.h.

Member Typedef Documentation

Definition at line 626 of file pvData.h.

Definition at line 625 of file pvData.h.

Constructor & Destructor Documentation

epics::pvData::PVScalarArray::~PVScalarArray ( )
virtual

Destructor

Definition at line 22 of file PVScalarArray.cpp.

22 {}
epics::pvData::PVScalarArray::PVScalarArray ( ScalarArrayConstPtr const &  scalarArray)
explicitprotected

Definition at line 24 of file PVScalarArray.cpp.

25  : PVArray(scalarArray) {}
PVArray(FieldConstPtr const &field)
Definition: PVArray.cpp:23

Member Function Documentation

virtual void epics::pvData::PVScalarArray::_getAsVoid ( shared_vector< const void > &  ) const
protectedpure virtual
virtual void epics::pvData::PVScalarArray::_putFromVoid ( const shared_vector< const void > &  )
protectedpure virtual
void epics::pvData::PVScalarArray::assign ( const PVScalarArray pv)
inline

Assign the given PVScalarArray's value.

A copy and element-wise conversion is performed unless the element type of the PVScalarArray matches the type of the provided data. If the types do match then a new reference to the provided data is kept.

Definition at line 681 of file pvData.h.

681  {
682  if (isImmutable())
683  throw std::invalid_argument("destination is immutable");
684  copyUnchecked(pv);
685  }
Definition: tool_lib.h:67
bool isImmutable() const
Definition: pvData.h:198
void copyUnchecked(const PVScalarArray &from)
Definition: pvData.h:691
void epics::pvData::PVScalarArray::copy ( const PVScalarArray from)
inline

Definition at line 687 of file pvData.h.

687  {
688  assign(from);
689  }
void assign(const PVScalarArray &pv)
Definition: pvData.h:681
void epics::pvData::PVScalarArray::copyUnchecked ( const PVScalarArray from)
inline

Definition at line 691 of file pvData.h.

691  {
692  if (this==&from)
693  return;
694  shared_vector<const void> temp;
695  from._getAsVoid(temp);
696  _putFromVoid(temp);
697  }
virtual void _putFromVoid(const shared_vector< const void > &)=0
template<typename T >
void epics::pvData::PVScalarArray::getAs ( shared_vector< const T > &  out) const
inline

Fetch the current value and convert to the requested type.

A copy is made if the requested type does not match the element type. If the types do match then no copy is made.

Definition at line 647 of file pvData.h.

648  {
649  shared_vector<const void> temp;
650  _getAsVoid(temp);
651  out = shared_vector_convert<const T>(temp);
652  }
virtual void _getAsVoid(shared_vector< const void > &) const =0
const ScalarArrayConstPtr epics::pvData::PVScalarArray::getScalarArray ( ) const

Get the introspection interface

Returns
The interface.

Definition at line 27 of file PVScalarArray.cpp.

28  {
29  return static_pointer_cast<const ScalarArray>(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::PVScalarArray::POINTER_DEFINITIONS ( PVScalarArray  )
template<typename T >
void epics::pvData::PVScalarArray::putFrom ( const shared_vector< const T > &  inp)
inline

Assign the given value after conversion.

A copy and element-wise conversion is performed unless the element type of the PVScalarArray matches the type of the provided data. If the types do match then a new reference to the provided data is kept.

Calls postPut()

Definition at line 666 of file pvData.h.

667  {
668  shared_vector<const void> temp(static_shared_vector_cast<const void>(inp));
669  _putFromVoid(temp);
670  }
virtual void _putFromVoid(const shared_vector< const void > &)=0

Friends And Related Function Documentation

friend class PVDataCreate
friend

Definition at line 702 of file pvData.h.


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