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

PVArray is the base class for all array types. More...

#include "pvData.h"

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

Public Member Functions

 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

 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

- Public Types inherited from epics::pvData::PVField
enum  { isPVField =1 }
 
- Static Public Attributes inherited from epics::pvData::PVField
static size_t num_instances
 

Detailed Description

PVArray is the base class for all array types.

The array types are unionArray, strucrtureArray and scalarArray. There is a scalarArray type for each scalarType.

Definition at line 551 of file pvData.h.

Constructor & Destructor Documentation

virtual epics::pvData::PVArray::~PVArray ( )
inlinevirtual

Destructor

Definition at line 557 of file pvData.h.

557 {};
epics::pvData::PVArray::PVArray ( FieldConstPtr const &  field)
explicitprotected

Definition at line 23 of file PVArray.cpp.

24 : PVField(field),capacityMutable(true)
25 { }
PVField(FieldConstPtr field)
Definition: PVField.cpp:30

Member Function Documentation

void epics::pvData::PVArray::checkLength ( size_t  length) const
protected

Definition at line 177 of file PVDataCreateFactory.cpp.

178 {
179  Array::ArraySizeType type = getArray()->getArraySizeType();
180  if (type != Array::variable)
181  {
182  size_t size = getArray()->getMaximumCapacity();
183  if (type == Array::fixed && len != size)
184  throw std::invalid_argument("invalid length for a fixed size array");
185  else if (type == Array::bounded && len > size)
186  throw std::invalid_argument("new array capacity too large for a bounded size array");
187  }
188 }
pvd::StructureConstPtr type
virtual ArrayConstPtr getArray() const =0
virtual std::ostream& epics::pvData::PVArray::dumpValue ( std::ostream &  o,
std::size_t  index 
) const
pure virtual
virtual ArrayConstPtr epics::pvData::PVArray::getArray ( ) const
pure virtual

Get the introspection interface

Returns
The interface.

Implemented in epics::pvData::PVValueArray< PVUnionPtr >, epics::pvData::PVValueArray< PVStructurePtr >, and epics::pvData::PVValueArray< T >.

virtual std::size_t epics::pvData::PVArray::getCapacity ( ) const
pure virtual
virtual std::size_t epics::pvData::PVArray::getLength ( ) const
pure virtual
bool epics::pvData::PVArray::isCapacityMutable ( ) const

Can the capacity be changed.

Returns
(false,true) if (can not, can) be changed.

Definition at line 33 of file PVArray.cpp.

34  {
35  if(PVField::isImmutable()) {
36  return false;
37  }
38  return capacityMutable;
39  }
bool isImmutable() const
Definition: pvData.h:198
epics::pvData::PVArray::POINTER_DEFINITIONS ( PVArray  )
virtual void epics::pvData::PVArray::setCapacity ( std::size_t  capacity)
pure virtual

Set the array capacity.

Parameters
capacityThe capacity.
void epics::pvData::PVArray::setCapacityMutable ( bool  isMutable)

Set the mutability of the array capacity.

Returns
false or true

Definition at line 41 of file PVArray.cpp.

42  {
43  if(isMutable && PVField::isImmutable()) {
44  throw std::runtime_error("field is immutable");
45  }
46  capacityMutable = isMutable;
47  }
bool isImmutable() const
Definition: pvData.h:198
void epics::pvData::PVArray::setImmutable ( )
virtual

Set the field to be immutable, i.e. it can no longer be modified. This is permanent, i.e. once done the field cannot be made mutable.

Reimplemented from epics::pvData::PVField.

Definition at line 27 of file PVArray.cpp.

28  {
29  capacityMutable = false;
31  }
virtual void setImmutable()
Definition: PVField.cpp:63
virtual void epics::pvData::PVArray::setLength ( std::size_t  length)
pure virtual

Set the array length.

Parameters
lengthThe length.

Implemented in epics::pvData::PVValueArray< PVUnionPtr >, and epics::pvData::PVValueArray< PVStructurePtr >.

Friends And Related Function Documentation

friend class PVDataCreate
friend

Definition at line 607 of file pvData.h.


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