1 #ifndef MSP_DATAFILE_ARGUMENTSTORE_H_
2 #define MSP_DATAFILE_ARGUMENTSTORE_H_
12 const StatementInfo &info;
13 char *store = nullptr;
16 ArgumentStore(const StatementInfo &);
17 ArgumentStore(const ArgumentStore &);
18 ArgumentStore &operator=(const ArgumentStore &);
22 void copy_from(const char *);
25 const StatementInfo &get_info() const { return info; }
28 void set(unsigned i, const T &v)
30 *reinterpret_cast<typename TypeInfo<T>::Store *>(store+info.arg_offsets[i]) = v;
34 typename TypeInfo<T>::Load get(unsigned i) const
36 return extract<typename TypeInfo<T>::Store>(store+info.arg_offsets[i], info.key.signature[i]);
41 T extract(const char *, char) const;
45 inline T ArgumentStore::extract(const char *p, char) const
47 return *reinterpret_cast<const T *>(p);
51 inline FloatType::Store ArgumentStore::extract<FloatType::Store>(const char *p, char s) const
53 if(s==IntType::signature)
54 return *reinterpret_cast<const IntType::Store *>(p);
56 return *reinterpret_cast<const FloatType::Store *>(p);
59 } // namespace DataFile