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 
00050 #ifndef STLSOFT_INCL_STLSOFT_UTIL_HPP_ARGUMENT_PROXIES
00051 #define STLSOFT_INCL_STLSOFT_UTIL_HPP_ARGUMENT_PROXIES
00052 
00053 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00054 # define STLSOFT_VER_STLSOFT_UTIL_HPP_ARGUMENT_PROXIES_MAJOR     4
00055 # define STLSOFT_VER_STLSOFT_UTIL_HPP_ARGUMENT_PROXIES_MINOR     0
00056 # define STLSOFT_VER_STLSOFT_UTIL_HPP_ARGUMENT_PROXIES_REVISION  3
00057 # define STLSOFT_VER_STLSOFT_UTIL_HPP_ARGUMENT_PROXIES_EDIT      131
00058 #endif 
00059 
00060 
00061 
00062 
00063 
00064 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00065 # include <stlsoft/stlsoft.h>
00066 #endif 
00067 
00068 
00069 
00070 
00071 
00072 #ifndef _STLSOFT_NO_NAMESPACE
00073 namespace stlsoft
00074 {
00075 #endif 
00076 
00077 
00078 
00079 
00080 
00086 
00087 template <ss_typename_param_k A>
00088 class pointer_proxy
00089 {
00090 public:
00091     typedef A                   argument_type;
00092     typedef argument_type*      argument_pointer_type;
00093     typedef pointer_proxy<A>    class_type;
00094 
00095 
00096 public:
00097     ss_explicit_k pointer_proxy(argument_pointer_type a)
00098         : m_a(a)
00099     {}
00100     pointer_proxy(class_type const& rhs)
00101         : m_a(rhs.m_a)
00102     {}
00103 
00104 
00105 public:
00106     operator argument_pointer_type() const
00107     {
00108         return m_a;
00109     }
00110 
00111 
00112 private:
00113     argument_pointer_type   m_a;
00114 
00115 
00116 private:
00117     class_type const& operator =(class_type const&);
00118 };
00119 
00125 
00126 template <ss_typename_param_k A>
00127 class const_pointer_proxy
00128 {
00129 public:
00130     typedef A                       argument_type;
00131     typedef argument_type const*    argument_pointer_type;
00132     typedef const_pointer_proxy<A>  class_type;
00133 
00134 
00135 public:
00136     ss_explicit_k const_pointer_proxy(argument_pointer_type a)
00137         : m_a(a)
00138     {}
00139     const_pointer_proxy(class_type const& rhs)
00140         : m_a(rhs.m_a)
00141     {}
00142 
00143 
00144 public:
00145     operator argument_pointer_type() const
00146     {
00147         return m_a;
00148     }
00149 
00150 
00151 private:
00152     argument_pointer_type   m_a;
00153 
00154 
00155 private:
00156     class_type const& operator =(class_type const&);
00157 };
00158 
00159 
00165 
00166 template <ss_typename_param_k A>
00167 class reference_proxy
00168 {
00169 public:
00170     typedef A                   argument_type;
00171     typedef argument_type&      argument_reference_type;
00172     typedef reference_proxy<A>  class_type;
00173 
00174 
00175 public:
00176     ss_explicit_k reference_proxy(argument_reference_type a)
00177         : m_a(a)
00178     {}
00179     reference_proxy(class_type const& rhs)
00180         : m_a(rhs.m_a)
00181     {}
00182 
00183 
00184 public:
00185     operator argument_reference_type() const
00186     {
00187         return m_a;
00188     }
00189 
00190 
00191 private:
00192     argument_reference_type m_a;
00193 
00194 
00195 private:
00196     class_type const& operator =(class_type const&);
00197 };
00198 
00199 
00205 
00206 template <ss_typename_param_k A>
00207 class const_reference_proxy
00208 {
00209 public:
00210     typedef A                           argument_type;
00211     typedef argument_type const&        argument_reference_type;
00212     typedef const_reference_proxy<A>    class_type;
00213 
00214 
00215 public:
00216     ss_explicit_k const_reference_proxy(argument_reference_type a)
00217         : m_a(a)
00218     {}
00219     const_reference_proxy(class_type const& rhs)
00220         : m_a(rhs.m_a)
00221     {}
00222 
00223 
00224 public:
00225     operator argument_reference_type() const
00226     {
00227         return m_a;
00228     }
00229 
00230 
00231 private:
00232     argument_reference_type m_a;
00233 
00234 
00235 private:
00236     class_type const& operator =(class_type const&);
00237 };
00238 
00239 
00245 
00246 template <ss_typename_param_k A>
00247 class value_proxy
00248 {
00249 public:
00250     typedef A               argument_type;
00251     typedef value_proxy<A>  class_type;
00252 
00253 
00254 public:
00255     ss_explicit_k value_proxy(argument_type a)
00256         : m_a(a)
00257     {}
00258     value_proxy(class_type const& rhs)
00259         : m_a(rhs.m_a)
00260     {}
00261 
00262 
00263 public:
00264     operator argument_type() const
00265     {
00266         return m_a;
00267     }
00268 
00269 
00270 private:
00271     argument_type   m_a;
00272 
00273 
00274 private:
00275     class_type const& operator =(class_type const&);
00276 };
00277 
00278 
00279 
00280 
00281 
00287 template <ss_typename_param_k A>
00288 inline pointer_proxy<A> ptr_proxy(A* a)
00289 {
00290     return pointer_proxy<A>(a);
00291 }
00292 
00298 template <ss_typename_param_k A>
00299 inline const_pointer_proxy<A> const_ptr_proxy(A const* a)
00300 {
00301     return const_pointer_proxy<A>(a);
00302 }
00303 
00309 template <ss_typename_param_k A>
00310 inline reference_proxy<A> ref_proxy(A& a)
00311 {
00312     return reference_proxy<A>(a);
00313 }
00314 
00320 template <ss_typename_param_k A>
00321 inline const_reference_proxy<A> const_ref_proxy(A& a)
00322 {
00323     return const_reference_proxy<A>(a);
00324 }
00325 
00331 template <ss_typename_param_k A>
00332 inline value_proxy<A> val_proxy(A a)
00333 {
00334     return value_proxy<A>(a);
00335 }
00336 
00338 
00339 
00340 #ifdef STLSOFT_UNITTEST
00341 # include "./unittest/argument_proxies_unittest_.h"
00342 #endif 
00343 
00344 
00345 
00346 #ifndef _STLSOFT_NO_NAMESPACE
00347 } 
00348 #endif 
00349 
00350 
00351 
00352 #endif 
00353 
00354