stlab.adobe.com Adobe Systems Incorporated

empty.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2005-2007 Adobe Systems Incorporated
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /*************************************************************************************************/
00008 
00009 #ifndef ADOBE_EMPTY_HPP
00010 #define ADOBE_EMPTY_HPP
00011 
00012 /*************************************************************************************************/
00013 
00014 #include <adobe/config.hpp>
00015 
00016 #include <boost/operators.hpp>
00017 #include <boost/mpl/bool.hpp>
00018 #include <boost/type_traits/is_empty.hpp>
00019 #include <boost/type_traits/is_pod.hpp>
00020 #include <boost/type_traits/has_trivial_constructor.hpp>
00021 #include <boost/type_traits/has_trivial_destructor.hpp>
00022 
00023 #include <adobe/typeinfo.hpp>
00024 
00025 #if defined(ADOBE_STD_SERIALIZATION)
00026 #include <ostream>
00027 #endif
00028 
00029 /*************************************************************************************************/
00030 
00031 namespace adobe
00032 {
00033 
00034 /*************************************************************************************************/
00035 
00036 namespace version_1
00037 {
00038 
00039 /*************************************************************************************************/
00040 
00054 struct empty_t : private boost::totally_ordered<empty_t>
00055 {
00056     friend inline bool operator == (const empty_t&, const empty_t&) { return true; }
00057     friend inline bool operator < (const empty_t&, const empty_t&) { return false; }
00058     friend inline void swap(empty_t&, empty_t&) { }
00059 };
00060 
00061 #if defined(ADOBE_STD_SERIALIZATION)
00063 inline std::ostream& operator << (std::ostream& stream, const empty_t&)
00064 {
00065     stream << "empty"; // REVISIT (sparent) : Go through formatter.
00066     return stream;
00067 }
00068 #endif
00069 
00070 /*************************************************************************************************/
00071 
00072 } // namespace version_1
00073 
00074 using version_1::empty_t;
00075 
00076 /*************************************************************************************************/
00077 
00083 
00084 template <typename Derived>
00085 struct empty_base { };
00086 
00087 /*************************************************************************************************/
00088 
00089 } // namespace adobe
00090 
00091 /*************************************************************************************************/
00092 
00093 namespace boost {
00094 
00095 template <> struct is_pod<adobe::version_1::empty_t> : boost::mpl::true_ { };
00096 template <> struct is_empty<adobe::version_1::empty_t> : boost::mpl::true_ { };
00097 template <> struct has_trivial_constructor<adobe::version_1::empty_t> : boost::mpl::true_ { };
00098 template <> struct has_trivial_destructor<adobe::version_1::empty_t> : boost::mpl::true_ { };
00099 
00100 }
00101 
00102 /*************************************************************************************************/
00103 
00104 ADOBE_NAME_TYPE_0("empty_t:version_1:adobe", adobe::version_1::empty_t)
00105 ADOBE_SHORT_NAME_TYPE('e','m','t','y', adobe::version_1::empty_t)
00106 
00107 /*************************************************************************************************/
00108 
00109 #endif
00110 
00111 /*************************************************************************************************/

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google