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 #ifndef OLN_MORPHO_ABSTRACT_ATTRIBUTE_HH
00030 # define OLN_MORPHO_ABSTRACT_ATTRIBUTE_HH
00031 # include <oln/morpho/environments.hh>
00032
00033
00034 # define attr_lambda_type(T) typename oln::morpho::attr::attr_traits< T >::lambda_type
00035 # define attr_env_type(T) typename oln::morpho::attr::attr_traits< T >::env_type
00036 # define attr_value_type(T) typename oln::morpho::attr::attr_traits< T >::value_type
00037
00038 # define attr_lambda_type_(T) oln::morpho::attr::attr_traits< T >::lambda_type
00039 # define attr_env_type_(T) oln::morpho::attr::attr_traits< T >::env_type
00040 # define attr_value_type_(T) oln::morpho::attr::attr_traits< T >::value_type
00041
00042
00043 # define attr_type_decl(self_type) \
00044 typedef mlc_exact_vt_type(self_type, Exact) exact_type; \
00045 typedef attr_value_type(exact_type) value_type; \
00046 typedef attr_env_type(exact_type) env_type; \
00047 typedef attr_lambda_type(exact_type) lambda_type
00048
00049 namespace oln
00050 {
00051 namespace morpho
00052 {
00053 namespace attr
00054 {
00055
00060 template <class T>
00061 struct attr_traits;
00062
00063
00064 namespace abstract
00065 {
00066
00067
00068
00074 template <class Exact>
00075 class attribute: public mlc_hierarchy::any<Exact>
00076 {
00077 public:
00078 typedef attribute<Exact> self_type;
00079 attr_type_decl(self_type);
00080
00087 void operator+=(const exact_type &rhs);
00088
00094 bool operator>=(const lambda_type &lambda) const;
00095
00102 bool operator<(const lambda_type &lambda) const;
00103
00110 bool operator<(const exact_type &x) const;
00111
00118 bool operator!=(const lambda_type &lambda) const;
00119
00125 const lambda_type &toLambda() const;
00126
00134 bool ge_impl(const lambda_type &lambda) const;
00135
00143 bool less2_impl(const exact_type &x) const;
00144
00145 protected:
00146 attribute();
00147 };
00148 }
00149 }
00150 }
00151 }
00152
00153 # include <oln/morpho/abstract/attribute.hxx>
00154
00155 #endif // !OLN_MORPHO_ABSTRACT_ATTRIBUTE_HH