CommonLibSSE NG
BSResponse.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSFixedString.h"
5 #include "RE/B/BSTHashMap.h"
7 #include "RE/B/BSTSmartPointer.h"
9 #include "RE/I/IHandlerFunctor.h"
10 
11 namespace RE
12 {
13  template <class Type, class Handler, class Parameter, template <class> class Parent>
14  class BSResponse :
15  public Parent<Parameter>,
17  {
18  public:
20 
21  BSResponse() = default;
22  ~BSResponse() override = default; // 00
23 
24  using BSIntrusiveRefCounted::operator new;
25  using BSIntrusiveRefCounted::operator delete;
26 
27  [[nodiscard]] inline BSTSmartPointer<functor_type> GetHandler(const Type& a_type)
28  {
29  auto it = handlerMap.find(a_type);
30  if (it != handlerMap.end()) {
31  return it->second;
32  } else if (backupResponse) {
33  return backupResponse->GetHandler(a_type);
34  } else {
35  return nullptr;
36  }
37  }
38 
39  // members
42  };
43 
44  template <class T, class Key>
46  {
47  public:
49  };
50  //static_assert(sizeof(ResponseDefinitionMissPolicy) == 0x8);
51 
52  template <class T, class Key>
54  {
55  public:
57  };
58  //static_assert(sizeof(PreloadResponsesInitializationPolicy) == 0x8);
59 
60  class Actor;
62  static_assert(sizeof(AnimResponse) == 0x48);
63 
65  public BSTObjectDictionary<
66  BSTSmartPointer<AnimResponse>,
67  BSFixedString,
68  ResponseDefinitionMissPolicy,
69  PreloadResponsesInitializationPolicy>
70  {
71  public:
73  };
74  static_assert(sizeof(ResponseDictionary) == 0x50);
75 }
Definition: Actor.h:135
Definition: BSResponse.h:17
BSResponse()=default
BSTSmartPointer< functor_type > GetHandler(const Type &a_type)
Definition: BSResponse.h:27
BSTHashMap< Type, BSTSmartPointer< functor_type > > handlerMap
Definition: BSResponse.h:40
~BSResponse() override=default
BSTSmartPointer< BSResponse< Type, Handler, Parameter, Parent > > backupResponse
Definition: BSResponse.h:41
Definition: BSTObjectDictionary.h:18
Definition: BSTHashMap.h:21
Definition: BSTSmartPointer.h:36
Definition: IHandlerFunctor.h:13
Definition: BSResponse.h:54
Definition: BSResponse.h:46
Definition: BSResponse.h:70
static ResponseDictionary * GetSingleton()
Definition: AbsorbEffect.h:6
Definition: BSIntrusiveRefCounted.h:8