os/ossrv/ossrv_pub/boost_apis/boost/serialization/hash_set.hpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
#ifndef  BOOST_SERIALIZATION_HASH_SET_HPP
sl@0
     2
#define BOOST_SERIALIZATION_HASH_SET_HPP
sl@0
     3
sl@0
     4
// MS compatible compilers support #pragma once
sl@0
     5
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
sl@0
     6
# pragma once
sl@0
     7
#endif
sl@0
     8
sl@0
     9
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
sl@0
    10
// hash_set.hpp: serialization for stl hash_set templates
sl@0
    11
sl@0
    12
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . 
sl@0
    13
// Use, modification and distribution is subject to the Boost Software
sl@0
    14
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
sl@0
    15
// http://www.boost.org/LICENSE_1_0.txt)
sl@0
    16
sl@0
    17
//  See http://www.boost.org for updates, documentation, and revision history.
sl@0
    18
sl@0
    19
#include <boost/config.hpp>
sl@0
    20
#ifdef BOOST_HAS_HASH
sl@0
    21
#include BOOST_HASH_SET_HEADER
sl@0
    22
sl@0
    23
#include <boost/serialization/hash_collections_save_imp.hpp>
sl@0
    24
#include <boost/serialization/hash_collections_load_imp.hpp>
sl@0
    25
#include <boost/serialization/split_free.hpp>
sl@0
    26
sl@0
    27
namespace boost { 
sl@0
    28
namespace serialization {
sl@0
    29
sl@0
    30
template<
sl@0
    31
    class Archive, 
sl@0
    32
    class Key, 
sl@0
    33
    class HashFcn, 
sl@0
    34
    class EqualKey,
sl@0
    35
    class Allocator
sl@0
    36
>
sl@0
    37
inline void save(
sl@0
    38
    Archive & ar,
sl@0
    39
    const BOOST_STD_EXTENSION_NAMESPACE::hash_set<
sl@0
    40
        Key, HashFcn, EqualKey, Allocator
sl@0
    41
    > &t,
sl@0
    42
    const unsigned int file_version
sl@0
    43
){
sl@0
    44
    boost::serialization::stl::save_hash_collection<
sl@0
    45
        Archive, 
sl@0
    46
        BOOST_STD_EXTENSION_NAMESPACE::hash_set<
sl@0
    47
            Key, HashFcn, EqualKey, Allocator
sl@0
    48
        > 
sl@0
    49
    >(ar, t);
sl@0
    50
}
sl@0
    51
sl@0
    52
template<
sl@0
    53
    class Archive, 
sl@0
    54
    class Key, 
sl@0
    55
    class HashFcn, 
sl@0
    56
    class EqualKey,
sl@0
    57
    class Allocator
sl@0
    58
>
sl@0
    59
inline void load(
sl@0
    60
    Archive & ar,
sl@0
    61
    BOOST_STD_EXTENSION_NAMESPACE::hash_set<
sl@0
    62
        Key, HashFcn, EqualKey, Allocator
sl@0
    63
    > &t,
sl@0
    64
    const unsigned int file_version
sl@0
    65
){
sl@0
    66
    boost::serialization::stl::load_hash_collection<
sl@0
    67
        Archive,
sl@0
    68
        BOOST_STD_EXTENSION_NAMESPACE::hash_set<
sl@0
    69
            Key, HashFcn, EqualKey, Allocator
sl@0
    70
        >,
sl@0
    71
        boost::serialization::stl::archive_input_unique<
sl@0
    72
            Archive, 
sl@0
    73
            BOOST_STD_EXTENSION_NAMESPACE::hash_set<
sl@0
    74
                Key, HashFcn, EqualKey, Allocator
sl@0
    75
            >
sl@0
    76
        >
sl@0
    77
    >(ar, t);
sl@0
    78
}
sl@0
    79
sl@0
    80
// split non-intrusive serialization function member into separate
sl@0
    81
// non intrusive save/load member functions
sl@0
    82
template<
sl@0
    83
    class Archive, 
sl@0
    84
    class Key, 
sl@0
    85
    class HashFcn, 
sl@0
    86
    class EqualKey,
sl@0
    87
    class Allocator
sl@0
    88
>
sl@0
    89
inline void serialize(
sl@0
    90
    Archive & ar,
sl@0
    91
    BOOST_STD_EXTENSION_NAMESPACE::hash_set<
sl@0
    92
        Key, HashFcn, EqualKey, Allocator
sl@0
    93
    > &t,
sl@0
    94
    const unsigned int file_version
sl@0
    95
){
sl@0
    96
    boost::serialization::split_free(ar, t, file_version);
sl@0
    97
}
sl@0
    98
sl@0
    99
// hash_multiset
sl@0
   100
template<
sl@0
   101
    class Archive, 
sl@0
   102
    class Key, 
sl@0
   103
    class HashFcn, 
sl@0
   104
    class EqualKey,
sl@0
   105
    class Allocator
sl@0
   106
>
sl@0
   107
inline void save(
sl@0
   108
    Archive & ar,
sl@0
   109
    const BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
sl@0
   110
        Key, HashFcn, EqualKey, Allocator
sl@0
   111
    > &t,
sl@0
   112
    const unsigned int file_version
sl@0
   113
){
sl@0
   114
    boost::serialization::stl::save_hash_collection<
sl@0
   115
        Archive, 
sl@0
   116
        BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
sl@0
   117
            Key, HashFcn, EqualKey, Allocator
sl@0
   118
        > 
sl@0
   119
    >(ar, t);
sl@0
   120
}
sl@0
   121
sl@0
   122
template<
sl@0
   123
    class Archive, 
sl@0
   124
    class Key, 
sl@0
   125
    class HashFcn, 
sl@0
   126
    class EqualKey,
sl@0
   127
    class Allocator
sl@0
   128
>
sl@0
   129
inline void load(
sl@0
   130
    Archive & ar,
sl@0
   131
    BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
sl@0
   132
        Key, HashFcn, EqualKey, Allocator
sl@0
   133
    > &t,
sl@0
   134
    const unsigned int file_version
sl@0
   135
){
sl@0
   136
    boost::serialization::stl::load_hash_collection<
sl@0
   137
        Archive,
sl@0
   138
        BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
sl@0
   139
            Key, HashFcn, EqualKey, Allocator
sl@0
   140
        >,
sl@0
   141
        boost::serialization::stl::archive_input_multi<
sl@0
   142
            Archive,
sl@0
   143
            BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
sl@0
   144
                Key, HashFcn, EqualKey, Allocator
sl@0
   145
            > 
sl@0
   146
        >
sl@0
   147
    >(ar, t);
sl@0
   148
}
sl@0
   149
sl@0
   150
// split non-intrusive serialization function member into separate
sl@0
   151
// non intrusive save/load member functions
sl@0
   152
template<
sl@0
   153
    class Archive, 
sl@0
   154
    class Key, 
sl@0
   155
    class HashFcn, 
sl@0
   156
    class EqualKey,
sl@0
   157
    class Allocator
sl@0
   158
>
sl@0
   159
inline void serialize(
sl@0
   160
    Archive & ar,
sl@0
   161
    BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
sl@0
   162
        Key, HashFcn, EqualKey, Allocator
sl@0
   163
    > & t,
sl@0
   164
    const unsigned int file_version
sl@0
   165
){
sl@0
   166
    boost::serialization::split_free(ar, t, file_version);
sl@0
   167
}
sl@0
   168
sl@0
   169
} // namespace serialization
sl@0
   170
} // namespace boost
sl@0
   171
sl@0
   172
#include <boost/serialization/collection_traits.hpp>
sl@0
   173
sl@0
   174
BOOST_SERIALIZATION_COLLECTION_TRAITS(BOOST_STD_EXTENSION_NAMESPACE::hash_set)
sl@0
   175
BOOST_SERIALIZATION_COLLECTION_TRAITS(BOOST_STD_EXTENSION_NAMESPACE::hash_multiset)
sl@0
   176
sl@0
   177
#endif // BOOST_HAS_HASH
sl@0
   178
#endif // BOOST_SERIALIZATION_HASH_SET_HPP