Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
poly_placeable.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#ifndef ADOBE_POLY_PLACEABLE_HPP
11#define ADOBE_POLY_PLACEABLE_HPP
12
13#include <boost/ref.hpp>
14
15#include <adobe/config.hpp>
18#include <adobe/poly.hpp>
19
20
21/**************************************************************************************************/
22
23namespace adobe {
24
25/**************************************************************************************************/
36
38 virtual void measure(extents_t& result) = 0;
39 virtual void place(const place_data_t& place_data) = 0;
40};
41
42/**************************************************************************************************/
43
50
51template <typename T>
52struct poly_placeable_instance : optimized_storage_type<T, poly_placeable_interface>::type {
54
56
57 poly_placeable_instance(const T& x) : base_t(x) {}
59
60 void measure(extents_t& result) { PlaceableConcept<T>::measure(this->get(), result); }
61
62 void place(const place_data_t& place_data) {
63 PlaceableConcept<T>::place(this->get(), place_data);
64 }
65};
66
67
68/**************************************************************************************************/
69
76
77struct placeable : public poly_base<poly_placeable_interface, poly_placeable_instance> {
79
80 template <typename T>
81 explicit placeable(const T& x) : base_t(x) {}
82
83 placeable(placeable&& x) : base_t(std::move(x)) {}
84
85 void measure(extents_t& result) { interface_ref().measure(result); }
86
87 void place(const place_data_t& place_data) { interface_ref().place(place_data); }
88};
89
90/**************************************************************************************************/
91
101
102/**************************************************************************************************/
103
111 virtual void measure_vertical(extents_t& in_out_attrs,
112 const place_data_t& placed_horizontal) = 0;
113};
114
115/**************************************************************************************************/
116
122template <typename T>
124 : optimized_storage_type<T, poly_placeable_twopass_interface>::type {
126
128
131
132 void measure(extents_t& result) { PlaceableTwoPassConcept<T>::measure(this->get(), result); }
133
134 void measure_vertical(extents_t& calculated_horizontal, const place_data_t& placed_horizontal) {
135 PlaceableTwoPassConcept<T>::measure_vertical(this->get(), calculated_horizontal,
136 placed_horizontal);
137 }
138
139 void place(const place_data_t& place_data) {
140 PlaceableTwoPassConcept<T>::place(this->get(), place_data);
141 }
142};
143
144/**************************************************************************************************/
145
150 : public poly_base<poly_placeable_twopass_interface, poly_placeable_twopass_instance> {
152
153 template <typename T>
154 explicit placeable_twopass(const T& x) : base_t(x) {}
155
157
158 void measure(extents_t& result) { interface_ref().measure(result); }
159
160 void measure_vertical(extents_t& calculated_horizontal, const place_data_t& placed_horizontal) {
161 interface_ref().measure_vertical(calculated_horizontal, placed_horizontal);
162 }
163
164 void place(const place_data_t& place_data) { interface_ref().place(place_data); }
165};
166
167/**************************************************************************************************/
168
177
179
180/**************************************************************************************************/
181
182} // namespace adobe
183
184/**************************************************************************************************/
185
186#endif
poly<foo> will be a runtime polymorphic value type wrapper modelling a concept represented by foo
Definition poly.hpp:403
poly< placeable_twopass > poly_placeable_twopass_t
convenience typedef.
poly< placeable > poly_placeable_t
convenience typedef.
STL namespace.
Concept map and constraints checking for the Placeable concept.
static void place(T &t, const place_data_t &place_data)
static void measure(T &t, extents_t &result)
Concept map and constraints checking for the PlaceableTwoPass concept.
static void measure_vertical(T &t, extents_t &calculated_horizontal, const place_data_t &placed_horizontal)
An intrinsic geometry class for objects with a graphical representation.
Definition extents.hpp:71
Authors of poly concept representatives must derive their instance class from this....
Definition poly.hpp:238
Layout data interface from the engine to the client.
placeable_twopass(placeable_twopass &&x)
void measure_vertical(extents_t &calculated_horizontal, const place_data_t &placed_horizontal)
poly_base< poly_placeable_twopass_interface, poly_placeable_twopass_instance > base_t
void measure(extents_t &result)
void place(const place_data_t &place_data)
placeable(placeable &&x)
placeable(const T &x)
void measure(extents_t &result)
void place(const place_data_t &place_data)
poly_base< poly_placeable_interface, poly_placeable_instance > base_t
Abstract interface providing signatures needed to implement "handle" objects modeling a Value (Copyab...
Definition poly.hpp:61
BOOST_CLASS_REQUIRE(T, adobe, PlaceableConcept)
poly_placeable_instance(poly_placeable_instance &&x)
optimized_storage_type< T, poly_placeable_interface >::type base_t
void measure(extents_t &result)
void place(const place_data_t &place_data)
Pure virtual interface for the poly<placeable> modeling PlaceableConcept.
virtual void place(const place_data_t &place_data)=0
virtual void measure(extents_t &result)=0
BOOST_CLASS_REQUIRE(T, adobe, PlaceableTwoPassConcept)
optimized_storage_type< T, poly_placeable_twopass_interface >::type base_t
void measure_vertical(extents_t &calculated_horizontal, const place_data_t &placed_horizontal)
void place(const place_data_t &place_data)
poly_placeable_twopass_instance(poly_placeable_twopass_instance &&x)
Pure virtual interface for poly<placeable_twopass> modeling PlaceableTwoPassConcept.
virtual void measure_vertical(extents_t &in_out_attrs, const place_data_t &placed_horizontal)=0