x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
id_policy.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\test\utils\runtime\cla\id_policy.hpp
旋转
特效
属性
历史版本
// (C) Copyright Gennadiy Rozental 2005-2007. // Use, modification, and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile$ // // Version : $Revision: 43798 $ // // Description : some generic identification policies definition // *************************************************************************** #ifndef BOOST_RT_CLA_ID_POLICY_HPP_062604GER #define BOOST_RT_CLA_ID_POLICY_HPP_062604GER // Boost.Runtime.Parameter #include
#include
#include
#include
#include
// Boost.Test #include
#include
namespace boost { namespace BOOST_RT_PARAM_NAMESPACE { namespace cla { // ************************************************************************** // // ************** naming_policy_base ************** // // ************************************************************************** // // model:
class basic_naming_policy : public identification_policy { public: // Policy interface virtual bool responds_to( cstring name ) const { return m_name == name; } virtual cstring id_2_report() const { return m_name; } virtual void usage_info( format_stream& fs ) const; virtual bool matching( parameter const& p, argv_traverser& tr, bool primary ) const; // Accept modifer template
void accept_modifier( Modifier const& m ) { nfp::optionally_assign( m_prefix, m, prefix ); nfp::optionally_assign( m_name, m, name ); nfp::optionally_assign( m_separator, m, separator ); } protected: explicit basic_naming_policy( rtti::id_t const& dyn_type ) : identification_policy( dyn_type ) {} BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~basic_naming_policy() {} // Naming policy interface virtual bool match_prefix( argv_traverser& tr ) const; virtual bool match_name( argv_traverser& tr ) const; virtual bool match_separator( argv_traverser& tr ) const; // Data members dstring m_prefix; dstring m_name; dstring m_separator; }; // ************************************************************************** // // ************** dual_id_policy ************** // // ************************************************************************** // template
class dual_id_policy : public identification_policy { public: // Constructor dual_id_policy() : identification_policy( rtti::type_id
() ) , m_primary() , m_secondary() {} // Policy interface virtual bool responds_to( cstring name ) const { return m_primary.responds_to( name ) || m_secondary.responds_to( name ); } virtual bool conflict_with( identification_policy const& id_p ) const { return m_primary.conflict_with( id_p ) || m_secondary.conflict_with( id_p ); } virtual cstring id_2_report() const { return m_primary.id_2_report(); } virtual void usage_info( format_stream& fs ) const { fs << BOOST_RT_PARAM_LITERAL( '{' ); m_primary.usage_info( fs ); fs << BOOST_RT_PARAM_LITERAL( '|' ); m_secondary.usage_info( fs ); fs << BOOST_RT_PARAM_LITERAL( '}' ); } virtual bool matching( parameter const& p, argv_traverser& tr, bool primary ) const { return m_primary.matching( p, tr, primary ) || m_secondary.matching( p, tr, primary ); } protected: BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~dual_id_policy() {} // Data members PrimaryId m_primary; SecondId m_secondary; }; } // namespace cla } // namespace BOOST_RT_PARAM_NAMESPACE } // namespace boost #ifndef BOOST_RT_PARAM_OFFLINE # define BOOST_RT_PARAM_INLINE inline # include
#endif #endif // BOOST_RT_CLA_ID_POLICY_HPP_062604GER
id_policy.hpp
网页地址
文件地址
上一页
14/30
下一页
下载
( 4 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.