[omniORB] IDL for callback-object

henning.schmidt@philips.com henning.schmidt@philips.com
Thu, 17 May 2001 19:52:08 -0500


I am trying to come up with an IDL for a CallbackObject with similar se=
mantics to the VkCallbackObject. (see below)
Has anyone been able to come up with something clever that is generic e=
nough so that I don't need to know the function to be called in the IDL=
 where I define the rest of the Framework. I don't seem to be able to f=
ind a nice way to do what a pointer to=20
object-function does in C++.

Any idea how this can be solved? It would not need to be compatible wit=
h the VkCallbacks. Just some generic definition that lets me register a=
nd deliver Callbacks over omniORB ... Of course I have to program all t=
he handling and despatching myself.=20
That's fine. I know how to C++. I am looking for the IDL because that i=
s fairly new to me.

Thanks for your expertise
;Henning

-------------- short explaination of how VkCallbackObjects work
VkCallbackObject is a class definition that I have to derive from. Amon=
gst other things it provides a framework where I can register a member =
function in a "callback-list". Any VkCallbackObject can maintain any nu=
mber of callback lists and it can=20
register any number of callback-functions in any of those lists.
So if I have the following classes
	class MyClassA : public VkCallbackObject {
	   public:
	      myMemberFunc (VkCallbackObject *caller, void *clientData, void *=
callData);
	};
	class MyClassB : public VkCallbackObject {
	   public:
	      static const char const * interestingEventName;
	      void thisIsWhereItHappens();
	};

and I want MyClassA::myMemberFunc() to be called whenever something int=
eresting happens in a particula object of type MyClassB I can register =
the function like this:
	void *p =3D ... // points to some data that I want to have delivered w=
hen the callback happens
	MyClassA myObjA =3D new MyClassA();
	MyClassB myObjB =3D new MyClassB();
	myObjB->addCallback (MyClassB::interestingEventName,  myObjA,  MyClass=
A::myMemberFunc,  p);

And this is how the callback is called:
	MyClassB::thisIsWhereItHappens () {
	   // some most interesting action here
	   void *pp =3D ... // points to some data that can be delivered to th=
e called function throug hthe callback
	   callCallbacks (interestingEventName, pp);
	}


---------------------------------------------------------
THOMSON multimedia Broadcast Solutions=20
H. Henning Schmidt / Digital Film Applications
1000 W. Maude Ave, Sunnyvale, CA, 94085, USA
phone:    +1 (408) 617-5751  Fax: -7713
email:    henning.schmidt@philips.com
---------------------------------------------------------

=