CommonLibVR
BSResourceHandle.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/N/NiSmartPointer.h"
5 
6 namespace RE
7 {
8  class NiNode;
9 
10  namespace BSModelDB
11  {
12  struct DBTraits;
13  }
14 
15  namespace BSResource
16  {
17  template <class T_Entry, class T_EntryDB>
19  {
20  public:
21  using U_Entry = T_Entry;
22  using U_EntryDB = T_EntryDB;
23 
24  [[nodiscard]] constexpr T_Entry* get() const noexcept
25  {
26  return _entry;
27  }
28 
29  [[nodiscard]] explicit constexpr operator bool() const noexcept
30  {
31  return static_cast<bool>(_entry);
32  }
33 
34  [[nodiscard]] constexpr T_Entry& operator*() const noexcept
35  {
36  assert(static_cast<bool>(*this));
37  return *_entry;
38  }
39 
40  [[nodiscard]] constexpr T_Entry* operator->() const noexcept
41  {
42  assert(static_cast<bool>(*this));
43  return _entry;
44  }
45 
46  protected:
47  // members
48  T_Entry* _entry; // 00
49  };
50  }
51 
53 }
Definition: BSResourceEntryDB.h:20
Definition: BSResourceEntryDB.h:106
Definition: BSResourceHandle.h:19
constexpr T_Entry * operator->() const noexcept
Definition: BSResourceHandle.h:40
T_Entry * _entry
Definition: BSResourceHandle.h:48
T_Entry U_Entry
Definition: BSResourceHandle.h:21
constexpr T_Entry & operator*() const noexcept
Definition: BSResourceHandle.h:34
constexpr T_Entry * get() const noexcept
Definition: BSResourceHandle.h:24
T_EntryDB U_EntryDB
Definition: BSResourceHandle.h:22
Definition: AbsorbEffect.h:6