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 #ifndef OLN_MORPHO_ENVIRONMENTS_HH
00029 # define OLN_MORPHO_ENVIRONMENTS_HH
00030 # include <oln/basics.hh>
00031 # include <mlc/type.hh>
00032
00033 namespace oln
00034 {
00035 namespace morpho
00036 {
00039 namespace env
00040 {
00043 namespace abstract
00044 {
00048 template <class Exact>
00049 struct env: public mlc_hierarchy::any<Exact>
00050 {
00051 };
00052 }
00053
00059 struct NullEnv: public abstract::env<NullEnv>
00060 {
00061 };
00062
00068 template <class I>
00069 struct OtherImageEnv: public abstract::env<OtherImageEnv<I> >
00070 {
00071 typedef oln::abstract::image<I> im_type;
00072
00073 OtherImageEnv(const oln::abstract::image<I> &im): im_(im)
00074 {};
00075
00076 const im_type &getImage() const
00077 {
00078 return im_;
00079 }
00080
00081 protected:
00082 const im_type &im_;
00083 };
00084
00090 template <class I>
00091 struct ParentEnv: public abstract::env<ParentEnv<I> >
00092 {
00093 typedef oln::abstract::image<I> im_type;
00094
00095 ParentEnv(const oln::abstract::image<I> &im): im_(im)
00096 {};
00097
00098 const im_type &getParent() const
00099 {
00100 return im_;
00101 }
00102
00103 protected:
00104 const im_type &im_;
00105 };
00106
00107 }
00108 }
00109 }
00110 #endif // !OLN_MORPHO_ENVIRONMENTS_HH