stlab.adobe.com Adobe Systems Incorporated
name_fwd.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 
7 /*************************************************************************************************/
8 
9 #ifndef ADOBE_NAME_FWD_HPP
10 #define ADOBE_NAME_FWD_HPP
11 
12 #include <adobe/config.hpp>
13 
14 #include <cstddef>
15 #include <cassert>
16 
17 #include <boost/operators.hpp>
18 #include <boost/type_traits/is_pod.hpp>
19 #include <boost/type_traits/has_nothrow_constructor.hpp>
20 
21 #include <adobe/implementation/swap.hpp>
22 
23 #include <adobe/empty.hpp>
24 
25 #if defined(ADOBE_STD_SERIALIZATION)
26 #include <iosfwd>
27 #endif
28 
29 /*************************************************************************************************/
30 
31 namespace adobe {
32 
33 namespace version_1 {
34 
35 class name_t;
36 
37 inline bool operator < (const name_t& x, const name_t& y);
38 inline bool operator == (const name_t& x, const name_t& y);
39 
40 /*************************************************************************************************/
41 
42 class name_t : boost::totally_ordered<name_t, name_t>
43 {
44  private:
45  operator int () const;
46  public:
47 
48  explicit name_t (const char* string_name = "");
49 
50  const char* c_str() const;
51 
52 #if !defined(ADOBE_NO_DOCUMENTATION)
53  operator bool() const;
54  bool operator!() const;
55 
56  friend void swap(name_t& x, name_t& y) { std::swap(x.name_m, y.name_m); }
57 #endif
58 
59  private:
60  friend class static_name_t;
61  friend struct aggregate_name_t;
62 
63  struct dont_copy_t { };
64  struct dont_initialize_t { };
65 
66  name_t(const char* x, dont_copy_t);
67 
68  name_t (dont_initialize_t) { }
69 
70  const char* name_m;
71 };
72 
73 /*************************************************************************************************/
74 
75 class static_name_t;
76 struct aggregate_name_t;
77 
78 /*************************************************************************************************/
79 
80 #if defined(ADOBE_STD_SERIALIZATION)
81 std::ostream& operator << (std::ostream& os, const name_t& t);
82 #endif
83 
84 /*************************************************************************************************/
85 
86 } // namespace version_1
87 
88 using version_1::name_t;
89 using version_1::static_name_t;
90 using version_1::aggregate_name_t;
91 
92 } // namespace adobe
93 
94 /*************************************************************************************************/
95 
96 namespace boost {
97 
98 template <> struct is_pod<adobe::name_t> : boost::mpl::true_ { };
99  // implies has_nothrow_constructor and has_nothrow_copy
100 
101 }
102 
103 /*************************************************************************************************/
104 
105 #endif // ADOBE_NAME_FWD_HPP
106 
107 /*************************************************************************************************/
name_t(const char *string_name="")
void swap(adobe::lex_stream_t &, adobe::lex_stream_t &)
Definition: lex_stream.hpp:68
bool operator<(const name_t &x, const name_t &y)
Definition: name.hpp:46
std::ostream & operator<<(std::ostream &out, const dictionary_t &x)
void swap(circular_queue< T > &, circular_queue< T > &)
bool operator==(const function< F > &x, null_ptr_t)
Definition: function.hpp:168
const char * c_str() const
Definition: name.hpp:63

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