Questions tagged [virtual-table]
31 questions
8
votes
5 answers
virtual table and _vptr storage scheme
Can someone explains how this virtual table for the different class is stored in memory? When we call a function using pointer how do they make a call to function using address location? Can we get these virtual table memory allocation size using a…

Vineet Jain
- 1,515
- 4
- 21
- 31
6
votes
2 answers
Avoiding repeated C++ virtual table lookup
I have C++ program that reads a config file when the binary is executed, creates a number of child class instances based on the config file, and then periodically iterates over these instances and calls their respective virtual functions.
Gprof is…

galpo
- 183
- 1
- 7
4
votes
1 answer
Are table variables and virtual tables the same thing?
Are virtual tables and table variables the same in SQL Server? What is a virtual table? Why we need virtual tables, and how do you create one?

Neeru Rana
- 49
- 1
- 9
2
votes
1 answer
How to get the base class offset of an inherited struct without creating an instance
Consider this code:
struct A {
int64 member;
int32 member2;
virtual void f();
};
struct B {
int16 member3;
virtual void b();
};
struct C : A, B {
virtual void b() override;
};
I'm interested in finding the offset of B in…

Lucas Smith
- 25
- 4
2
votes
2 answers
Accessing functions through virtual tables in C++
I have two classes B and D
class B{
public:
virtual int prva()=0;
virtual int druga(int)=0;
};
class D: public B{
public:
virtual int prva(){return 42;}
virtual int druga(int x){return prva()+x;}
};
My task is to create a function that…

L.A.
- 25
- 4
2
votes
0 answers
C++ multiple level inheritance thunk object pointer adjustment
Consider the following code with 3-level multiple inheritance hierachy.
auto addr = [](auto v) -> uint64_t { return *reinterpret_cast(v); };
struct BaseA
{
void virtual a() {}
};
struct BaseB
{
void virtual b() {}
};
struct…

Roman Smyrnov
- 21
- 1
2
votes
2 answers
Figuring out vptr field
I have a few classes and I'm trying to understand how the vptr and vtable work in this situation.
class RGB {
short value[3];
};
class AbstractImage{
protected:
int n_pixels;
public:
virtual void show() = 0;
virtual…

Adam Morad
- 167
- 1
- 7
2
votes
2 answers
Instance pointer differs from vfptr when .dll is loaded
So, I was playing around with Visual Studio's Test Suite and I discovered something interesting:
I have an instance to class A at address, say, 0x0656a64c.
Then when I watched over the variable, it says that its __vfptr is pointing at 0x077e7c0c.
As…

Fireken
- 118
- 5
2
votes
1 answer
Sorting By Asc and Desc date
trying to sort my immutable list by desc and or asc by a date give, but its not really working exactly, on sorting for words it works fine but not the following Date that are in the list . Using the descending and ascending value from react…

Aboogie
- 450
- 2
- 9
- 27
1
vote
0 answers
How to create a Full Text Search (FTS) virtual table from existing table without explicit column name?
This question describes how to create a FTS table (tabel2) from existing table (table1) by explicitly providing column names which boils down to:
CREATE VIRTUAL TABLE table2 USING FTS5(col1, col2);
INSERT INTO table2 SELECT * FROM table1;
However…

rambalachandran
- 2,091
- 2
- 19
- 34
1
vote
3 answers
Why is the function call to the virtual function using the address stored in the virtual method table returning garbage?
I'm calling virtual functions from the address in the virtual table as an exercise to test my understanding of the concept. However, as soon as I thought I made a breakthrough in my understanding of the virtual method table, I run into another issue…

legendaryz
- 53
- 6
1
vote
2 answers
Alternative to reference virtual table in C without using function pointers.
I am taking advantage of polymorphism in C by using virtual tables as described in Polymorphism (in C) and it works great.
Unfortunately, the limitation of my current project does not allow me to use function pointer or reference to structs in some…

Juan Jiménez
- 11
- 2
0
votes
1 answer
C++ Memory Layout: Questions about multiple inheritance, virtual destructors, and virtual function tables
I have a main.cpp file as follows.
#include
class Base1
{
public:
int ibase1;
Base1() : ibase1(10) {}
virtual void f_b1_1() { printf("Base1::f_b1_1()()\n"); }
virtual void f_b1_2() { printf("Base1::f_b1_2()()\n"); }
…

xxllxx666
- 183
- 1
- 6
0
votes
0 answers
Is there a way to make a variable in Power BI contain a dynamical table?
I am struggling with this measure for my Y-axis. I am trying to create a dynamic virtual table for the periodtype, however something is not working.
In my return statement, it won't allow me to select the columns in my virtual table _tbl, however I…

Frederik Forum
- 7
- 6
0
votes
0 answers
is there any example to make rows in React-virtualized Table(not list) draggable and droppable with React-beautiful-dnd lib?
tried all the methods mention in React-beautiful-dnd lib to make work with virtual list but can't make it work with React-virtualized-table.

Darshak patel
- 19
- 3