CommonLibVR
IFunction.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSFixedString.h"
5 #include "RE/B/BSTSmartPointer.h"
6 
7 namespace RE
8 {
9  namespace BSScript
10  {
11  namespace Internal
12  {
13  class VirtualMachine;
14  }
15 
16  class ErrorLogger;
17  class Stack;
18  class StackFrame;
19  class TypeInfo;
20  class VMState;
21 
23  {
24  public:
25  inline static constexpr auto RTTI = RTTI_BSScript__IFunction;
26  inline static constexpr auto VTABLE = VTABLE_BSScript__IFunction;
27 
28  enum class FunctionType
29  {
30  kNormal = 0,
31  kGetter = 1,
32  kSetter = 2
33  };
34 
35  enum class CallResult
36  {
37  kCompleted = 0,
38  kSetupForVM = 1,
39  kInProgress = 2,
40  kFailedRetry = 3,
41  kFailedAbort = 4
42  };
43 
45  virtual ~IFunction() = default; // 00
46 
47  // add
48  virtual const BSFixedString& GetName() const = 0; // 01
49  virtual const BSFixedString& GetObjectTypeName() const = 0; // 02
50  virtual const BSFixedString& GetStateName() const = 0; // 03
51  virtual TypeInfo GetReturnType() const = 0; // 04
52  virtual std::uint32_t GetParamCount() const = 0; // 05
53  virtual void GetParam(std::uint32_t a_idx, BSFixedString& a_nameOut, TypeInfo& a_typeOut) const = 0; // 06
54  virtual std::uint32_t GetStackFrameSize() const = 0; // 07
55  virtual bool GetIsNative() const = 0; // 08
56  virtual bool GetIsStatic() const = 0; // 09
57  virtual bool GetIsEmpty() const = 0; // 0A
58  virtual FunctionType GetFunctionType() const = 0; // 0B
59  virtual std::uint32_t GetUserFlags() const = 0; // 0C
60  virtual const BSFixedString& GetDocString() const = 0; // 0D
61  virtual void InsertLocals(StackFrame* a_frame) = 0; // 0E
62  virtual CallResult Call(const BSTSmartPointer<Stack>& a_stack, ErrorLogger* a_logger, Internal::VirtualMachine* a_vm, bool a_arg4) = 0; // 0F
63  virtual const BSFixedString& GetSourceFilename() const = 0; // 10
64  virtual bool TranslateIPToLineNumber(std::uint32_t a_indexPtr, std::uint32_t& a_lineNumberOut) const = 0; // 11
65  virtual bool GetVarNameForStackIndex(std::uint32_t a_idx, BSFixedString& a_nameOut) const = 0; // 12
66  virtual bool CanBeCalledFromTasklets() const = 0; // 13
67  virtual void SetCallableFromTasklets(bool a_callable) = 0; // 14
68 
69  // members
70  std::uint32_t pad0C; // 0C
71  };
72  static_assert(sizeof(IFunction) == 0x10);
73  }
74 }
Definition: ErrorLogger.h:13
Definition: IFunction.h:23
virtual std::uint32_t GetParamCount() const =0
CallResult
Definition: IFunction.h:36
virtual const BSFixedString & GetDocString() const =0
virtual const BSFixedString & GetSourceFilename() const =0
virtual std::uint32_t GetStackFrameSize() const =0
virtual ~IFunction()=default
virtual TypeInfo GetReturnType() const =0
virtual bool GetIsNative() const =0
virtual bool GetIsEmpty() const =0
static constexpr auto RTTI
Definition: IFunction.h:25
virtual CallResult Call(const BSTSmartPointer< Stack > &a_stack, ErrorLogger *a_logger, Internal::VirtualMachine *a_vm, bool a_arg4)=0
std::uint32_t pad0C
Definition: IFunction.h:70
virtual const BSFixedString & GetObjectTypeName() const =0
virtual bool GetIsStatic() const =0
virtual void InsertLocals(StackFrame *a_frame)=0
virtual const BSFixedString & GetStateName() const =0
virtual std::uint32_t GetUserFlags() const =0
virtual void GetParam(std::uint32_t a_idx, BSFixedString &a_nameOut, TypeInfo &a_typeOut) const =0
virtual void SetCallableFromTasklets(bool a_callable)=0
static constexpr auto VTABLE
Definition: IFunction.h:26
FunctionType
Definition: IFunction.h:29
virtual bool TranslateIPToLineNumber(std::uint32_t a_indexPtr, std::uint32_t &a_lineNumberOut) const =0
virtual bool GetVarNameForStackIndex(std::uint32_t a_idx, BSFixedString &a_nameOut) const =0
virtual FunctionType GetFunctionType() const =0
virtual const BSFixedString & GetName() const =0
virtual bool CanBeCalledFromTasklets() const =0
Definition: VirtualMachine.h:46
Definition: StackFrame.h:15
Definition: TypeInfo.h:10
Definition: BSTSmartPointer.h:37
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_BSScript__IFunction(static_cast< std::uint64_t >(689172))
constexpr std::array< REL::ID, 1 > VTABLE_BSScript__IFunction
Definition: Offsets_VTABLE.h:9449
Definition: BSIntrusiveRefCounted.h:8