1 #ifndef MSP_DATAFILE_ARGUMENTSTORE_H_
2 #define MSP_DATAFILE_ARGUMENTSTORE_H_
12 const StatementInfo &info;
16 ArgumentStore(const StatementInfo &);
19 const StatementInfo &get_info() const { return info; }
22 void set(unsigned i, const T &v)
24 *reinterpret_cast<typename TypeInfo<T>::Store *>(store+info.arg_offsets[i]) = v;
28 typename TypeInfo<T>::Load get(unsigned i) const
30 return extract<typename TypeInfo<T>::Store>(store+info.arg_offsets[i], info.key.signature[i]);
35 T extract(const char *, char) const;
39 inline T ArgumentStore::extract(const char *p, char) const
41 return *reinterpret_cast<const T *>(p);
45 inline FloatType::Store ArgumentStore::extract<FloatType::Store>(const char *p, char s) const
47 if(s==IntType::signature)
48 return *reinterpret_cast<const IntType::Store *>(p);
50 return *reinterpret_cast<const FloatType::Store *>(p);
53 } // namespace DataFile