File tree Expand file tree Collapse file tree 14 files changed +49
-22
lines changed Expand file tree Collapse file tree 14 files changed +49
-22
lines changed Original file line number Diff line number Diff line change 180
180
<ClInclude Include =" ..\xrCommon\xr_list.h" />
181
181
<ClInclude Include =" ..\xrCommon\xr_map.h" />
182
182
<ClInclude Include =" ..\xrCommon\xr_set.h" />
183
+ <ClInclude Include =" ..\xrCommon\xr_smart_pointers.h" />
183
184
<ClInclude Include =" ..\xrCommon\xr_stack.h" />
184
185
<ClInclude Include =" ..\xrCommon\xr_string.h" />
185
186
<ClInclude Include =" ..\xrCommon\xr_unordered_map.h" />
Original file line number Diff line number Diff line change 85
85
<ClInclude Include =" ..\xrCommon\xr_array.h" >
86
86
<Filter >xrCommon</Filter >
87
87
</ClInclude >
88
+ <ClInclude Include =" ..\xrCommon\xr_smart_pointers.h" >
89
+ <Filter >xrCommon</Filter >
90
+ </ClInclude >
88
91
</ItemGroup >
89
92
<ItemGroup >
90
93
<Filter Include =" NvMender2003" >
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ typedef TMsgDlgBtn TMsgDlgButtons[mbHelp];
108
108
#include " xrCore/xr_token.h"
109
109
#include " xrCommon/xr_vector.h"
110
110
#include " xrCommon/xr_string.h"
111
+ #include " xrCommon/xr_smart_pointers.h"
111
112
#include " xrCore/Animation/Bone.hpp"
112
113
#include " xrCore/Animation/Motion.hpp"
113
114
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ #include < memory>
4
+
5
+ template <typename T>
6
+ using xr_unique_ptr = std::unique_ptr<T>;
7
+
8
+ template <typename T>
9
+ using xr_shared_ptr = std::shared_ptr<T>;
10
+
11
+ template <class T , class ... Args>
12
+ inline xr_unique_ptr<T> xr_make_unique (Args&&... args)
13
+ {
14
+ return std::make_unique<T>(args...);
15
+ }
16
+
17
+ template <class T , class ... Args>
18
+ inline xr_shared_ptr<T> xr_make_shared (Args&&... args)
19
+ {
20
+ return std::make_shared<T>(args...);
21
+ }
Original file line number Diff line number Diff line change 11
11
#include " vfw.h"
12
12
#endif
13
13
14
- std::unique_ptr <EFS_Utils> xr_EFS;
14
+ xr_unique_ptr <EFS_Utils> xr_EFS;
15
15
// ----------------------------------------------------
16
16
EFS_Utils::EFS_Utils () {}
17
17
EFS_Utils::~EFS_Utils () {}
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ class XRCORE_API EFS_Utils
42
42
static xr_string ExtractFileExt (LPCSTR src);
43
43
static xr_string ExcludeBasePath (LPCSTR full_path, LPCSTR excl_path);
44
44
};
45
- extern XRCORE_API std::unique_ptr <EFS_Utils> xr_EFS;
45
+ extern XRCORE_API xr_unique_ptr <EFS_Utils> xr_EFS;
46
46
#define EFS (*xr_EFS)
47
47
48
48
#endif /* _INCDEF_FileSystem_H_*/
Original file line number Diff line number Diff line change 26
26
27
27
const u32 BIG_FILE_READER_WINDOW_SIZE = 1024 * 1024 ;
28
28
29
- std::unique_ptr <CLocatorAPI> xr_FS;
29
+ xr_unique_ptr <CLocatorAPI> xr_FS;
30
30
31
31
#ifdef _EDITOR
32
32
static constexpr pcstr FSLTX = " fs.ltx"
Original file line number Diff line number Diff line change 10
10
#include " LocatorAPI_defs.h"
11
11
// #include "xrCore/Threading/Lock.hpp"
12
12
#include " xrCommon/xr_map.h"
13
+ #include " xrCommon/xr_smart_pointers.h"
13
14
#include " xrCommon/predicates.h"
14
15
#include " Common/Noncopyable.hpp"
15
16
@@ -255,5 +256,5 @@ class XRCORE_API CLocatorAPI : Noncopyable
255
256
void unlock_rescan ();
256
257
};
257
258
258
- extern XRCORE_API std::unique_ptr <CLocatorAPI> xr_FS;
259
+ extern XRCORE_API xr_unique_ptr <CLocatorAPI> xr_FS;
259
260
#define FS (*xr_FS)
Original file line number Diff line number Diff line change 1
1
#pragma once
2
- #include < memory >
2
+ #include " xrCommon/xr_smart_pointers.h "
3
3
4
4
namespace XRay
5
5
{
@@ -23,15 +23,15 @@ class XRCORE_API ModuleHandle
23
23
void * GetProcAddress (pcstr procName) const ;
24
24
};
25
25
26
- using Module = std::unique_ptr <ModuleHandle>;
26
+ using Module = xr_unique_ptr <ModuleHandle>;
27
27
28
28
inline auto LoadModule (bool dontUnload = false )
29
29
{
30
- return std::make_unique <ModuleHandle>(dontUnload);
30
+ return xr_make_unique <ModuleHandle>(dontUnload);
31
31
}
32
32
33
33
inline auto LoadModule (pcstr moduleName, bool dontUnload = false )
34
34
{
35
- return std::make_unique <ModuleHandle>(moduleName, dontUnload);
35
+ return xr_make_unique <ModuleHandle>(moduleName, dontUnload);
36
36
}
37
37
}
Original file line number Diff line number Diff line change 15
15
#include < mutex>
16
16
#include < condition_variable>
17
17
#include < functional>
18
- #include < memory >
18
+ #include " xrCommon/xr_smart_pointers.h "
19
19
20
20
class XRCORE_API Thread
21
21
{
@@ -42,7 +42,7 @@ class XRCORE_API Thread
42
42
class ThreadPool
43
43
{
44
44
public:
45
- xr_vector<std::unique_ptr <Thread>> threads;
45
+ xr_vector<xr_unique_ptr <Thread>> threads;
46
46
47
47
void initialize ()
48
48
{
You can’t perform that action at this time.
0 commit comments