Questions tagged [dispatch-table]

In computer science, a dispatch table is a table of pointers to functions or methods. Use of such a table is a common technique when implementing late binding in object-oriented programming.

In computer science, a dispatch table is a table of pointers to functions or methods. Use of such a table is a common technique when implementing late binding in object-oriented programming.

22 questions
1
vote
0 answers

What does a dispatch table of an object contain, when object references to its sub-class object in java?

As per this answer in the link https://stackoverflow.com/a/6606490/4816065 In some of Sun's implementations of the Java virtual machine, a reference to a class instance is a pointer to a handle that is itself a pair of pointers: one to…
1
vote
4 answers

Java: HashMap performance with millions of items vs if-else searching for numerical range

Looking for a bit of advice if I may. I have a method in my PlayStation emulator (Java based for a university thesis which is since finished). It takes an integer memory address, and then returns the byte at that address - redirecting the read to…
PhilPotter1987
  • 1,306
  • 2
  • 12
  • 20
1
vote
2 answers

How can I create a dispatch table in Boo?

I'd like to be able to store a function in a hashtable. I can create a map like: hash = {} hash["one"] = def(): print "one got called" But I'm not able to call it: func = hash["one"] func() This produces the following error message: It is not…
Geo
  • 93,257
  • 117
  • 344
  • 520
0
votes
1 answer

Using template class method outside class in dispatch table

Im writing this small template class inheriting from an interface. Inside my class I declared a variable I'd like to use outside and put it into a dispatch table. when I try to compile my program it throws me an error This is my source…
0
votes
2 answers

Computing a function name from another function name

In python 3.4, I want to be able to do a very simple dispatch table for testing purposes. The idea is to have a dictionary with the key being a string of the name of the function to be tested and the data item being the name of the test…
PDX Mark
  • 31
  • 5
0
votes
1 answer

Can't use string ("1") as subroutine ref while "strict refs" in use

I know this is a duplicate of Can't use string ("1") as a subroutine ref while "strict refs" in use but I can't figure out what my problem is with the call to the dispatch table. The code seems to execute, but the following error appears in the log:…
snyderxc
  • 105
  • 1
  • 11
0
votes
3 answers

How do I create a dispatch table in Perl with key contain whitespace and the subroutine accepting an array parameter?

Here's my current thinking, but I dont know how to dispatch/execute it my $key; my @arraydata; my %commandfunc{ "ab 1", \&func1(\@arraydata), "ab 2", \&func2(\@arraydata, "ab 3", \&func3(\@arraydata) }; foreach $k (keys %commandfunc){ …
mhd
  • 4,561
  • 10
  • 37
  • 53
1
2