Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/serialization/extended_type_info.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #ifndef BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP
0002 #define BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP
0003 
0004 // MS compatible compilers support #pragma once
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008 
0009 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
0010 // extended_type_info.hpp: interface for portable version of type_info
0011 
0012 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
0013 // Use, modification and distribution is subject to the Boost Software
0014 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0015 // http://www.boost.org/LICENSE_1_0.txt)
0016 
0017 //  See http://www.boost.org for updates, documentation, and revision history.
0018 
0019 // for now, extended type info is part of the serialization libraries
0020 // this could change in the future.
0021 #include <cstdarg>
0022 #include <boost/assert.hpp>
0023 #include <cstddef> // NULL
0024 #include <boost/config.hpp>
0025 #include <boost/noncopyable.hpp>
0026 #include <boost/mpl/bool.hpp>
0027 
0028 #include <boost/serialization/config.hpp>
0029 #include <boost/config/abi_prefix.hpp> // must be the last header
0030 #ifdef BOOST_MSVC
0031 #  pragma warning(push)
0032 #  pragma warning(disable : 4251 4231 4660 4275)
0033 #endif
0034 
0035 #define BOOST_SERIALIZATION_MAX_KEY_SIZE 128
0036 
0037 namespace boost {
0038 namespace serialization {
0039 
0040 namespace void_cast_detail{
0041     class void_caster;
0042 }
0043 
0044 class BOOST_SYMBOL_VISIBLE extended_type_info :
0045     private boost::noncopyable
0046 {
0047 private:
0048     friend class boost::serialization::void_cast_detail::void_caster;
0049 
0050     // used to uniquely identify the type of class derived from this one
0051     // so that different derivations of this class can be simultaneously
0052     // included in implementation of sets and maps.
0053     const unsigned int m_type_info_key;
0054     virtual bool is_less_than(const extended_type_info & /*rhs*/) const = 0;
0055     virtual bool is_equal(const extended_type_info & /*rhs*/) const = 0;
0056     const char * m_key;
0057 
0058 protected:
0059     BOOST_SERIALIZATION_DECL void key_unregister() const;
0060     BOOST_SERIALIZATION_DECL void key_register() const;
0061     // this class can't be used as is. It's just the
0062     // common functionality for all type_info replacement
0063     // systems.  Hence, make these protected
0064     BOOST_SERIALIZATION_DECL extended_type_info(
0065         const unsigned int type_info_key,
0066         const char * key
0067     );
0068     virtual BOOST_SERIALIZATION_DECL ~extended_type_info();
0069 public:
0070     const char * get_key() const {
0071         return m_key;
0072     }
0073     virtual const char * get_debug_info() const = 0;
0074     BOOST_SERIALIZATION_DECL bool operator<(const extended_type_info &rhs) const;
0075     BOOST_SERIALIZATION_DECL bool operator==(const extended_type_info &rhs) const;
0076     bool operator!=(const extended_type_info &rhs) const {
0077         return !(operator==(rhs));
0078     }
0079     // note explicit "export" of static function to work around
0080     // gcc 4.5 mingw error
0081     static BOOST_SERIALIZATION_DECL const extended_type_info *
0082     find(const char *key);
0083     // for plugins
0084     virtual void * construct(unsigned int /*count*/ = 0, ...) const = 0;
0085     virtual void destroy(void const * const /*p*/) const = 0;
0086 };
0087 
0088 template<class T>
0089 struct guid_defined : boost::mpl::false_ {};
0090 
0091 namespace ext {
0092     template <typename T>
0093     struct guid_impl
0094     {
0095         static inline const char * call()
0096         {
0097             return NULL;
0098         }
0099     };
0100 }
0101 
0102 template<class T>
0103 inline const char * guid(){
0104     return ext::guid_impl<T>::call();
0105 }
0106 
0107 } // namespace serialization
0108 } // namespace boost
0109 
0110 #ifdef BOOST_MSVC
0111 #pragma warning(pop)
0112 #endif
0113 
0114 #include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
0115 
0116 #endif // BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP