CommonLibSSE (powerof3)
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  inline static constexpr auto VTABLE = VTABLE_BSResource__StreamBase;
17 
18  enum : std::uint32_t
19  {
20  kWritable = 1 << 0,
21  kRefCountBeg = 0x1000,
22  kRefCountMask = (std::uint32_t)0xFFFFF000
23  };
24 
26  StreamBase(const StreamBase& a_rhs);
28  StreamBase(std::uint32_t a_totalSize);
29  virtual ~StreamBase() = default; // 00
30 
31  // add
32  virtual ErrorCode DoOpen() = 0; // 01
33  virtual void DoClose() = 0; // 02
34  [[nodiscard]] virtual std::uint64_t DoGetKey() const; // 03 - { return 0; }
35  virtual ErrorCode DoGetInfo(Info& a_info); // 04 - { return ErrorCode::kUnsupported; }
36 
38 
39  std::uint32_t DecRef();
40  std::uint32_t IncRef();
41  [[nodiscard]] bool IsWritable() const;
42 
43  // members
44  std::uint32_t totalSize; // 08
45  std::uint32_t flags; // 0C
46  };
47  static_assert(sizeof(StreamBase) == 0x10);
48  }
49 }
Definition: StreamBase.h:13
std::uint32_t flags
Definition: StreamBase.h:45
StreamBase(StreamBase &&a_rhs)
virtual ErrorCode DoGetInfo(Info &a_info)
std::uint32_t totalSize
Definition: StreamBase.h:44
virtual void DoClose()=0
StreamBase(const StreamBase &a_rhs)
virtual ~StreamBase()=default
static constexpr auto VTABLE
Definition: StreamBase.h:16
@ kRefCountMask
Definition: StreamBase.h:22
@ kWritable
Definition: StreamBase.h:20
@ kRefCountBeg
Definition: StreamBase.h:21
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(static_cast< std::uint64_t >(690343))
constexpr std::array< REL::ID, 1 > VTABLE_BSResource__StreamBase
Definition: Offsets_VTABLE.h:9408
Definition: Info.h:10