Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #9250
| From | "Default User" <defaultuserbr@yahoo.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Mapping operations to codes |
| Date | 2011-08-23 14:30 -0500 |
| Message-ID | <9bidfjFom5U1@mid.individual.net> (permalink) |
| References | <9bi243F224U1@mid.individual.net> <j30pb0$1pi$1@dont-email.me> |
"Victor Bazarov" <v.bazarov@comcast.invalid> wrote in message
news:j30pb0$1pi$1@dont-email.me...
> The maps don't seem to be needed per instance of class ('test') but rather
> per class (i.e. they should probably be static). That's all I have so
> far. I would probably try rewriting the code so that 'write' and 'list'
> functions were static as well.
I fear I haven't given enough information, and my example was too sketchy.
1. There will be a number of different drivers, one for each instrument, all
of with derive from the base class.
2. The driver objects will be contained by other, higher-level ones. These
higher level "device" modules are derived from a common base class
themselves. That base class has a pointer to the driver base class. The
derived class objects will populate that pointer with the particular driver
that they need.
3. The "device" objects will call the small set of public methods using
polymorphism. Some methods are in the base class, others specific to a
particular device. Mostly these route op codes and data to the driver, or
retrieve data pulled from the instrument.
4. The drivers will have class attributes that contain state information
about the particular instrument associated with the driver. The op code
handlers can't be static. Here my example really failed. Mentally add
several attributes, if you would.
Brian
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Mapping operations to codes "Default User" <defaultuserbr@yahoo.com> - 2011-08-23 11:17 -0500
Re: Mapping operations to codes Paul <pchristor@yahoo.co.uk> - 2011-08-23 10:33 -0700
Re: Mapping operations to codes Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-23 13:51 -0400
Re: Mapping operations to codes "Default User" <defaultuserbr@yahoo.com> - 2011-08-23 14:30 -0500
Re: Mapping operations to codes Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-23 16:23 -0400
Re: Mapping operations to codes "Default User" <defaultuserbr@yahoo.com> - 2011-08-23 16:01 -0500
Re: Mapping operations to codes Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-23 17:42 -0400
Re: Mapping operations to codes "Default User" <defaultuserbr@yahoo.com> - 2011-08-23 17:05 -0500
Re: Mapping operations to codes Paul <pchristor@yahoo.co.uk> - 2011-08-24 03:23 -0700
csiph-web