stlab.adobe.com Adobe Systems Incorporated
poly_regular.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2006-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  Author(s): Mat Marcus
7 */
8 
9 /*************************************************************************************************/
10 
11 #ifndef ADOBE_POLY_REGULAR_HPP
12 #define ADOBE_POLY_REGULAR_HPP
13 
14 #include <adobe/config.hpp>
15 
16 #include <boost/concept_check.hpp>
17 
18 #include <adobe/poly.hpp>
20 #include <adobe/empty.hpp>
21 
22 /*************************************************************************************************/
23 
24 namespace adobe {
25 
30 /*************************************************************************************************/
37 {
38  virtual bool equals(const poly_regular_interface& new_value) const = 0;
39 };
40 
41 /*************************************************************************************************/
42 
50 template <typename T>
51 struct poly_regular_instance : optimized_storage_type<T, poly_regular_interface>::type
52 {
54 
59 
63  poly_regular_instance(const T& x) : base_t(x) {}
64 
69  : base_t(move_from<base_t>(x.source)) {}
70 
71  bool equals(const poly_regular_interface& x) const
72  { return this->type_info() == x.type_info() && this->get() == *static_cast<const T*>(x.cast()); }
73 
74 };
75 
76 /*************************************************************************************************/
77 
84 struct regular : poly_base<poly_regular_interface, poly_regular_instance>
85 {
87 
91  template <typename T>
92  explicit regular(const T& s)
93  : base_t(s) { }
94 
96  : base_t(empty_t()) { }
97 
102  : base_t(move_from<base_t>(x.source)) {}
103 
104 };
105 
106 
107 /*************************************************************************************************/
108 
109 #if !defined(ADOBE_NO_DOCUMENTATION)
110 
111 /*************************************************************************************************/
112 
113 typedef poly<regular> poly_regular_t;
114 
115 /*************************************************************************************************/
116 
117 #endif
118 
119 /*************************************************************************************************/
120 
121 } // namespace adobe
122 
123 /*************************************************************************************************/
124 
125 #endif

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