source: NonGTP/Boost/boost/test/utils/runtime/cla/typed_parameter.hpp @ 857

Revision 857, 2.4 KB checked in by igarcia, 18 years ago (diff)
Line 
1//  (C) Copyright Gennadiy Rozental 2005.
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
6//  See http://www.boost.org/libs/test for the library home page.
7//
8//  File        : $RCSfile: typed_parameter.hpp,v $
9//
10//  Version     : $Revision: 1.1 $
11//
12//  Description : generic typed parameter model
13// ***************************************************************************
14
15#ifndef BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER
16#define BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER
17
18// Boost.Runtime.Parameter
19#include <boost/test/utils/runtime/config.hpp>
20
21#include <boost/test/utils/runtime/fwd.hpp>
22#include <boost/test/utils/runtime/validation.hpp>
23
24#include <boost/test/utils/runtime/cla/parameter.hpp>
25#include <boost/test/utils/runtime/cla/argument_factory.hpp>
26
27// Boost.Test
28#include <boost/test/utils/rtti.hpp>
29
30namespace boost {
31
32namespace BOOST_RT_PARAM_NAMESPACE {
33
34namespace cla {
35
36// ************************************************************************** //
37// **************         runtime::cla::typed_parameter        ************** //
38// ************************************************************************** //
39
40template<typename T>
41class typed_parameter : public cla::parameter {
42public:
43    explicit typed_parameter( identification_policy& ID ) : cla::parameter( ID, m_arg_factory ) {}
44
45    // parameter properties modification
46    template<typename Modifier>
47    void    accept_modifier( Modifier const& m )
48    {
49        cla::parameter::accept_modifier( m );
50
51        m_arg_factory.accept_modifier( m );
52
53        BOOST_RT_PARAM_VALIDATE_LOGIC( !p_optional || !m_arg_factory.m_value_generator,
54            BOOST_RT_PARAM_LITERAL( "couldn't define a value generator for optional parameter " ) << id_2_report() );
55    }
56
57private:
58    // Data members
59    typed_argument_factory<T>   m_arg_factory;
60};
61
62} // namespace cla
63
64} // namespace BOOST_RT_PARAM_NAMESPACE
65
66} // namespace boost
67
68// ************************************************************************** //
69//   Revision History:
70//
71//   $Log: typed_parameter.hpp,v $
72//   Revision 1.1  2005/04/12 06:42:43  rogeeff
73//   Runtime.Param library initial commit
74//
75// ************************************************************************** //
76
77#endif // BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER
Note: See TracBrowser for help on using the repository browser.