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 #ifndef MLN_CORE_INTERNAL_SITE_SET_BASE_HH
00027 # define MLN_CORE_INTERNAL_SITE_SET_BASE_HH
00028 
00033 
00034 # include <mln/core/concept/site_set.hh>
00035 # include <mln/core/concept/site_proxy.hh>
00036 
00037 
00038 namespace mln
00039 {
00040 
00041   namespace internal
00042   {
00043 
00044 
00051     template <typename P, typename E>
00052     struct site_set_base_ : public Site_Set<E>
00053     {
00055       typedef typename subject<P>::ret site;
00056 
00060       bool is_empty() const;
00061 
00062     protected:
00063       site_set_base_();
00064 
00065     private:
00066       
00067       
00068       
00069       bool is_empty_() const;
00070     };
00071 
00072 
00073 # ifndef MLN_INCLUDE_ONLY
00074 
00075     template <typename P, typename E>
00076     inline
00077     site_set_base_<P,E>::site_set_base_()
00078     {
00079     }
00080 
00081     template <typename P, typename E>
00082     inline
00083     bool
00084     site_set_base_<P,E>::is_empty() const
00085     {
00086       return exact(this)->is_empty_();
00087     }
00088 
00089     template <typename P, typename E>
00090     inline
00091     bool
00092     site_set_base_<P,E>::is_empty_() const
00093     {
00094       mlc_is(mln_trait_site_set_nsites(E),
00095              trait::site_set::nsites::known)::check();
00096       return exact(this)->nsites() == 0;
00097     }
00098 
00099 # endif // ! MLN_INCLUDE_ONLY
00100 
00101   } 
00102 
00103 } 
00104 
00105 
00106 #endif // ! MLN_CORE_INTERNAL_SITE_SET_BASE_HH