00001 00002 #ifndef _EPICS_ACCSTRENGTHDATA_H 00003 #define _EPICS_ACCSTRENGTHDATA_H 00004 00005 #include <string> 00006 00007 #include "epics/pvdata/PVDouble.h" 00008 #include "epics/pvdata/PVString.h" 00009 #include "epics/pvdata/PVStructure.h" 00010 #include "epics/pvdata/PVArray.h" 00011 00012 namespace EPICS 00013 { 00016 class AccStrengthData : public PVStructure 00017 { 00018 public: 00019 00021 AccStrengthData(); 00022 00024 AccStrengthData(const AccStrengthData& td); 00025 00027 AccStrengthData& operator=(const AccStrengthData& td); 00028 00029 public: 00030 00031 // pv field interface 00032 00033 PVField* clone() const; 00034 00035 public: 00036 00037 // Specialization 00038 00040 inline void putAccName(const std::string& v); 00041 00043 inline void putStrength(double v); 00044 00046 inline const std::string& getAccName() const; 00047 00049 inline double getStrength() const; 00050 00051 }; 00052 00054 class AccStrengthArray : public PVArray 00055 { 00056 public: 00057 00059 AccStrengthArray(unsigned int length = 0); 00060 00062 AccStrengthArray(const AccStrengthArray& array); 00063 00065 virtual void setLength(unsigned int length); 00066 00067 }; 00068 00069 inline void AccStrengthData::putAccName(const std::string& v) { 00070 ((PVString*) getPVField(0))->put(v); 00071 } 00072 00073 inline void AccStrengthData::putStrength(double v) { 00074 ((PVDouble*) getPVField(1))->put(v); 00075 } 00076 00077 inline const std::string& AccStrengthData::getAccName() const { 00078 return ((PVString*) getPVField(0))->get(); 00079 } 00080 00081 inline double AccStrengthData::getStrength() const { 00082 return ((PVDouble*) getPVField(1))->get(); 00083 } 00084 00085 } 00086 00087 00088 #endif /* _ACCSTRENGTHDATA_H */ 00089