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