Main Page | Modules | Alphabetical List | Class List | File List | Class Members

dsme-constant-adapter.hh

Go to the documentation of this file.
00001 
00002 #ifndef __DSME_CONSTANT_ADAPTER_HH__
00003 #define __DSME_CONSTANT_ADAPTER_HH__
00004 
00014 #include <accdata.hh>
00015 #include <accvector.hh>
00016 #include <accdevexception.hh>
00017 
00018 
00019 
00020 using std::auto_ptr;
00021 
00022 namespace DeviceAccess
00023 {
00024 namespace EqModDSME
00025 {
00026 
00037 class E_API CONSTANTDataAdapter
00038 {
00039 public:
00040 
00041   static auto_ptr<const CONSTANTDataAdapter> createRcvP(const DeviceAccess::AccData& data)
00042   {
00043     if (data.size()>10) {
00044       throw(AccDevException(ODA_MOREDATA,ODA_OK,ACCDEV_ERRORLOCATION));
00045     }
00046     DeviceAccess::AccData& mutual_data = const_cast<DeviceAccess::AccData&>(data);
00047     return auto_ptr<const CONSTANTDataAdapter>(new CONSTANTDataAdapter(mutual_data,0));
00048   }
00049         
00050   static auto_ptr<CONSTANTDataAdapter> createSndP(DeviceAccess::AccData& data)
00051   {
00052     data.assign(10,SWord());
00053 
00054     auto_ptr<CONSTANTDataAdapter> p(new CONSTANTDataAdapter(data,0));
00055     p->init();
00056     return p;
00057   }
00058 
00060   SWord mInitPos1() const {
00061     return (*_ptr)[_offset+0].convert(SWord());
00062   }
00063 
00065   void mInitPos1(SWord val) {
00066     (*_ptr)[_offset+0] = val;
00067   }
00068 
00070   SWord mInitPos2() const {
00071     return (*_ptr)[_offset+1].convert(SWord());
00072   }
00073 
00075   void mInitPos2(SWord val) {
00076     (*_ptr)[_offset+1] = val;
00077   }
00078 
00080   SWord mInitPos3() const {
00081     return (*_ptr)[_offset+2].convert(SWord());
00082   }
00083 
00085   void mInitPos3(SWord val) {
00086     (*_ptr)[_offset+2] = val;
00087   }
00088 
00090   SWord mInitPos4() const {
00091     return (*_ptr)[_offset+3].convert(SWord());
00092   }
00093 
00095   void mInitPos4(SWord val) {
00096     (*_ptr)[_offset+3] = val;
00097   }
00098 
00100   SWord dmin() const {
00101     return (*_ptr)[_offset+4].convert(SWord());
00102   }
00103 
00105   void dmin(SWord val) {
00106     (*_ptr)[_offset+4] = val;
00107   }
00108 
00110   SWord dmax() const {
00111     return (*_ptr)[_offset+5].convert(SWord());
00112   }
00113 
00115   void dmax(SWord val) {
00116     (*_ptr)[_offset+5] = val;
00117   }
00118 
00120   SWord waranod() const {
00121     return (*_ptr)[_offset+6].convert(SWord());
00122   }
00123 
00125   void waranod(SWord val) {
00126     (*_ptr)[_offset+6] = val;
00127   }
00128 
00130   SWord warkath() const {
00131     return (*_ptr)[_offset+7].convert(SWord());
00132   }
00133 
00135   void warkath(SWord val) {
00136     (*_ptr)[_offset+7] = val;
00137   }
00138 
00140   SWord erranod() const {
00141     return (*_ptr)[_offset+8].convert(SWord());
00142   }
00143 
00145   void erranod(SWord val) {
00146     (*_ptr)[_offset+8] = val;
00147   }
00148 
00150   SWord errkath() const {
00151     return (*_ptr)[_offset+9].convert(SWord());
00152   }
00153 
00155   void errkath(SWord val) {
00156     (*_ptr)[_offset+9] = val;
00157   }
00158 
00159 
00161   CONSTANTDataAdapter(DeviceAccess::AccData& data, size_t offset=0) : _ptr(&data), _offset(offset)
00162   {
00163   }
00164 
00166   void init() {
00167 
00168   }
00169 
00170 
00171 
00172 private:
00173   DeviceAccess::AccData* _ptr;
00174   size_t _offset;
00175 };
00176 
00178 typedef CONSTANTDataAdapter ReadCONSTANTDataAdapter;
00179 
00181 typedef auto_ptr<ReadCONSTANTDataAdapter> ReadCONSTANTDataP;
00182 
00186 } // namespace EqModDSME
00187 } // namespace DeviceAccess
00188 
00189 #endif

Generated on Tue Apr 21 16:51:44 2009 for DSME-Equipment Model for Septum stepper driver. by doxygen 1.3.5