20 #include <epicsAssert.h> 22 #include <pv/pvIntrospect.h> 23 #include <pv/typeCast.h> 24 #include <pv/anyscalar.h> 25 #include <pv/sharedVector.h> 28 #include <compilerDependencies.h> 30 #if defined(vxWorks) && !defined(_WRS_VXWORKS_MAJOR) 31 typedef class std::ios std::ios_base;
34 namespace epics {
namespace pvData {
54 template<
typename T>
class PVScalarValue;
55 template<
typename T>
class PVValueArray;
100 typedef std::tr1::shared_ptr<PVStructureArray> PVStructureArrayPtr;
101 typedef std::vector<PVStructureArrayPtr> PVStructureArrayPtrArray;
102 typedef std::tr1::shared_ptr<PVStructureArrayPtrArray> PVStructureArrayPtrArrayPtr;
120 typedef std::tr1::shared_ptr<PVUnionArray> PVUnionArrayPtr;
121 typedef std::vector<PVUnionArrayPtr> PVUnionArrayPtrArray;
122 typedef std::tr1::shared_ptr<PVUnionArrayPtrArray> PVUnionArrayPtrArrayPtr;
125 typedef std::tr1::shared_ptr<PVDataCreate> PVDataCreatePtr;
351 inline void store(T v) {
354 ScalarStorageOps() :value(0) {}
357 struct ScalarStorageOps<std::string> {
360 typedef const std::string& arg_type;
361 void store(
const std::string& val) {
362 if (maxLength > 0 && val.length() > maxLength)
363 throw std::overflow_error(
"string too long");
368 ScalarStorageOps(): value(), maxLength(0) {}
378 class epicsShareClass PVScalarValue :
public PVScalar {
418 template<
typename T1>
424 template<
typename T1>
475 return o <<
static_cast<
int>(
get());
481 return o <<
static_cast<
unsigned int>(
get());
493 typedef PVScalarValue<boolean> PVBoolean;
494 typedef PVScalarValue<int8> PVByte;
495 typedef PVScalarValue<int16> PVShort;
496 typedef PVScalarValue<int32> PVInt;
497 typedef PVScalarValue<int64> PVLong;
498 typedef PVScalarValue<uint8> PVUByte;
499 typedef PVScalarValue<uint16> PVUShort;
500 typedef PVScalarValue<uint32> PVUInt;
501 typedef PVScalarValue<uint64> PVULong;
502 typedef PVScalarValue<
float> PVFloat;
503 typedef PVScalarValue<
double> PVDouble;
504 typedef std::tr1::shared_ptr<PVBoolean> PVBooleanPtr;
505 typedef std::tr1::shared_ptr<PVByte> PVBytePtr;
506 typedef std::tr1::shared_ptr<PVShort> PVShortPtr;
507 typedef std::tr1::shared_ptr<PVInt> PVIntPtr;
508 typedef std::tr1::shared_ptr<PVLong> PVLongPtr;
509 typedef std::tr1::shared_ptr<PVUByte> PVUBytePtr;
510 typedef std::tr1::shared_ptr<PVUShort> PVUShortPtr;
511 typedef std::tr1::shared_ptr<PVUInt> PVUIntPtr;
512 typedef std::tr1::shared_ptr<PVULong> PVULongPtr;
513 typedef std::tr1::shared_ptr<PVFloat> PVFloatPtr;
514 typedef std::tr1::shared_ptr<PVDouble> PVDoublePtr;
540 typedef std::tr1::shared_ptr<PVString> PVStringPtr;
765 template<
typename PVD,
typename A>
772 template<
typename PVD,
typename A>
805 template<
typename PVD,
typename A>
815 template<
typename PVD,
typename A>
971 template<
typename PVT>
977 template<
typename PVT>
991 template<
typename PVT>
1005 template<
typename PVT>
1094 template<
typename T>
1095 struct shared_ptr_vector_deletor {
1096 typedef std::tr1::shared_ptr<std::vector<T> > shared_vector;
1098 shared_ptr_vector_deletor(
const shared_vector& v)
1100 void operator()(T*){vec.reset();}
1104 template<
typename T,
class Base>
1108 typedef T value_type;
1110 typedef const T* const_pointer;
1113 typedef ::epics::pvData::shared_vector<T> svector;
1114 typedef ::epics::pvData::shared_vector<
const T> const_svector;
1118 template<
typename A>
1119 explicit PVVectorStorage(A a) : Base(a) {}
1121 virtual ~PVVectorStorage(){}
1126 virtual const_svector
view()
const = 0;
1138 virtual void swap(const_svector& other) = 0;
1143 virtual void replace(
const const_svector& next) = 0;
1157 const_svector result;
1159 return thaw(result);
1174 template<
typename T>
1431 typedef std::tr1::shared_ptr<PVBooleanArray> PVBooleanArrayPtr;
1433 typedef PVValueArray<int8> PVByteArray;
1434 typedef std::tr1::shared_ptr<PVByteArray> PVByteArrayPtr;
1436 typedef PVValueArray<int16> PVShortArray;
1437 typedef std::tr1::shared_ptr<PVShortArray> PVShortArrayPtr;
1439 typedef PVValueArray<int32> PVIntArray;
1440 typedef std::tr1::shared_ptr<PVIntArray> PVIntArrayPtr;
1442 typedef PVValueArray<int64> PVLongArray;
1443 typedef std::tr1::shared_ptr<PVLongArray> PVLongArrayPtr;
1445 typedef PVValueArray<uint8> PVUByteArray;
1446 typedef std::tr1::shared_ptr<PVUByteArray> PVUByteArrayPtr;
1448 typedef PVValueArray<uint16> PVUShortArray;
1449 typedef std::tr1::shared_ptr<PVUShortArray> PVUShortArrayPtr;
1451 typedef PVValueArray<uint32> PVUIntArray;
1452 typedef std::tr1::shared_ptr<PVUIntArray> PVUIntArrayPtr;
1454 typedef PVValueArray<uint64> PVULongArray;
1455 typedef std::tr1::shared_ptr<PVULongArray> PVULongArrayPtr;
1457 typedef PVValueArray<
float> PVFloatArray;
1458 typedef std::tr1::shared_ptr<PVFloatArray> PVFloatArrayPtr;
1460 typedef PVValueArray<
double> PVDoubleArray;
1461 typedef std::tr1::shared_ptr<PVDoubleArray> PVDoubleArrayPtr;
1463 typedef PVValueArray<std::string> PVStringArray;
1464 typedef std::tr1::shared_ptr<PVStringArray> PVStringArrayPtr;
1467 struct pvfield_factory;
1520 template<
typename PVT>
1589 template<
typename PVAT>
1649 return PVDataCreate::getPVDataCreate();
1654 static inline bool operator!=(
const PVField& a,
const PVField& b)
PVValueArray< PVUnionPtr > PVUnionArray
PVValueArray< PVStructurePtr > PVStructureArray
virtual void swap(const_svector &other)=0
std::vector< PVFieldPtr > PVFieldPtrArray
std::vector< PVUnionPtr > PVUnionPtrArray
PVValueArray< boolean > PVBooleanArray
std::tr1::shared_ptr< PVUnion > PVUnionPtr
PVArray is the base class for all array types.
Data interface for a structure,.
std::tr1::shared_ptr< PVScalar > PVScalarPtr
std::vector< PVStructurePtr > PVStructurePtrArray
PVString is special case, since it implements SerializableArray.
#define POINTER_DEFINITIONS(clazz)
Base class for a scalarArray.
std::tr1::shared_ptr< PVScalarArray > PVScalarArrayPtr
virtual void replace(const const_svector &next)=0
std::tr1::shared_ptr< PVField > PVFieldPtr
PVScalar is the base class for each scalar field.
This is a singleton class for creating data instances.
This class is implemented by code that calls setPostHander.
virtual const_svector view() const =0
Fetch a read-only view of the current array data.
PVField is the base class for each PVData field.
std::tr1::shared_ptr< PVStructure > PVStructurePtr
#define EPICS_NOT_COPYABLE(CLASS)
Disable implicit copyable.
epicsShareFunc bool yajl_parse_helper(std::istream &src, yajl_handle handle)
PVUnion has a single subfield.
Common code for PV*Array.
FORCE_INLINE const PVDataCreatePtr & getPVDataCreate()
std::ostream & dumpValue(std::ostream &o) const
std::tr1::shared_ptr< PostHandler > PostHandlerPtr