00001
00002
00003
00004
00005
00006 #ifndef SAGA_SAGA_DETAIL_PERMISSIONS_IMPL_HPP
00007 #define SAGA_SAGA_DETAIL_PERMISSIONS_IMPL_HPP
00008
00009 #include <saga/saga/detail/permissions.hpp>
00010 #include <saga/saga/detail/dispatch_priv.hpp>
00011
00013 namespace saga { namespace detail
00014 {
00015 template <typename Derived>
00016 inline impl::permissions_interface*
00017 permissions<Derived>::get_perm (void)
00018 {
00019 return derived().get_impl()->get_permissions();
00020 }
00021
00022 template <typename Derived>
00023 inline impl::permissions_interface*
00024 permissions<Derived>::get_perm (void) const
00025 {
00026 return derived().get_impl()->get_permissions();
00027 }
00028
00031
00032 struct permissions_allow_priv
00033 {
00034 template <typename Derived>
00035 static saga::task
00036 call (Derived& this_, std::string id, int p, bool sync)
00037 {
00038 return this_.get_perm()->permissions_allow(id, p, sync);
00039 }
00040 };
00041
00042 template <typename Derived, typename Tag>
00043 inline saga::task
00044 permissions_priv<Derived, Tag>::permissions_allow (Derived const& this_,
00045 std::string id, int p)
00046 {
00047 return dispatch_priv<Tag>::
00048 template call<permissions_allow_priv>(this_, id, p);
00049 }
00050
00052 struct permissions_deny_priv
00053 {
00054 template <typename Derived>
00055 static saga::task
00056 call (Derived& this_, std::string id, int p, bool sync)
00057 {
00058 return this_.get_perm()->permissions_deny(id, p, sync);
00059 }
00060 };
00061
00062 template <typename Derived, typename Tag>
00063 inline saga::task
00064 permissions_priv<Derived, Tag>::permissions_deny (Derived const& this_,
00065 std::string id, int p)
00066 {
00067 return dispatch_priv<Tag>::
00068 template call<permissions_deny_priv>(this_, id, p);
00069 }
00070
00072 struct permissions_check_priv
00073 {
00074 template <typename Derived>
00075 static saga::task
00076 call (Derived& this_, std::string id, int p, bool sync)
00077 {
00078 return this_.get_perm()->permissions_check(id, p, sync);
00079 }
00080 };
00081
00082 template <typename Derived, typename Tag>
00083 inline saga::task
00084 permissions_priv<Derived, Tag>::permissions_check (Derived const& this_,
00085 std::string id, int p)
00086 {
00087 return dispatch_priv<Tag>::
00088 template call<permissions_check_priv>(this_, id, p);
00089 }
00090
00092 struct get_owner_priv
00093 {
00094 template <typename Derived>
00095 static saga::task
00096 call (Derived& this_, bool sync)
00097 {
00098 return this_.get_perm()->get_owner(sync);
00099 }
00100 };
00101
00102 template <typename Derived, typename Tag>
00103 inline saga::task
00104 permissions_priv<Derived, Tag>::get_owner (Derived const& this_)
00105 {
00106 return dispatch_priv<Tag>::template call<get_owner_priv>(this_);
00107 }
00108
00110 struct get_group_priv
00111 {
00112 template <typename Derived>
00113 static saga::task
00114 call (Derived& this_, bool sync)
00115 {
00116 return this_.get_perm()->get_group(sync);
00117 }
00118 };
00119
00120 template <typename Derived, typename Tag>
00121 inline saga::task
00122 permissions_priv<Derived, Tag>::get_group (Derived const& this_)
00123 {
00124 return dispatch_priv<Tag>::template call<get_group_priv>(this_);
00125 }
00127
00129 }}
00130
00131 #endif
00132
00133