stlab.adobe.com Adobe Systems Incorporated

name_fwd.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_NAME_FWD_HPP
00010 #define ADOBE_NAME_FWD_HPP
00011 
00012 #include <adobe/config.hpp>
00013 
00014 #include <cstddef>
00015 #include <cassert>
00016 
00017 #include <boost/operators.hpp>
00018 #include <boost/type_traits/is_pod.hpp>
00019 #include <boost/type_traits/has_nothrow_constructor.hpp>
00020 
00021 #include <adobe/implementation/swap.hpp>
00022 
00023 #include <adobe/empty.hpp>
00024 
00025 #if defined(ADOBE_STD_SERIALIZATION)
00026 #include <iosfwd>
00027 #endif
00028 
00029 /*************************************************************************************************/
00030 
00031 namespace adobe {
00032 
00033 namespace version_1 {
00034 
00035 class name_t;
00036 
00037 inline bool operator < (const name_t& x, const name_t& y);
00038 inline bool operator == (const name_t& x, const name_t& y);
00039 
00040 /*************************************************************************************************/
00041 
00042 class name_t : boost::totally_ordered<name_t, name_t>
00043 {
00044  private:
00045     operator int () const;
00046  public:
00047 
00048     explicit name_t (const char* string_name = "");
00049                 
00050     const char* c_str() const;
00051 
00052 #if !defined(ADOBE_NO_DOCUMENTATION)
00053     operator bool() const;
00054     bool operator!() const;
00055     
00056     friend void swap(name_t& x, name_t& y) { std::swap(x.name_m, y.name_m); }
00057 #endif
00058 
00059  private:
00060     friend class static_name_t;
00061     friend struct aggregate_name_t;
00062     
00063     struct dont_copy_t { };
00064     struct dont_initialize_t { };
00065     
00066     name_t(const char* x, dont_copy_t);
00067     
00068     name_t (dont_initialize_t) { }
00069     
00070     const char* name_m;
00071 };
00072     
00073 /*************************************************************************************************/
00074 
00075 class static_name_t;
00076 struct aggregate_name_t;
00077 
00078 /*************************************************************************************************/
00079 
00080 #if defined(ADOBE_STD_SERIALIZATION)
00081 std::ostream& operator << (std::ostream& os, const name_t& t);
00082 #endif
00083 
00084 /*************************************************************************************************/
00085 
00086 } // namespace version_1
00087 
00088 using version_1::name_t;
00089 using version_1::static_name_t;
00090 using version_1::aggregate_name_t;
00091 
00092 } // namespace adobe
00093 
00094 /*************************************************************************************************/
00095 
00096 namespace boost {
00097 
00098 template <> struct is_pod<adobe::name_t> : boost::mpl::true_ { };
00099     // implies has_nothrow_constructor and has_nothrow_copy
00100 
00101 }
00102 
00103 /*************************************************************************************************/
00104 
00105 #endif // ADOBE_NAME_FWD_HPP
00106 
00107 /*************************************************************************************************/

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