From b761e0e0c0840c2b76bc7fa1d0eef799903a977e Mon Sep 17 00:00:00 2001
From: Christopher Schmidt
Date: Mon, 4 Oct 2010 20:50:31 +0000
Subject: [PATCH] Fusion: BOOST_FUSION_ADAPT_ADT documentation
[SVN r65756]
---
doc/adapted.qbk | 100 ++++++-
doc/fusion.qbk | 23 +-
doc/html/fusion/adapted.html | 3 +-
doc/html/fusion/adapted/adapt_adt.html | 161 ++++++++++++
doc/html/fusion/adapted/adapt_assoc.html | 10 +-
.../adapted/adapt_assoc_struct_named.html | 16 +-
.../adapted/adapt_assoc_tpl_struct.html | 10 +-
doc/html/fusion/adapted/adapt_struct.html | 10 +-
.../fusion/adapted/adapt_struct_named.html | 10 +-
doc/html/fusion/adapted/adapt_tpl_struct.html | 10 +-
doc/html/fusion/adapted/array.html | 6 +-
doc/html/fusion/adapted/boost__array.html | 8 +-
doc/html/fusion/adapted/boost__tuple.html | 8 +-
.../fusion/adapted/define_assoc_struct.html | 10 +-
.../adapted/define_assoc_tpl_struct.html | 10 +-
doc/html/fusion/adapted/define_struct.html | 18 +-
.../fusion/adapted/define_tpl_struct.html | 10 +-
doc/html/fusion/adapted/mpl_sequence.html | 8 +-
doc/html/fusion/adapted/std__pair.html | 8 +-
doc/html/fusion/algorithm.html | 6 +-
doc/html/fusion/algorithm/iteration.html | 2 +-
.../iteration/functions/accumulate.html | 14 +-
.../algorithm/iteration/functions/fold.html | 14 +-
.../iteration/functions/for_each.html | 14 +-
.../iteration/functions/iter_fold.html | 14 +-
.../iteration/functions/reverse_fold.html | 14 +-
.../functions/reverse_iter_fold.html | 14 +-
.../iteration/metafunctions/accumulate.html | 12 +-
.../iteration/metafunctions/fold.html | 12 +-
.../iteration/metafunctions/for_each.html | 12 +-
.../iteration/metafunctions/iter_fold.html | 12 +-
.../iteration/metafunctions/reverse_fold.html | 12 +-
.../metafunctions/reverse_iter_fold.html | 12 +-
doc/html/fusion/algorithm/query.html | 2 +-
.../fusion/algorithm/query/functions/all.html | 14 +-
.../fusion/algorithm/query/functions/any.html | 14 +-
.../algorithm/query/functions/count.html | 14 +-
.../algorithm/query/functions/count_if.html | 14 +-
.../algorithm/query/functions/find.html | 14 +-
.../algorithm/query/functions/find_if.html | 12 +-
.../algorithm/query/functions/none.html | 14 +-
.../algorithm/query/metafunctions/all.html | 12 +-
.../algorithm/query/metafunctions/any.html | 12 +-
.../algorithm/query/metafunctions/count.html | 12 +-
.../query/metafunctions/count_if.html | 12 +-
.../algorithm/query/metafunctions/find.html | 12 +-
.../query/metafunctions/find_if.html | 12 +-
.../algorithm/query/metafunctions/none.html | 12 +-
doc/html/fusion/algorithm/transformation.html | 2 +-
.../transformation/functions/clear.html | 14 +-
.../transformation/functions/erase.html | 14 +-
.../transformation/functions/erase_key.html | 14 +-
.../transformation/functions/filter.html | 14 +-
.../transformation/functions/filter_if.html | 14 +-
.../transformation/functions/insert.html | 14 +-
.../functions/insert_range.html | 14 +-
.../transformation/functions/join.html | 14 +-
.../transformation/functions/pop_back.html | 14 +-
.../transformation/functions/pop_front.html | 14 +-
.../transformation/functions/push_back.html | 14 +-
.../transformation/functions/push_front.html | 14 +-
.../transformation/functions/remove.html | 14 +-
.../transformation/functions/remove_if.html | 14 +-
.../transformation/functions/replace.html | 14 +-
.../transformation/functions/replace_if.html | 14 +-
.../transformation/functions/reverse.html | 14 +-
.../transformation/functions/transform.html | 18 +-
.../transformation/functions/zip.html | 14 +-
.../transformation/metafunctions/clear.html | 12 +-
.../transformation/metafunctions/erase.html | 12 +-
.../metafunctions/erase_key.html | 12 +-
.../transformation/metafunctions/filter.html | 12 +-
.../metafunctions/filter_if.html | 12 +-
.../transformation/metafunctions/insert.html | 12 +-
.../metafunctions/insert_range.html | 12 +-
.../transformation/metafunctions/join.html | 10 +-
.../metafunctions/pop_back.html | 12 +-
.../metafunctions/pop_front.html | 12 +-
.../metafunctions/push_back.html | 12 +-
.../metafunctions/push_front.html | 12 +-
.../transformation/metafunctions/remove.html | 12 +-
.../metafunctions/remove_if.html | 12 +-
.../transformation/metafunctions/replace.html | 12 +-
.../metafunctions/replace_if.html | 12 +-
.../transformation/metafunctions/reverse.html | 12 +-
.../metafunctions/transform.html | 18 +-
.../transformation/metafunctions/zip.html | 10 +-
doc/html/fusion/change_log.html | 19 +-
doc/html/fusion/container.html | 2 +-
doc/html/fusion/container/cons.html | 14 +-
doc/html/fusion/container/conversion.html | 2 +-
.../conversion/functions/as_list.html | 12 +-
.../conversion/functions/as_map.html | 12 +-
.../conversion/functions/as_set.html | 12 +-
.../conversion/functions/as_vector.html | 12 +-
.../conversion/metafunctions/as_list.html | 12 +-
.../conversion/metafunctions/as_map.html | 12 +-
.../conversion/metafunctions/as_set.html | 12 +-
.../conversion/metafunctions/as_vector.html | 12 +-
doc/html/fusion/container/generation.html | 2 +-
.../generation/functions/list_tie.html | 12 +-
.../generation/functions/make_cons.html | 14 +-
.../generation/functions/make_list.html | 14 +-
.../generation/functions/make_map.html | 14 +-
.../generation/functions/make_set.html | 14 +-
.../generation/functions/make_vector.html | 14 +-
.../generation/functions/map_tie.html | 12 +-
.../container/generation/functions/tiers.html | 6 +-
.../generation/functions/vector_tie.html | 12 +-
.../generation/metafunctions/list_tie.html | 12 +-
.../generation/metafunctions/make_cons.html | 12 +-
.../generation/metafunctions/make_list.html | 12 +-
.../generation/metafunctions/make_map.html | 14 +-
.../generation/metafunctions/make_set.html | 12 +-
.../generation/metafunctions/make_vector.html | 12 +-
.../generation/metafunctions/map_tie.html | 12 +-
.../generation/metafunctions/vector_tie.html | 12 +-
doc/html/fusion/container/list.html | 14 +-
doc/html/fusion/container/map.html | 14 +-
doc/html/fusion/container/set.html | 14 +-
doc/html/fusion/container/vector.html | 14 +-
doc/html/fusion/extension/ext_full.html | 16 +-
.../fusion/extension/iterator_facade.html | 14 +-
.../fusion/extension/sequence_facade.html | 14 +-
doc/html/fusion/functional.html | 8 +-
.../fusion/functional/adapters/fused.html | 16 +-
.../adapters/fused_function_object.html | 16 +-
.../functional/adapters/fused_procedure.html | 16 +-
.../fusion/functional/adapters/limits.html | 4 +-
.../fusion/functional/adapters/unfused.html | 16 +-
.../functional/adapters/unfused_typed.html | 16 +-
.../fusion/functional/concepts/callable.html | 6 +-
.../functional/concepts/def_callable.html | 10 +-
doc/html/fusion/functional/concepts/poly.html | 10 +-
.../functional/concepts/reg_callable.html | 10 +-
.../generation/functions/mk_fused.html | 14 +-
.../generation/functions/mk_fused_fobj.html | 14 +-
.../generation/functions/mk_fused_proc.html | 14 +-
.../generation/functions/mk_unfused.html | 14 +-
.../generation/metafunctions/mk_fused.html | 8 +-
.../metafunctions/mk_fused_fobj.html | 8 +-
.../metafunctions/mk_fused_proc.html | 8 +-
.../generation/metafunctions/mk_unfused.html | 8 +-
.../invocation/functions/invoke.html | 14 +-
.../invocation/functions/invoke_fobj.html | 14 +-
.../invocation/functions/invoke_proc.html | 14 +-
.../fusion/functional/invocation/limits.html | 4 +-
.../invocation/metafunctions/invoke.html | 6 +-
.../invocation/metafunctions/invoke_fobj.html | 6 +-
.../invocation/metafunctions/invoke_proc.html | 6 +-
doc/html/fusion/introduction.html | 4 +-
doc/html/fusion/iterator.html | 2 +-
.../concepts/associative_iterator.html | 10 +-
.../concepts/bidirectional_iterator.html | 14 +-
.../iterator/concepts/forward_iterator.html | 12 +-
.../concepts/random_access_iterator.html | 10 +-
.../fusion/iterator/functions/advance.html | 12 +-
.../fusion/iterator/functions/advance_c.html | 12 +-
doc/html/fusion/iterator/functions/deref.html | 12 +-
.../fusion/iterator/functions/deref_data.html | 12 +-
.../fusion/iterator/functions/distance.html | 12 +-
doc/html/fusion/iterator/functions/next.html | 12 +-
doc/html/fusion/iterator/functions/prior.html | 12 +-
.../iterator/metafunctions/advance.html | 12 +-
.../iterator/metafunctions/advance_c.html | 12 +-
.../fusion/iterator/metafunctions/deref.html | 12 +-
.../iterator/metafunctions/deref_data.html | 12 +-
.../iterator/metafunctions/distance.html | 12 +-
.../iterator/metafunctions/equal_to.html | 12 +-
.../fusion/iterator/metafunctions/key_of.html | 12 +-
.../fusion/iterator/metafunctions/next.html | 12 +-
.../fusion/iterator/metafunctions/prior.html | 12 +-
.../iterator/metafunctions/value_of.html | 12 +-
.../iterator/metafunctions/value_of_data.html | 12 +-
.../iterator/operator/operator_equality.html | 10 +-
.../operator/operator_inequality.html | 10 +-
.../operator/operator_unary_star.html | 12 +-
doc/html/fusion/notes.html | 248 +++++++++++++++++-
doc/html/fusion/organization.html | 10 +-
doc/html/fusion/preface.html | 10 +-
doc/html/fusion/quick_start.html | 16 +-
doc/html/fusion/sequence.html | 2 +-
doc/html/fusion/sequence/concepts.html | 4 +-
.../concepts/associative_sequence.html | 10 +-
.../concepts/bidirectional_sequence.html | 12 +-
.../sequence/concepts/forward_sequence.html | 12 +-
.../concepts/random_access_sequence.html | 12 +-
doc/html/fusion/sequence/intrinsic.html | 6 +-
.../sequence/intrinsic/functions/at.html | 12 +-
.../sequence/intrinsic/functions/at_c.html | 12 +-
.../sequence/intrinsic/functions/at_key.html | 12 +-
.../sequence/intrinsic/functions/back.html | 12 +-
.../sequence/intrinsic/functions/begin.html | 12 +-
.../sequence/intrinsic/functions/empty.html | 12 +-
.../sequence/intrinsic/functions/end.html | 12 +-
.../sequence/intrinsic/functions/front.html | 12 +-
.../sequence/intrinsic/functions/has_key.html | 12 +-
.../sequence/intrinsic/functions/size.html | 12 +-
.../sequence/intrinsic/functions/swap.html | 10 +-
.../sequence/intrinsic/metafunctions/at.html | 16 +-
.../intrinsic/metafunctions/at_c.html | 16 +-
.../intrinsic/metafunctions/at_key.html | 16 +-
.../intrinsic/metafunctions/back.html | 12 +-
.../intrinsic/metafunctions/begin.html | 12 +-
.../intrinsic/metafunctions/empty.html | 12 +-
.../sequence/intrinsic/metafunctions/end.html | 12 +-
.../intrinsic/metafunctions/front.html | 12 +-
.../intrinsic/metafunctions/has_key.html | 12 +-
.../intrinsic/metafunctions/size.html | 12 +-
.../intrinsic/metafunctions/swap.html | 10 +-
.../intrinsic/metafunctions/value_at.html | 12 +-
.../intrinsic/metafunctions/value_at_c.html | 12 +-
.../intrinsic/metafunctions/value_at_key.html | 12 +-
.../fusion/sequence/operator/comparison.html | 2 +-
.../sequence/operator/comparison/equal.html | 12 +-
.../operator/comparison/greater_than.html | 10 +-
.../comparison/greater_than_equal.html | 10 +-
.../operator/comparison/less_than.html | 10 +-
.../operator/comparison/less_than_equal.html | 10 +-
.../operator/comparison/not_equal.html | 10 +-
doc/html/fusion/sequence/operator/i_o.html | 2 +-
doc/html/fusion/sequence/operator/i_o/in.html | 12 +-
.../fusion/sequence/operator/i_o/out.html | 12 +-
doc/html/fusion/support/category_of.html | 12 +-
doc/html/fusion/support/deduce.html | 10 +-
doc/html/fusion/support/deduce_sequence.html | 10 +-
doc/html/fusion/support/is_sequence.html | 12 +-
doc/html/fusion/support/is_view.html | 12 +-
doc/html/fusion/support/pair.html | 12 +-
doc/html/fusion/support/tag_of.html | 12 +-
.../fusion/tuple/class_template_tuple.html | 2 +-
.../class_template_tuple/construction.html | 4 +-
.../class_template_tuple/element_access.html | 4 +-
.../relational_operators.html | 4 +-
.../tuple_creation_functions.html | 4 +-
.../tuple_helper_classes.html | 4 +-
doc/html/fusion/tuple/pairs.html | 4 +-
doc/html/fusion/view.html | 2 +-
doc/html/fusion/view/filter_view.html | 14 +-
doc/html/fusion/view/iterator_range.html | 14 +-
doc/html/fusion/view/joint_view.html | 14 +-
doc/html/fusion/view/nview.html | 14 +-
doc/html/fusion/view/repetitive_view.html | 14 +-
doc/html/fusion/view/reverse_view.html | 12 +-
doc/html/fusion/view/single_view.html | 12 +-
doc/html/fusion/view/transform_view.html | 12 +-
doc/html/fusion/view/zip_view.html | 14 +-
doc/html/index.html | 5 +-
doc/notes.qbk | 75 ++++++
.../fusion/adapted/adt/detail/adapt_base.hpp | 12 +-
250 files changed, 1968 insertions(+), 1404 deletions(-)
create mode 100644 doc/html/fusion/adapted/adapt_adt.html
diff --git a/doc/adapted.qbk b/doc/adapted.qbk
index 7b4324f9..de658573 100644
--- a/doc/adapted.qbk
+++ b/doc/adapted.qbk
@@ -548,9 +548,105 @@ namespace qualified name of the struct to be converted.
[endsect]
-[section:define_struct BOOST_FUSION_DEFINE_STRUCT]
+[section:adapt_adt BOOST_FUSION_ADAPT_ADT]
-[heading Description]
+BOOST_FUSION_ADAPT_ADT is a macro than can be used to generate all the
+necessary boilerplate to adapt an arbitrary class type as a model of
+__random_access_sequence__.
+
+[heading Synopsis]
+
+ BOOST_FUSION_ADAPT_ADT(
+ type_name,
+ (attribute_type0, attribute_const_type0, get_expr0, set_expr0)
+ (attribute_type1, attribute_const_type1, get_expr1, set_expr1)
+ ...
+ )
+
+[heading Expression Semantics]
+
+The above macro generates the necessary code to adapt `type_name`
+as a model of __random_access_sequence__.
+The sequence of
+[^(attribute_type['N], attribute_const_type['N], get_expr['N], set_expr['N])]
+quadruples declares the types, const types, get-expressions and set-expressions
+of the elements that are part of the adapted fusion sequence.
+[^get_expr['N]] is the expression that is invoked to get the ['N]th element
+of an instance of `type_name`. This expression may access a variable named
+`obj` of type `type_name&` or `type_name const&` which represents the underlying
+instance of `type_name`.
+[^attribute_type['N]] and [^attribute_const_type['N]] may specify the types
+that [^get_expr['N]] denotes to.
+[^set_expr['N]] is the expression that is invoked to set the ['N]th element
+of an instance of `type_name`. This expression may access variables named
+`obj` of type `type_name&`, which represent the corresponding instance of
+`type_name`, and `val` of an arbitrary const-qualified reference template type
+parameter `Val`, which represents the right operand of the assignment
+expression.
+
+The actual return type of fusion's intrinsic sequence access (meta-)functions
+when in invoked with (an instance of) `type_name` is a proxy type.
+This type is implicitly convertible to the attribute type via [^get_expr['N]] and
+forwards assignment to the underlying element via [^set_expr['N]].
+The value type (that is the type returned by __result_of_value_of__,
+__result_of_value_at__ and __result_of_value_at_c__) of the ['N]th element
+is [^attribute_type['N]] with const-qualifier and reference removed.
+
+[heading Header]
+
+ #include
+ #include
+
+[heading Example]
+ namespace demo
+ {
+ struct employee
+ {
+ private:
+ std::string name;
+ int age;
+
+ public:
+ void set_name(std::string const& n)
+ {
+ name=n;
+ }
+
+ void set_age(int a)
+ {
+ age=a;
+ }
+
+ std::string const& get_name()const
+ {
+ return name;
+ }
+
+ int get_age()const
+ {
+ return age;
+ }
+ };
+ }
+
+ BOOST_FUSION_ADAPT_ADT(
+ demo::employee,
+ (std::string const&, std::string const&, obj.get_name(), obj.set_name(val))
+ (int, int, obj.get_age(), obj.set_age(val)))
+
+ demo::employee e;
+ front(e)="Edward Norton";
+ back(e)=41;
+ //Prints 'Edward Norton is 41 years old'
+ std::cout << e.get_name() << " is " << e.get_age() << "years old" << std::endl;
+
+[heading See also]
+
+__adt_attribute_proxy__
+
+[endsect]
+
+[section:define_struct BOOST_FUSION_DEFINE_STRUCT]
BOOST_FUSION_DEFINE_STRUCT is a macro that can be used to generate all the
necessary boilerplate to define and adapt an arbitrary struct as a model of
diff --git a/doc/fusion.qbk b/doc/fusion.qbk
index 9118c130..a24f3adc 100644
--- a/doc/fusion.qbk
+++ b/doc/fusion.qbk
@@ -131,16 +131,17 @@
[def __std_pair__ [link fusion.adapted.std__pair `std::pair`]]
[def __boost_array__ [link fusion.adapted.boost__array `boost::array`]]
[def __mpl_sequence__ [link fusion.adapted.mpl_sequence mpl sequence]]
-[def __adapt_tpl_struct__ [link fusion.adapted.adapt_tpl_struct BOOST_FUSION_ADAPT_TPL_STRUCT]]
-[def __adapt_struct_named__ [link fusion.adapted.adapt_struct_named BOOST_FUSION_ADAPT_STRUCT_NAMED]]
-[def __adapt_struct_named_ns__ [link fusion.adapted.adapt_struct_named BOOST_FUSION_ADAPT_STRUCT_NAMED_NS]]
-[def __adapt_assoc_tpl_struct__ [link fusion.adapted.adapt_assoc_tpl_struct BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT]]
-[def __adapt_assoc_struct_named__ [link fusion.adapted.adapt_assoc_struct_named BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED]]
-[def __adapt_assoc_struct_named_ns__ [link fusion.adapted.adapt_assoc_struct_named BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS]]
-[def __define_struct__ [link fusion.adapted.define_struct BOOST_FUSION_DEFINE_STRUCT]]
-[def __define_tpl_struct__ [link fusion.adapted.define_tpl_struct BOOST_FUSION_DEFINE_TPL_STRUCT]]
-[def __define_assoc_struct__ [link fusion.adapted.define_assoc_struct BOOST_FUSION_DEFINE_ASSOC_STRUCT]]
-[def __define_assoc_tpl_struct__ [link fusion.adapted.define_assoc_tpl_struct BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT]]
+[def __adapt_tpl_struct__ [link fusion.adapted.adapt_tpl_struct `BOOST_FUSION_ADAPT_TPL_STRUCT`]]
+[def __adapt_struct_named__ [link fusion.adapted.adapt_struct_named `BOOST_FUSION_ADAPT_STRUCT_NAMED`]]
+[def __adapt_struct_named_ns__ [link fusion.adapted.adapt_struct_named `BOOST_FUSION_ADAPT_STRUCT_NAMED_NS`]]
+[def __adapt_assoc_tpl_struct__ [link fusion.adapted.adapt_assoc_tpl_struct `BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT`]]
+[def __adapt_assoc_struct_named__ [link fusion.adapted.adapt_assoc_struct_named `BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED`]]
+[def __adapt_assoc_struct_named_ns__ [link fusion.adapted.adapt_assoc_struct_named `BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS`]]
+[def __adapt_adt__ [link fusion.adapted.adapt_adt `BOOST_FUSION_ADAPT_ADT`]]
+[def __define_struct__ [link fusion.adapted.define_struct `BOOST_FUSION_DEFINE_STRUCT`]]
+[def __define_tpl_struct__ [link fusion.adapted.define_tpl_struct `BOOST_FUSION_DEFINE_TPL_STRUCT`]]
+[def __define_assoc_struct__ [link fusion.adapted.define_assoc_struct `BOOST_FUSION_DEFINE_ASSOC_STRUCT`]]
+[def __define_assoc_tpl_struct__ [link fusion.adapted.define_assoc_tpl_struct `BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT`]]
[def __intrinsic__ [link fusion.sequence.intrinsic Intrinsic]]
[def __intrinsics__ [link fusion.sequence.intrinsic Intrinsics]]
@@ -317,6 +318,8 @@
[def __sequence_facade__ [link fusion.extension.sequence_facade `sequence_facade`]]
[def __iterator_facade__ [link fusion.extension.iterator_facade `iterator_facade`]]
+[def __adt_attribute_proxy__ [link fusion.notes.adt_attribute_proxy `adt_attribute_proxy`]]
+
[include preface.qbk]
[include introduction.qbk]
[include quick_start.qbk]
diff --git a/doc/html/fusion/adapted.html b/doc/html/fusion/adapted.html
index c050010f..d8eac04a 100644
--- a/doc/html/fusion/adapted.html
+++ b/doc/html/fusion/adapted.html
@@ -38,6 +38,7 @@
BOOST_FUSION_ADAPT_ASSOC_STRUCT
BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED
+BOOST_FUSION_ADAPT_ADT
BOOST_FUSION_DEFINE_STRUCT
BOOST_FUSION_DEFINE_TPL_STRUCT
BOOST_FUSION_DEFINE_ASSOC_STRUCT
@@ -56,7 +57,7 @@
various data structures, non-intrusively, as full fledged Fusion sequences.
#include < boost / fusion / adapted . hpp >
diff --git a/doc/html/fusion/adapted/adapt_adt.html b/doc/html/fusion/adapted/adapt_adt.html
new file mode 100644
index 00000000..d5bfe8fd
--- /dev/null
+++ b/doc/html/fusion/adapted/adapt_adt.html
@@ -0,0 +1,161 @@
+
+
+
+BOOST_FUSION_ADAPT_ADT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BOOST_FUSION_ADAPT_ADT is a macro than can be used to generate all the necessary
+ boilerplate to adapt an arbitrary class type as a model of Random
+ Access Sequence .
+
+
+
BOOST_FUSION_ADAPT_ADT (
+ type_name ,
+ ( attribute_type0 , attribute_const_type0 , get_expr0 , set_expr0 )
+ ( attribute_type1 , attribute_const_type1 , get_expr1 , set_expr1 )
+ ...
+ )
+
+
+
+ The above macro generates the necessary code to adapt type_name
+ as a model of Random
+ Access Sequence . The sequence of (attribute_typeN ,
+ attribute_const_typeN , get_exprN ,
+ set_exprN )
quadruples declares the types,
+ const types, get-expressions and set-expressions of the elements that are
+ part of the adapted fusion sequence. get_exprN
+ is the expression that is invoked to get the N th element
+ of an instance of type_name
.
+ This expression may access a variable named obj
+ of type type_name &
+ or type_name const &
which represents the underlying instance
+ of type_name
. attribute_typeN
+ and attribute_const_typeN
may specify
+ the types that get_exprN
denotes
+ to. set_exprN
is the expression that
+ is invoked to set the N th element of an instance of
+ type_name
. This expression
+ may access variables named obj
+ of type type_name &
,
+ which represent the corresponding instance of type_name
,
+ and val
of an arbitrary const-qualified
+ reference template type parameter Val
,
+ which represents the right operand of the assignment expression.
+
+
+ The actual return type of fusion's intrinsic sequence access (meta-)functions
+ when in invoked with (an instance of) type_name
+ is a proxy type. This type is implicitly convertible to the attribute type
+ via get_exprN
and forwards assignment
+ to the underlying element via set_exprN
.
+ The value type (that is the type returned by result_of :: value_of
, result_of :: value_at
and result_of :: value_at_c
) of the N th
+ element is attribute_typeN
with const-qualifier
+ and reference removed.
+
+
+
#include < boost / fusion / adapted / adt / adapt_adt . hpp >
+#include < boost / fusion / include / adapt_adt . hpp >
+
+
+
namespace demo
+{
+ struct employee
+ {
+ private :
+ std :: string name ;
+ int age ;
+
+ public :
+ void set_name ( std :: string const & n )
+ {
+ name = n ;
+ }
+
+ void set_age ( int a )
+ {
+ age = a ;
+ }
+
+ std :: string const & get_name () const
+ {
+ return name ;
+ }
+
+ int get_age () const
+ {
+ return age ;
+ }
+ };
+}
+
+BOOST_FUSION_ADAPT_ADT (
+ demo :: employee ,
+ ( std :: string const &, std :: string const &, obj . get_name (), obj . set_name ( val ))
+ ( int , int , obj . get_age (), obj . set_age ( val )))
+
+demo :: employee e ;
+front ( e )= "Edward Norton" ;
+back ( e )= 41 ;
+std :: cout << e . get_name () << " is " << e . get_age () << "years old" << std :: endl ;
+
+
+
+ adt_attribute_proxy
+
+
+
+
+
+
+
diff --git a/doc/html/fusion/adapted/adapt_assoc.html b/doc/html/fusion/adapted/adapt_assoc.html
index 015f20d0..7ca4c6b6 100644
--- a/doc/html/fusion/adapted/adapt_assoc.html
+++ b/doc/html/fusion/adapted/adapt_assoc.html
@@ -27,7 +27,7 @@
BOOST_FUSION_ADAPT_ASSOC_STRUCT
@@ -37,7 +37,7 @@
Sequence.
BOOST_FUSION_ADAPT_ASSOC_STRUCT (
@@ -48,7 +48,7 @@
)
@@ -66,14 +66,14 @@
should be the fully namespace qualified name of the struct to be adapted.
#include < boost / fusion / adapted / struct / adapt_assoc_struct . hpp >
#include < boost / fusion / include / adapt_assoc_struct . hpp >
namespace demo
diff --git a/doc/html/fusion/adapted/adapt_assoc_struct_named.html b/doc/html/fusion/adapted/adapt_assoc_struct_named.html
index 823db0a6..610c18a6 100644
--- a/doc/html/fusion/adapted/adapt_assoc_struct_named.html
+++ b/doc/html/fusion/adapted/adapt_assoc_struct_named.html
@@ -7,7 +7,7 @@
-
+
@@ -38,7 +38,7 @@
Sequence. The given struct is adapted using the given name.
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED (
@@ -58,7 +58,7 @@
)
@@ -83,14 +83,14 @@
should be the fully namespace qualified name of the struct to be converted.
#include < boost / fusion / adapted / struct / adapt_assoc_struct_named . hpp >
#include < boost / fusion / include / adapt_assoc_struct_named . hpp >
namespace demo
@@ -127,7 +127,7 @@