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)
6
// See http://www.boost.org/libs/test for the library home page.
10
// Version : $Revision: 54633 $
12
// Description : generic custom parameter generator
13
// ***************************************************************************
15
#ifndef BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER
16
#define BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER
18
// Boost.Runtime.Parameter
19
#include <boost/test/utils/runtime/config.hpp>
21
#include <boost/test/utils/runtime/cla/typed_parameter.hpp>
24
#include <boost/test/utils/rtti.hpp>
27
#include <boost/utility/base_from_member.hpp>
31
namespace BOOST_RT_PARAM_NAMESPACE {
35
// ************************************************************************** //
36
// ************** runtime::cla::basic_parameter ************** //
37
// ************************************************************************** //
39
template<typename T, typename IdPolicy>
40
class basic_parameter : private base_from_member<IdPolicy>, public typed_parameter<T> {
43
explicit basic_parameter( cstring n )
44
: base_from_member<IdPolicy>()
45
, typed_parameter<T>( base_from_member<IdPolicy>::member )
47
this->accept_modifier( name = n );
50
// parameter properties modification
51
template<typename Modifier>
52
void accept_modifier( Modifier const& m )
54
typed_parameter<T>::accept_modifier( m );
56
base_from_member<IdPolicy>::member.accept_modifier( m );
60
//____________________________________________________________________________//
62
#define BOOST_RT_CLA_NAMED_PARAM_GENERATORS( param_type ) \
63
template<typename T> \
64
inline shared_ptr<param_type ## _t<T> > \
65
param_type( cstring name = cstring() ) \
67
return shared_ptr<param_type ## _t<T> >( new param_type ## _t<T>( name ) ); \
70
inline shared_ptr<param_type ## _t<cstring> > \
71
param_type( cstring name = cstring() ) \
73
return shared_ptr<param_type ## _t<cstring> >( new param_type ## _t<cstring>( name ) ); \
77
//____________________________________________________________________________//
81
} // namespace BOOST_RT_PARAM_NAMESPACE
85
#endif // BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER