1 #ifndef BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP
2 #define BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // extended_type_info.hpp: interface for portable version of type_info
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 // for now, extended type info is part of the serialization libraries
20 // this could change in the future.
23 #include <cstddef> // NULL
24 #include <boost/config.hpp>
25 #include <boost/noncopyable.hpp>
26 #include <boost/serialization/config.hpp>
28 #include <boost/config/abi_prefix.hpp> // must be the last header
30 # pragma warning(push)
31 # pragma warning(disable : 4251 4231 4660 4275)
34 #define BOOST_SERIALIZATION_MAX_KEY_SIZE 128
37 namespace serialization
{
38 class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info
:
39 private boost::noncopyable
42 // used to uniquely identify the type of class derived from this one
43 // so that different derivations of this class can be simultaneously
44 // included in implementation of sets and maps.
45 const unsigned int m_type_info_key
;
47 is_less_than(const extended_type_info
& /*rhs*/) const {
52 is_equal(const extended_type_info
& /*rhs*/) const {
56 void key_unregister();
59 // this class can't be used as is. It's just the
60 // common functionality for all type_info replacement
61 // systems. Hence, make these protected
62 extended_type_info(const unsigned int type_info_key
= 0);
63 // account for bogus gcc warning
67 ~extended_type_info();
69 const char * get_key() const {
72 void key_register(const char *key
);
73 bool operator<(const extended_type_info
&rhs
) const;
74 bool operator==(const extended_type_info
&rhs
) const;
75 bool operator!=(const extended_type_info
&rhs
) const {
76 return !(operator==(rhs
));
78 static const extended_type_info
* find(const char *key
);
80 virtual void * construct(unsigned int /*count*/ = 0, ...) const {
81 assert(false); // must be implemented if used
84 virtual void destroy(void const * const /*p*/) const {
85 assert(false); // must be implemented if used
89 } // namespace serialization
96 #include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
98 #endif // BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP