C++序列化库的实现(7)

while(!new_param.empty())
        {
            param.push(new_param.top());
            new_param.pop();
        }
    }
};

// std::queue
template<typename param_type,typename storage_class,storage_type::VEHICLE_TYPE _storage_type>
struct iarchive_impl_helper<std::queue<param_type>,storage_class,_storage_type>
{
    inline iarchive_impl_helper(iarchive_param_deliverer<storage_class,_storage_type>& helper,std::queue<param_type>& param)
    {
        unsigned int size = 0;
        iarchive_impl_helper<unsigned int,storage_class,_storage_type> impl(helper,size);
        for (unsigned int i=0; i<size; ++i)
        {
            param_type p;
            iarchive_impl_helper<param_type,storage_class,_storage_type> impl(helper,p);
            param.push(p);
        }
    }
};

// std::map
template<typename param_type,typename param_type2,typename storage_class,storage_type::VEHICLE_TYPE _storage_type>
struct iarchive_impl_helper<std::map<param_type,param_type2>,storage_class,_storage_type>
{
    inline iarchive_impl_helper(iarchive_param_deliverer<storage_class,_storage_type>& helper,std::map<param_type,param_type2>& param)
    {
        unsigned int size = 0;
        iarchive_impl_helper<unsigned int,storage_class,_storage_type> impl(helper,size);
        for (unsigned int i=0; i<size; ++i)
        {
            param_type p;
            param_type2 p2;

iarchive_impl_helper<param_type,storage_class,_storage_type> impl(helper,p);
            iarchive_impl_helper<param_type2,storage_class,_storage_type> impl2(helper,p2);

param.insert(std::make_pair(p,p2));
        }
    }
};

// std::set
template<typename param_type,typename storage_class,storage_type::VEHICLE_TYPE _storage_type>
struct iarchive_impl_helper<std::set<param_type>,storage_class,_storage_type>
{
    inline iarchive_impl_helper(iarchive_param_deliverer<storage_class,_storage_type>& helper,std::set<param_type>& param)
    {
        unsigned int size = 0;
        iarchive_impl_helper<unsigned int,storage_class,_storage_type> impl(helper,size);
        for (unsigned int i=0; i<size; ++i)
        {
            param_type p;
            iarchive_impl_helper<param_type,storage_class,_storage_type> impl(helper,p);
            param.insert(p);
        }
    }
};

// std::multiset
template<typename param_type,typename storage_class,storage_type::VEHICLE_TYPE _storage_type>
struct iarchive_impl_helper<std::multiset<param_type>,storage_class,_storage_type>
{
    inline iarchive_impl_helper(iarchive_param_deliverer<storage_class,_storage_type>& helper,std::multiset<param_type>& param)
    {
        unsigned int size = 0;
        iarchive_impl_helper<unsigned int,storage_class,_storage_type> impl(helper,size);
        for (unsigned int i=0; i<size; ++i)
        {
            param_type p;
            iarchive_impl_helper<param_type,storage_class,_storage_type> impl(helper,p);
            param.insert(p);
        }
    }
};

// std::multimap
template<typename param_type,typename param_type2,typename storage_class,storage_type::VEHICLE_TYPE _storage_type>
struct iarchive_impl_helper<std::multimap<param_type,param_type2>,storage_class,_storage_type>
{
    iarchive_impl_helper(iarchive_param_deliverer<storage_class,_storage_type>& helper,std::multimap<param_type,param_type2>& param)
    {
        unsigned int size = 0;
        iarchive_impl_helper<unsigned int,storage_class,_storage_type> impl(helper,size);
        for (unsigned int i=0; i<size; ++i)
        {
            param_type p;
            param_type2 p2;

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/4027141282656c44471a7b6eeb1dc451.html