Questions tagged [generic-callback]

5 questions
2
votes
4 answers

Dynamically create generic function pointer from method pointer, deducing return value and params

I have this helper class that I use to call member methods for code that's expecting static C functions. This particular "version" is compatible with Windows LPTHREADROUTINE callbacks, taking a DWORD (class::method) (void *) function as a parameter,…
Mahmoud Al-Qudsi
  • 28,357
  • 12
  • 85
  • 125
2
votes
1 answer

Accessing branch-and-cut node id in generic Cplex callback

I have an optimization problem that is decomposed using Benders decomposition. I implemented a Cplex generic callback (in JAVA) that includes Lazy, User and Heuristic callbacks. Now, I need to add some cut management strategies e.g., limiting the…
hmd.pouya
  • 103
  • 7
2
votes
1 answer

How to pass different callbacks to same function in android

I am new to android and I am currently trying to make volley post request and get a response from an API. What I did is call a callback when the response is successful. This callback works fine if I call from a single class, for instance, say…
Ram Keerthy
  • 227
  • 4
  • 16
1
vote
1 answer

Javascript share a generic callback with unique states

I have a working but tedious code. I have 6 of the onoff objects to describe 6 GPIO inputs. All of them need to register a callback [i.e. obj.watch(callback)] to detect state change. Currently, my functional code looks like this Var states = [[0,0],…
Patrick
  • 4,186
  • 9
  • 32
  • 45
0
votes
1 answer

I have made two template classes,could any one tell me if these things are useful?

Recently i made two template classes,according to the book "Modern C++ design". I think these classes are useful but no one in my company agree with me,so could any one tell me if these things are useful? The first one is a parameter wrapper,it can…
soul
  • 3
  • 1