YSTest: Configuration.h 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

NPL/Configuration.h
浏览该文件的文档.
1 /*
2 © 2012-2016 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef NPL_INC_Configuration_h_
29 #define NPL_INC_Configuration_h_
30
31 #include "YModules.h"
32 #include YFM_NPL_NPLA1
33
34 namespace NPL
35 {
36
42 class YF_API Configuration
43 {
44 private:
45 ValueNode root;
46
47 public:
48 DefDeCtor(Configuration)
50
51 Configuration(const ValueNode& node)
52 : root(node)
53 {}
54 Configuration(ValueNode&& node)
55 : root(std::move(node))
56 {}
58
60 template<typename _tParam,
61 yimpl(typename = ystdex::exclude_self_t<Configuration, _tParam>)>
62 yconstfn
63 Configuration(_tParam&& arg)
64 : root(0, yforward(arg))
65 {}
66 template<typename _tParam1, typename _tParam2, typename... _tParams>
67 Configuration(_tParam1&& arg1, _tParam2&& arg2, _tParams&&... args)
68 : root(0, yforward(arg1), yforward(arg2), yforward(args)...)
69 {}
71 DefDeCopyMoveCtorAssignment(Configuration)
72
73 DefGetter(const ynothrow, const ValueNode&, Root, root)
74
81 YF_API friend std::istream&
82 operator>>(std::istream&, Configuration&);
83
85 DefGetter(const ynothrow, const ValueNode&, Node, root)
90 DefGetter(ynothrow, ValueNode&&, NodeRRef, std::move(root))
91 };
92
98 YF_API std::ostream&
99 operator<<(std::ostream&, const Configuration&);
100
101 } // namespace NPL;
102
103 #endif
104
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:740
NPL::Configuration::Configuration
Configuration(ValueNode &&node)
Definition: NPL/Configuration.h:54
NPL::Configuration::root
ValueNode root
Definition: NPL/Configuration.h:45
DefDeCopyMoveCtorAssignment
#define DefDeCopyMoveCtorAssignment(_t)
Definition: YBaseMacro.h:201
NPL::Configuration::Configuration
Configuration(_tParam1 &&arg1, _tParam2 &&arg2, _tParams &&...args)
Definition: NPL/Configuration.h:67
NPL::Configuration::DefDeCtor
DefDeCtor(Configuration) Configuration(const ValueNode &node)
Definition: NPL/Configuration.h:48
ystdex::exclude_self_t
enable_if_t<!is_same< _tClass &, decay_t< _tParam > & >::value, _type > exclude_self_t
移除选择类类型的特定重载避免构造模板和复制/转移特殊成员函数冲突。
Definition: type_traits.hpp:708
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:240
yimpl
#define yimpl(...)
实现标签。
Definition: ydef.h:256
std
Definition: memory.hpp:1100
YModules.h
NPL
Definition: NPL/Configuration.h:34
NPL::Configuration::Configuration
yconstfn Configuration(_tParam &&arg)
Definition: NPL/Configuration.h:63
NPL::Configuration
设置：使用 S 表达式存储外部状态。
Definition: NPL/Configuration.h:42
yconstfn
#define yconstfn
指定编译时常量函数。
Definition: ydef.h:654
YSLib::ValueNode
值类型节点。
Definition: ValueNode.h:57
yforward
#define yforward(_expr)
根据参数类型使用 std::forward 传递对应参数。
Definition: ydef.h:969
YF_API
#define YF_API
Definition: Platform.h:56
CHRLib::args
_tParams && args
Definition: CharacterProcessing.h:538