value_handler.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // (C) Copyright Gennadiy Rozental 2005-2008.
  2. // Use, modification, and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/test for the library home page.
  6. //
  7. // File : $RCSfile$
  8. //
  9. // Version : $Revision: 49312 $
  10. //
  11. // Description : specific value handlers
  12. // ***************************************************************************
  13. #ifndef BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER
  14. #define BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER
  15. // Boost.Runtime.Parameter
  16. #include <boost/test/utils/runtime/config.hpp>
  17. #include <boost/test/utils/runtime/cla/fwd.hpp>
  18. namespace boost {
  19. namespace BOOST_RT_PARAM_NAMESPACE {
  20. namespace cla {
  21. namespace rt_cla_detail {
  22. // ************************************************************************** //
  23. // ************** runtime::cla::assigner ************** //
  24. // ************************************************************************** //
  25. template<typename T>
  26. class assigner {
  27. public:
  28. // Constructor
  29. explicit assigner( T& loc ) : m_target( loc ) {}
  30. // value handler implementation
  31. void operator()( parameter const&, T& t ) { m_target = t; }
  32. private:
  33. // Data members
  34. T& m_target;
  35. };
  36. } // namespace rt_cla_detail
  37. } // namespace cla
  38. } // namespace BOOST_RT_PARAM_NAMESPACE
  39. } // namespace boost
  40. #endif // BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER