value_ops.hh
Go to the documentation of this file.00001 #ifndef TYPELIB_VALUE_OPS_HH
00002 #define TYPELIB_VALUE_OPS_CC
00003
00004 #include <typelib/memory_layout.hh>
00005 #include <typelib/value.hh>
00006 #include <boost/tuple/tuple.hpp>
00007
00008 namespace Typelib
00009 {
00013 namespace ValueOps
00014 {
00015 boost::tuple<size_t, MemoryLayout::const_iterator>
00016 dump(uint8_t* data, size_t in_offset,
00017 std::vector<uint8_t>& buffer,
00018 MemoryLayout::const_iterator const begin, MemoryLayout::const_iterator const end);
00019 boost::tuple<size_t, size_t, MemoryLayout::const_iterator>
00020 load(uint8_t* data, size_t out_offset,
00021 std::vector<uint8_t> const& buffer, size_t in_offset,
00022 MemoryLayout::const_iterator const begin, MemoryLayout::const_iterator const end);
00023 boost::tuple<bool, uint8_t*, uint8_t*, MemoryLayout::const_iterator>
00024 compare(uint8_t* out_buffer, uint8_t* in_buffer,
00025 MemoryLayout::const_iterator it,
00026 MemoryLayout::const_iterator end);
00027 boost::tuple<uint8_t*, uint8_t*, MemoryLayout::const_iterator>
00028 copy(uint8_t* out_buffer, uint8_t* in_buffer,
00029 MemoryLayout::const_iterator it,
00030 MemoryLayout::const_iterator end);
00031 boost::tuple<uint8_t*, MemoryLayout::const_iterator>
00032 destroy(uint8_t* buffer,
00033 MemoryLayout::const_iterator it,
00034 MemoryLayout::const_iterator end);
00035 boost::tuple<uint8_t*, MemoryLayout::const_iterator>
00036 init(uint8_t* buffer,
00037 MemoryLayout::const_iterator it,
00038 MemoryLayout::const_iterator end);
00039 }
00040
00041 void init(Value v);
00042 void destroy(Value v);
00043 void copy(Value dst, Value src);
00044 bool compare(Value dst, Value src);
00045
00046 std::vector<uint8_t> dump(Value v);
00047 void dump(Value v, std::vector<uint8_t>& buffer);
00048 void dump(Value v, std::vector<uint8_t>& buffer, MemoryLayout const& ops);
00049 void load(Value v, std::vector<uint8_t> const& buffer);
00050 void load(Value v, std::vector<uint8_t> const& buffer, MemoryLayout const& ops);
00051 void dump(uint8_t* v, std::vector<uint8_t>& buffer, MemoryLayout const& ops);
00052 void load(uint8_t* v, std::vector<uint8_t> const& buffer, MemoryLayout const& ops);
00053 }
00054
00055 #endif
00056