00001
00002
00003 namespace
00004 {
00005 template<int N> struct msvc_bug_workaround;
00006 }
00007
00008
00009 #define static_call(X) \
00010 namespace { template<> struct msvc_bug_workaround<__LINE__> { static const bool dummy; }; } \
00011 const bool msvc_bug_workaround<__LINE__>::dummy=(X,true);
00012
00013
00014 namespace dynamic
00015 {
00017 DYNAMIC_API void register_pickle_type(var_cmp_index, const var&);
00018
00020
00021 DYNAMIC_API var unpickle_type(var_cmp_index);
00022
00024 class pickler : cg::not_copyable, cg::not_assignable
00025 {
00026 public:
00028 pickler(std::ostream&);
00029
00031
00032 void write_object(const var & o);
00033
00035 void write_object_type(var_cmp_index);
00036
00038 void write_int(int i);
00039
00041 void write_size(std::size_t);
00042
00044 void write_double(double d);
00045
00047 void write_string(std::string const&);
00048
00049 private:
00050 typedef std::map<shared_var_impl*, std::size_t> object_map;
00051 object_map m_objects;
00052 std::ostream & m_output;
00053 };
00054 }