Examples |
00001 #ifndef SERIALIZATION_STOCK_HPP 00002 #define SERIALIZATION_STOCK_HPP 00003 00004 #include <string> 00005 00006 namespace s11n_example { 00007 00009 struct stock 00010 { 00011 std::string code; 00012 std::string name; 00013 double open_price; 00014 double high_price; 00015 double low_price; 00016 double last_price; 00017 double buy_price; 00018 int buy_quantity; 00019 double sell_price; 00020 int sell_quantity; 00021 00022 template <typename Archive> 00023 void serialize(Archive& ar, const unsigned int version) 00024 { 00025 ar & code; 00026 ar & name; 00027 ar & open_price; 00028 ar & high_price; 00029 ar & low_price; 00030 ar & last_price; 00031 ar & buy_price; 00032 ar & buy_quantity; 00033 ar & sell_price; 00034 ar & sell_quantity; 00035 } 00036 }; 00037 00038 } // namespace s11n_example 00039 00040 #endif // SERIALIZATION_STOCK_HPP