YSTest: YShellDefinition.h 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

YShellDefinition.h
浏览该文件的文档.
1 /*
2 © 2009-2013, 2015 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 YSL_INC_Core_YShellDefinition_h_
29 #define YSL_INC_Core_YShellDefinition_h_ 1
30
31 #include "YModules.h"
32
33 #include YFM_YSLib_Adaptor_YAdaptor
34
35 namespace YSLib
36 {
37
44 template<typename _type>
45 inline bool
46 reset(_type*& p) ynothrow
47 {
48 bool b(p);
49
50 ydelete(p);
51 p = {};
52 return b;
53 }
55
60 template<typename _type>
61 inline bool
62 operator==(const shared_ptr<_type>& sp, _type* p)
63 {
64 return sp.get() == p;
65 }
71 template<typename _type1, typename _type2>
72 inline bool
73 operator==(const weak_ptr<_type1>& x, const weak_ptr<_type2>& y)
74 {
75 return !x.owner_before(y) && !y.owner_before(x);
76 }
77
82 template<typename _type>
83 inline bool
84 operator!=(const shared_ptr<_type>& sp, _type* p)
85 {
86 return sp.get() != p;
87 }
93 template<typename _type1, typename _type2>
94 inline bool
95 operator!=(const weak_ptr<_type1>& x, const weak_ptr<_type2>& y)
96 {
97 return !(x == y);
98 }
99
100
106 template<typename _type, class _tMutex = typename unlock_delete<>::mutex_type,
107 class _tLock = typename unlock_delete<_tMutex>::lock_type>
108 using locked_ptr = unique_ptr<_type, unlock_delete<_tMutex, _tLock>>;
109
110 namespace Shells
111 {
112 class Shell;
113 } // namespace Shells;
114
115 namespace Text
116 {
117 class String;
118 } // namespace Text;
119
120 class Application;
121
122 using Shells::Shell;
123
124 using Text::String;
125
126
127 //平台无关的类型定义。
128 //
129
130
140
141
147
148
156
157
158 } // namespace YSLib;
159
160 #endif
161
x
const EncapsulationBase & x
Definition: NPLA1Forms.cpp:1536
YSLib::operator==
bool operator==(const shared_ptr< _type > &sp, _type *p)
比较： shared_ptr 和内建指针类型的相等关系。
Definition: YShellDefinition.h:62
YSLib::Drawing::sp
dst sp
Definition: YGDI.h:442
YSLib::operator!=
bool operator!=(const shared_ptr< _type > &sp, _type *p)
比较： shared_ptr 左值和内建指针类型的不等关系。
Definition: YShellDefinition.h:84
YSLib::locked_ptr
unique_ptr< _type, unlock_delete< _tMutex, _tLock > > locked_ptr
独占所有权的锁定指针：使用线程模型对应的互斥量和锁以及 unique_ptr 。
Definition: YShellDefinition.h:108
YSLib::Shells::Shell
外壳程序：实现运行期控制流映像语义。
Definition: YShell.h:42
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
ystdex::threading::unlock_delete::lock_type
_tLock lock_type
Definition: pseudo_mutex.h:1049
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:46
YModules.h
YSLib 用户界面模块配置文件。
YSLib::ynothrow
YB_PURE const _type size_t n ynothrow
Definition: YCoreUtilities.h:169
YSLib::reset
bool reset(_type *&p) ynothrow
Definition: YShellDefinition.h:46
platform::p
return p p
Definition: YCLib/FileSystem.h:209
ydelete
#define ydelete
Definition: YNew.h:204