Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
poly_regular.hpp
Go to the documentation of this file.
1/*
2 Copyright 2006-2007 Adobe Systems Incorporated
3 Distributed under the Boost Software License - Version 1.0 (see the accompanying file LICENSE
4 or a copy at https://stlab.github.io/adobe_source_libraries/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/empty.hpp>
19#include <adobe/poly.hpp>
21
22/**************************************************************************************************/
23
24namespace adobe {
25
29
30/**************************************************************************************************/
35
37 virtual bool equals(const poly_regular_interface& new_value) const = 0;
38};
39
40/**************************************************************************************************/
41
48
49template <typename T>
50struct poly_regular_instance : optimized_storage_type<T, poly_regular_interface>::type {
52
57
61 poly_regular_instance(const T& x) : base_t(x) {}
62
66 poly_regular_instance(move_from<poly_regular_instance> x)
67 : base_t(move_from<base_t>(x.source)) {}
68
69 bool equals(const poly_regular_interface& x) const {
70 return this->type_info() == x.type_info() &&
71 this->get() == *static_cast<const T*>(x.cast());
72 }
73};
74
75/**************************************************************************************************/
76
82
83struct regular : poly_base<poly_regular_interface, poly_regular_instance> {
85
89 template <typename T>
90 explicit regular(const T& s) : base_t(s) {}
91
93
97 regular(move_from<regular> x) : base_t(move_from<base_t>(x.source)) {}
98};
99
100
101/**************************************************************************************************/
102
103#if !defined(ADOBE_NO_DOCUMENTATION)
104
105/**************************************************************************************************/
106
108
109/**************************************************************************************************/
110
111#endif
112
113/**************************************************************************************************/
114
115} // namespace adobe
116
117/**************************************************************************************************/
118
119#endif
poly<foo> will be a runtime polymorphic value type wrapper modelling a concept represented by foo
Definition poly.hpp:403
poly< regular > poly_regular_t
Authors of poly concept representatives must derive their instance class from this....
Definition poly.hpp:238
Abstract interface providing signatures needed to implement "handle" objects modeling a Value (Copyab...
Definition poly.hpp:61
virtual const std::type_info & type_info() const =0
bool equals(const poly_regular_interface &x) const
BOOST_CLASS_REQUIRE(T, adobe, RegularConcept)
optimized_storage_type< T, poly_regular_interface >::type base_t
poly_regular_instance(move_from< poly_regular_instance > x)
Virtual interface for RegularConcept. Used in poly<regular> implementation.
virtual bool equals(const poly_regular_interface &new_value) const =0
poly_base< poly_regular_interface, poly_regular_instance > base_t
regular(const T &s)
regular(move_from< regular > x)
An empty regular- and less-than-comparable- type.
Definition empty.hpp:42