Original Post
Is it possible to store any sort of combinations of instance pointers and/or function pointers to allow calling a member function for a specific instance? Is it possible to send, as a callback, a member function that works uniquely for one single instance of a class? IE, not a static function? Is there any way that the routines recieving the callback pointer could add functionality to get this working? If those routines don't know what type of class has sent the function, is it possible to call a function pointer associated with an instance pointer? Is there any other way to allow a callback type system to activate instance-specific class functions? Similar to messaging, perhaps? Sorry for the broad question mark. I'm trying to find a way to allow scripting functions to send data back to individual objects without knowledge of those objects. Messaging looks like my best bet. The object sends an instance pointer ('this' as void*) and a message ID for every script function, along with a pointer to a single static function to call. The script then sends a list of arguments, the void instance pointer, and the message ID back to the object's static function. The object's static function casts the void pointer back into its own instance type, then calls the member function associated with the message ID. I'm just curious to know if there is an easier way. Thanks