A.hpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #ifndef BOOST_SERIALIZATION_TEST_A_HPP
  2. #define BOOST_SERIALIZATION_TEST_A_HPP
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER)
  5. # pragma once
  6. #endif
  7. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  8. // A.hpp simple class test
  9. // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
  10. // Use, modification and distribution is subject to the Boost Software
  11. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. // See http://www.boost.org for updates, documentation, and revision history.
  14. #include <ostream> // for friend output operators
  15. #include <cstddef> // size_t
  16. #include <boost/config.hpp>
  17. #if defined(BOOST_NO_STDC_NAMESPACE)
  18. namespace std{
  19. using ::size_t;
  20. }
  21. #endif
  22. #include <boost/limits.hpp>
  23. #include <boost/cstdint.hpp>
  24. #include <boost/serialization/access.hpp>
  25. #include <boost/serialization/string.hpp>
  26. #if defined(A_IMPORT)
  27. #define A_DLL_DECL BOOST_SYMBOL_IMPORT
  28. #pragma message("A imported")
  29. #elif defined(A_EXPORT)
  30. #define A_DLL_DECL BOOST_SYMBOL_EXPORT
  31. #pragma message ("A exported")
  32. #endif
  33. #ifndef A_DLL_DECL
  34. #define A_DLL_DECL
  35. #endif
  36. class A_DLL_DECL A {
  37. private:
  38. friend class boost::serialization::access;
  39. template<class Archive>
  40. void serialize(
  41. Archive &ar,
  42. const unsigned int /* file_version */
  43. );
  44. bool b;
  45. #ifndef BOOST_NO_INT64_T
  46. boost::int64_t f;
  47. boost::uint64_t g;
  48. #endif
  49. enum h {
  50. i = 0,
  51. j,
  52. k
  53. } l;
  54. std::size_t m;
  55. signed long n;
  56. unsigned long o;
  57. signed short p;
  58. unsigned short q;
  59. #ifndef BOOST_NO_CWCHAR
  60. wchar_t r;
  61. #endif
  62. char c;
  63. signed char s;
  64. unsigned char t;
  65. signed int u;
  66. unsigned int v;
  67. float w;
  68. double x;
  69. std::string y;
  70. #ifndef BOOST_NO_STD_WSTRING
  71. std::wstring z;
  72. #endif
  73. public:
  74. A();
  75. bool check_equal(const A &rhs) const;
  76. bool operator==(const A &rhs) const;
  77. bool operator!=(const A &rhs) const;
  78. bool operator<(const A &rhs) const; // used by less
  79. // hash function for class A
  80. operator std::size_t () const;
  81. friend std::ostream & operator<<(std::ostream & os, A const & a);
  82. };
  83. #endif // BOOST_SERIALIZATION_TEST_A_HPP