00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 #ifndef XIMOL_XML_BOX_HPP_
00071 #define XIMOL_XML_BOX_HPP_
00072
00073 #include <ximol/xml/stag.hpp>
00074 #include <ximol/xml/etag.hpp>
00075 #include <ximol/parser/utils.hpp>
00076
00077 XIMOL_XML_BEGIN_NAMESPACE
00078
00079
00080
00081
00082 template < typename String1, typename String2, typename Att, typename T >
00083 struct manipulator_box
00084 {
00085 public:
00086 typedef qualified_name<String1,String2> qname_type;
00087 typedef manipulator_stag< qname_type, Att> stag_type;
00088 public:
00089 manipulator_box(const stag_type & stag, T & t):stag_(stag),t_(t){};
00090 manipulator_box(const manipulator_box<String1, String2, Att, T> & x):stag_(x.stag_),t_(x.t_){};
00091
00092 stag_type stag_;
00093 T & t_;
00094 private:
00095 manipulator_box<String1, String2, Att, T> & operator=(const manipulator_box<String1, String2, Att, T> & x);
00096 };
00097
00098
00099
00100
00101 template < typename String1, typename String2, typename Att, typename T >
00102 xostream& operator<<(xostream& xos, const manipulator_box<String1, String2, Att, T>& m)
00103 {
00104 return xos << m.stag_ << m.t_ << xml::etag();
00105 };
00106
00107
00108
00109
00110 template < typename String1, typename String2, typename Att, typename T >
00111 xistream& operator>>(xistream& xis, manipulator_box<String1, String2, Att, T>& m)
00112 {
00113 return xis >> m.stag_ >> m.t_ >> xml::etag();
00114 };
00115
00116
00117 #define XIMOL_HEADER_DEFINE_FUNCTION(type1, type2, type3) \
00118 template < typename T > \
00119 manipulator_box < type1, type2, type3, T > \
00120 box( type1 & prefix, type2 & local, type3 & att, T& t) { \
00121 return manipulator_box< type1, type2, type3, T >(stag(prefix,local,att),t); };
00122
00123 #include <ximol/config/define_functions_prefix_local_attributes.hpp>
00124
00125
00126 #define XIMOL_HEADER_DEFINE_FUNCTION(type1, type2) \
00127 template < typename T > \
00128 manipulator_box < type1, type2, xml::attributes, T > \
00129 box( type1 & prefix, type2 & local, T& t) { \
00130 return manipulator_box< type1, type2, xml::attributes, T >(stag(prefix,local),t); };
00131 #include <ximol/config/define_functions_prefix_local.hpp>
00132
00133
00134 #define XIMOL_HEADER_DEFINE_FUNCTION(type1, type3) \
00135 template < typename T > \
00136 manipulator_box < type1, type1, type3, T > \
00137 box( type1 & local, type3 & att, T& t) { \
00138 return manipulator_box< type1, type1, type3, T >(stag(local,att),t); };
00139 #include <ximol/config/define_functions_local_attributes.hpp>
00140
00141
00142 #define XIMOL_HEADER_DEFINE_FUNCTION(type1) \
00143 template < typename T > \
00144 manipulator_box < type1, type1, xml::attributes, T > \
00145 box( type1 & local, T& t) { \
00146 return manipulator_box< type1, type1, xml::attributes, T >(stag(local),t); };
00147 #include <ximol/config/define_functions_local.hpp>
00148
00149
00150 #define XIMOL_HEADER_DEFINE_FUNCTION(type1, type2, type3) \
00151 template < typename T > \
00152 manipulator_box < type1, type2, type3, T > \
00153 rebox( type1 & prefix, type2 & local, type3 & att, T& t) { \
00154 return manipulator_box< type1, type2, type3, T >(open_stag(prefix,local,att),t); };
00155
00156 #include <ximol/config/define_functions_prefix_local_attributes.hpp>
00157
00158
00159 #define XIMOL_HEADER_DEFINE_FUNCTION(type1, type2) \
00160 template < typename T > \
00161 manipulator_box < type1, type2, xml::attributes, T > \
00162 rebox( type1 & prefix, type2 & local, T& t) { \
00163 return manipulator_box< type1, type2, xml::attributes, T >(open_stag(prefix,local),t); };
00164 #include <ximol/config/define_functions_prefix_local.hpp>
00165
00166
00167 #define XIMOL_HEADER_DEFINE_FUNCTION(type1, type3) \
00168 template < typename T > \
00169 manipulator_box < type1, type1, type3, T > \
00170 rebox( type1 & local, type3 & att, T& t) { \
00171 return manipulator_box< type1, type1, type3, T >(open_stag(local,att),t); };
00172 #include <ximol/config/define_functions_local_attributes.hpp>
00173
00174
00175 #define XIMOL_HEADER_DEFINE_FUNCTION(type1) \
00176 template < typename T > \
00177 manipulator_box < type1, type1, xml::attributes, T > \
00178 rebox( type1 & local, T& t) { \
00179 return manipulator_box< type1, type1, xml::attributes, T >(open_stag(local),t); };
00180 #include <ximol/config/define_functions_local.hpp>
00181
00182 XIMOL_XML_END_NAMESPACE
00183
00184 #endif // #ifndef XIMOL_XML_BOX_HPP_