summaryrefslogtreecommitdiff
path: root/library/include/DataDefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'library/include/DataDefs.h')
-rw-r--r--library/include/DataDefs.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/library/include/DataDefs.h b/library/include/DataDefs.h
index 7f4d94c8..6b3aeb3e 100644
--- a/library/include/DataDefs.h
+++ b/library/include/DataDefs.h
@@ -28,6 +28,7 @@ distribution.
#include <sstream>
#include <vector>
#include <map>
+#include <set>
#include "Core.h"
#include "BitArray.h"
@@ -292,6 +293,8 @@ namespace DFHack
typedef virtual_class *virtual_ptr;
#endif
+ class DFHACK_EXPORT VMethodInterposeLinkBase;
+
class DFHACK_EXPORT virtual_identity : public struct_identity {
static std::map<void*, virtual_identity*> known;
@@ -299,6 +302,9 @@ namespace DFHack
void *vtable_ptr;
+ friend class VMethodInterposeLinkBase;
+ std::vector<VMethodInterposeLinkBase*> interpose_list;
+
protected:
virtual void doInit(Core *core);
@@ -306,10 +312,14 @@ namespace DFHack
bool can_allocate() { return struct_identity::can_allocate() && (vtable_ptr != NULL); }
+ void *get_vmethod_ptr(int index);
+ bool set_vmethod_ptr(int index, void *ptr);
+
public:
virtual_identity(size_t size, TAllocateFn alloc,
const char *dfhack_name, const char *original_name,
virtual_identity *parent, const struct_field_info *fields);
+ ~virtual_identity();
virtual identity_type type() { return IDTYPE_CLASS; }
@@ -337,6 +347,8 @@ namespace DFHack
: (this == get(instance_ptr));
}
+ template<class P> static P get_vmethod_ptr(P selector);
+
public:
bool can_instantiate() { return can_allocate(); }
virtual_ptr instantiate() { return can_instantiate() ? (virtual_ptr)do_allocate() : NULL; }