home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18897 < prev    next >
Encoding:
Text File  |  1993-01-10  |  1.4 KB  |  34 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!rational.com!thor!rmartin
  3. From: rmartin@thor.Rational.COM (Bob Martin)
  4. Subject: Re: Callbacks in C++
  5. Message-ID: <rmartin.726677907@thor>
  6. Sender: news@rational.com
  7. Organization: Rational
  8. References: <1iikcuINN6fr@news.cerf.net>
  9. Date: Sun, 10 Jan 1993 14:58:27 GMT
  10. Lines: 22
  11.  
  12. hlf@nic.cerf.net (Howard Ferguson) writes:
  13.  
  14. >The FAQ for this group describes how to put wrapper functions around 
  15. >member functions so they can be called as callbacks from X libraries
  16. >and the like. But if I am writting a c++ class library, surley I should
  17. >be able to provide a cleaner mechanism to my customers. Is there
  18. >a standard way of doing this???
  19.  
  20. If you are designing a class library, you don't generally want to
  21. provide callbacks to your users.  Instead, you want to provide them
  22. with interfaces that they can use to receive information from you.
  23. These interfaces are abstract classes.  Pure virtual functions are
  24. declared which allow information to be passed from your class library
  25. to user objects derived from the abstract classes.  The users can
  26. implement the derivatives of the pure virtuals as they see fit.
  27.  
  28.  
  29. --
  30. Robert Martin                        Training courses offered in:
  31. R. C. M. Consulting                       Object Oriented Analysis
  32. 2080 Cranbrook Rd.                        Object Oriented Design
  33. Green Oaks, Il 60048 (708) 918-1004       C++
  34.