This is Unofficial EPICS BASE Doxygen Site
PVArray.cpp
Go to the documentation of this file.
1 /*PVArray.cpp*/
2 /*
3  * Copyright information and license terms for this software can be
4  * found in the file LICENSE that is included with the distribution
5  */
10 #include <cstddef>
11 #include <cstdlib>
12 #include <string>
13 #include <cstdio>
14 
15 #define epicsExportSharedSymbols
16 #include <pv/pvData.h>
17 #include <pv/factory.h>
18 
19 using std::size_t;
20 
21 namespace epics { namespace pvData {
22 
24 : PVField(field),capacityMutable(true)
25 { }
26 
28  {
29  capacityMutable = false;
31  }
32 
34  {
35  if(PVField::isImmutable()) {
36  return false;
37  }
38  return capacityMutable;
39  }
40 
41  void PVArray::setCapacityMutable(bool isMutable)
42  {
43  if(isMutable && PVField::isImmutable()) {
44  throw std::runtime_error("field is immutable");
45  }
46  capacityMutable = isMutable;
47  }
48 
49 
50 std::ostream& operator<<(format::array_at_internal const& manip, const PVArray& array)
51 {
52  return array.dumpValue(manip.stream, manip.index);
53 }
54 
55 }}
virtual void setImmutable() OVERRIDE
Definition: PVArray.cpp:27
void setCapacityMutable(bool isMutable)
Definition: PVArray.cpp:41
#define true
Definition: flexdef.h:84
virtual void setImmutable()
Definition: PVField.cpp:63
PVArray(FieldConstPtr const &field)
Definition: PVArray.cpp:23
virtual std::ostream & dumpValue(std::ostream &o, std::size_t index) const =0
TODO only here because of the Lockable.
Definition: ntaggregate.cpp:16
PVField is the base class for each PVData field.
Definition: pvData.h:152
std::ostream & operator<<(std::ostream &o, const Field &f)
std::tr1::shared_ptr< const Field > FieldConstPtr
Definition: pvIntrospect.h:137
bool isImmutable() const
Definition: pvData.h:198
bool isCapacityMutable() const
Definition: PVArray.cpp:33
PVArray is the base class for all array types.
Definition: pvData.h:551