CommonLibSSE (Parapets fork)
StreamBase.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/E/ErrorCodes.h"
4 #include "RE/M/MemoryManager.h"
5 
6 namespace RE
7 {
8  namespace BSResource
9  {
10  struct Info;
11 
12  class StreamBase
13  {
14  public:
15  inline static constexpr auto RTTI = RTTI_BSResource__StreamBase;
16 
17  enum : std::uint32_t
18  {
19  kWritable = 1 << 0,
20  kRefCountBeg = 0x1000,
21  kRefCountMask = (std::uint32_t)0xFFFFF000
22  };
23 
25  StreamBase(const StreamBase& a_rhs);
27  StreamBase(std::uint32_t a_totalSize);
28  virtual ~StreamBase() = default; // 00
29 
30  // add
31  virtual ErrorCode DoOpen() = 0; // 01
32  virtual void DoClose() = 0; // 02
33  [[nodiscard]] virtual std::uint64_t DoGetKey() const; // 03 - { return 0; }
34  virtual ErrorCode DoGetInfo(Info& a_info); // 04 - { return ErrorCode::kUnsupported; }
35 
37 
38  std::uint32_t DecRef();
39  std::uint32_t IncRef();
40  [[nodiscard]] bool IsWritable() const;
41 
42  // members
43  std::uint32_t totalSize; // 08
44  std::uint32_t flags; // 0C
45  };
46  static_assert(sizeof(StreamBase) == 0x10);
47  }
48 }
Definition: StreamBase.h:13
std::uint32_t flags
Definition: StreamBase.h:44
StreamBase(StreamBase &&a_rhs)
virtual ErrorCode DoGetInfo(Info &a_info)
std::uint32_t totalSize
Definition: StreamBase.h:43
virtual void DoClose()=0
StreamBase(const StreamBase &a_rhs)
@ kRefCountMask
Definition: StreamBase.h:21
@ kWritable
Definition: StreamBase.h:19
@ kRefCountBeg
Definition: StreamBase.h:20
virtual ~StreamBase()=default
virtual ErrorCode DoOpen()=0
StreamBase(std::uint32_t a_totalSize)
static constexpr auto RTTI
Definition: StreamBase.h:15
virtual std::uint64_t DoGetKey() const
ErrorCode
Definition: ErrorCodes.h:8
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_BSResource__StreamBase
Definition: Offsets_RTTI.h:2132
Definition: Info.h:8