YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
Configuration.h
浏览该文件的文档.
1 /*
2  © 2012-2014 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 #include YFM_YSLib_Service_TextFile
34 
35 namespace NPL
36 {
37 
39 
40 using YSLib::File;
41 using YSLib::TextFile;
43 
44 
50 {
51 private:
53 
54 public:
58  : root(static_cast<const ValueNode&>(node))
59  {}
61 
62  Configuration(const ValueNode& node)
63  : root(node)
64  {}
66  : root(std::move(node))
67  {}
69  : Configuration(static_cast<const Configuration&>(conf))
70  {}
72  template<typename... _tParams>
73  Configuration(_tParams&&... args)
74  : root(0, yforward(args)...)
75  {}
78 
81 
82  DefGetter(const ynothrow, const ValueNode&, Root, root)
83 
88  YF_API friend TextFile&
89  operator>>(TextFile&, Configuration&);
90 
92  DefGetter(const ynothrow, const ValueNode&, Node, root)
97  DefGetter(ynothrow, ValueNode&&, NodeRRef, std::move(root))
98 };
99 
105 YF_API File&
106 operator<<(File&, const Configuration&);
107 
108 } // namespace NPL;
109 
110 #endif
111 
设置:使用 S 表达式存储外部状态。
Definition: Configuration.h:49
Configuration(const ValueNode &node)
Definition: Configuration.h:62
Configuration(_tParams &&...args)
Definition: Configuration.h:73
yconstfn const string _tParams && args
Definition: Loader.h:111
#define DefDeCopyCtor(_t)
Definition: YBaseMacro.h:136
文本文件类。
Definition: TextFile.h:56
#define YF_API
Definition: Platform.h:64
文件基类。
Definition: File.h:43
#define yforward(_expr)
根据参数类型使用 std::forward 传递对应参数。
Definition: ydef.h:722
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:180
Configuration(ValueNode &&node)
Definition: Configuration.h:65
NPL 元标签。
Definition: NPL.h:45
#define DefDeMoveCtor(_t)
Definition: YBaseMacro.h:141
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
值类型节点。
Definition: ValueNode.h:45
#define DefDeMoveAssignment(_t)
Definition: YBaseMacro.h:159
DefDeCtor(Configuration) Configuration(ValueNode &node)
Definition: Configuration.h:55
Configuration(Configuration &conf)
Definition: Configuration.h:68
#define DefDeCopyAssignment(_t)
Definition: YBaseMacro.h:154