Boost logo

Boost Users :

From: Offlein (Offlein_at_[hidden])
Date: 2005-07-31 13:51:57


Hi all,

i just subscribed to this List ;)
I have a Problem with C++ Member Functions and Pointers to this Member Functions so that they fit into a Function with take a normal Function.
I guess i'm a Newbie, otherwise i should have already solved it, i think. ;)

I want to use IPC Stuff from Ecore. But before you can make use of ecore_ipc you must initialize it, as far as i can see.
I atached 4 Files, where i build a little Scenario:
1. Example.cpp // The Main Program
2. Testclass.hpp
3. Testclass.cpp
4. Makefile // Perhaps you must adjust some of the Variables

I commented the important Points in the Code again.

So i must first call
ecore_ipc_init() // Testclass Line 68
and
must supply 3 Functions to ecore for handling Events
1. A Function that is called, when a new IPC Server is added
2. A Function that is called, when a IPC Server is deleted
3. A Function that is called, when some Message is sent

Namely:
ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_ADD, ipc_server_add, NULL );
ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DEL, ipc_server_del, NULL );
ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DATA, ipc_server_data, NULL );

"ipc_server_add", "ipc_server_del" and "ipc_server_data" are the functions that are available outside the Class Testclass

The Example Program as it is compiles and i can start it, the ecore_pic_init() succeds the 3 Functions get "registered" but this 3 submitted Functions are standing outside my Testclass,
but my Target is to have they inside my Testclass.

That's my Problem, i didn't get the Clue to give these MemberFunctions to these 3 Functions:
ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_ADD, ipc_server_add, NULL );
ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DEL, ipc_server_del, NULL );
ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DATA, ipc_server_data, NULL );

I tried Things like that, but that didn't helped me:
ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DEL, boost::bind( boost::type<int>(), &Testclass::ipc_server_add ), NULL );
ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DEL, boost::bind( boost::type<int>(), &Testclass::ipc_server_add, _1, _2, _3 ), NULL );

So i want to ask to the Mailinglist in Hope somebody knows how to do this Task in the right Way. ;)

Thanks for your help and Greets to all,
        Christian







Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net