>On Jul 18, 8:29 am, Keith H Duggar <dug...@[EMAIL PROTECTED]
> wrote:
> On Jul 16, 3:37 pm, ****va <dudeofin...@[EMAIL PROTECTED]
> wrote:
>
> > Hi All..
> > I am a novice to C++ and working on one networking project.
> > In which, some of my application layer functions should be executed
> > when some event occur in network.
>
> > For this, i thought of using callback functions concept.
>
> > is it the best way? It will be helpful, if some of you suggest best
> > way for such implementation.
>
> > If callback concept is best, how i use this efficiently.
> > it will be helpful, if ypu provide some good URL to study.
>
> Yes callbacks work very well. Please see:
>
> Don Clugston's
> "Member Function Pointers and the Fastest Possible C++
Delegates"http://www.codeproject.com/KB/cpp/FastDelegate.aspx
>
> for one excellent callback or delegate mechanism.
>
> A simple alternative is to use only one delegate type of
> void * (*)(void *) which gives you enough flexibility to pass
> in and return arbitrarily complex data. However, this approach
> does not automate the casting required.
>
> KHD
>
You might find the Command design pattern implemented using
polymorphic function-objects to be quite useful. It's the object-
oriented implementation of callbacks & is usually neater than the
function pointer implementation.
regards,
Aman Angrish.
--
[ See http://www.gotw.ca/resources/clcm.htm
for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


|