Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Implementin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 8 Topic 9792 of 9983
Post > Topic >>

Re: Implementing call back functions effeciantly

by aman.cpp@[EMAIL PROTECTED] Jul 23, 2008 at 07:23 PM

>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! ]
 




 8 Posts in Topic:
Implementing call back functions effeciantly
shiva <dudeofindia@[EM  2008-07-16 13:37:35 
Re: Implementing call back functions effeciantly
Mathias Gaunard <loufo  2008-07-17 01:53:54 
Re: Implementing call back functions effeciantly
"Chris Thomasson&quo  2008-07-17 11:33:23 
Re: Implementing call back functions effeciantly
Bart van Ingen Schenau &l  2008-07-17 14:28:19 
Re: Implementing call back functions effeciantly
"Chris Thomasson&quo  2008-07-17 21:17:41 
Re: Implementing call back functions effeciantly
Keith H Duggar <duggar  2008-07-17 21:29:51 
Re: Implementing call back functions effeciantly
Tony Delroy <tony_in_d  2008-07-22 00:12:21 
Re: Implementing call back functions effeciantly
aman.cpp@[EMAIL PROTECTED  2008-07-23 19:23:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 15:36:38 CDT 2008.