blob: 06a0d0d9a862375fc843d42d0f69d40cd4467cef [file] [log] [blame]
Jeff Thompsonef2d5a42013-08-22 19:09:24 -07001// (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
6// See http://www.boost.org/libs/test for the library home page.
7//
8// File : $RCSfile$
9//
10// Version : $Revision: 57992 $
11//
12// Description : defines interface for identification_policy
13// ***************************************************************************
14
Jeff Thompson3d613fd2013-10-15 15:39:04 -070015#ifndef NDNBOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER
16#define NDNBOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070017
18// Boost.Runtime.Parameter
19#include <ndnboost/test/utils/runtime/config.hpp>
20
21#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
22
23// Boost.Test
24#include <ndnboost/test/utils/class_properties.hpp>
25#include <ndnboost/test/utils/rtti.hpp>
26
27namespace ndnboost {
28
Jeff Thompson3d613fd2013-10-15 15:39:04 -070029namespace NDNBOOST_RT_PARAM_NAMESPACE {
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070030
31namespace cla {
32
33// ************************************************************************** //
34// ************** identification_policy ************** //
35// ************************************************************************** //
36
Jeff Thompson3d613fd2013-10-15 15:39:04 -070037#ifdef NDNBOOST_MSVC
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070038# pragma warning(push)
39# pragma warning(disable:4244)
40#endif
41
42class identification_policy {
43public:
44 // Public properties
45 unit_test::readwrite_property<rtti::id_t> p_type_id;
46
47 // Policy interface
48 virtual bool responds_to( cstring name ) const = 0;
49 virtual cstring id_2_report() const = 0;
50 virtual void usage_info( format_stream& fs ) const = 0;
51 virtual bool matching( parameter const& p, argv_traverser& tr, bool primary ) const = 0;
52
53 virtual bool conflict_with( identification_policy const& ) const = 0;
54
55protected:
56 // Constructor
57 explicit identification_policy( rtti::id_t dyn_type )
58 : p_type_id( dyn_type )
59 {}
Jeff Thompson3d613fd2013-10-15 15:39:04 -070060 NDNBOOST_TEST_PROTECTED_VIRTUAL ~identification_policy() {}
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070061};
62
Jeff Thompson3d613fd2013-10-15 15:39:04 -070063#ifdef NDNBOOST_MSVC
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070064# pragma warning(pop)
65#endif
66
67} // namespace cla
68
Jeff Thompson3d613fd2013-10-15 15:39:04 -070069} // namespace NDNBOOST_RT_PARAM_NAMESPACE
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070070
71} // namespace ndnboost
72
Jeff Thompson3d613fd2013-10-15 15:39:04 -070073#endif // NDNBOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER