Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #9252
| From | "Default User" <defaultuserbr@yahoo.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Mapping operations to codes |
| Date | 2011-08-23 16:01 -0500 |
| Message-ID | <9biiotF1hlU1@mid.individual.net> (permalink) |
| References | <9bi243F224U1@mid.individual.net> <j30pb0$1pi$1@dont-email.me> <9bidfjFom5U1@mid.individual.net> <j3128j$2kc$1@dont-email.me> |
"Victor Bazarov" <v.bazarov@comcast.invalid> wrote in message
news:j3128j$2kc$1@dont-email.me...
> On 8/23/2011 3:30 PM, Default User wrote:
>> "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.
>
> That's your design. That's not the problem definition, though.
Unfortunately, not being a start-from-scratch exercise, we have to go with
the design as it is so far. Again, my attempts at explanation have had
serious gaps, and I apologize for that.
> You're explaining your design instead of explaining the problem. Can one
> device have drivers that serve the same operation? If not, then each
> driver (op server or whatever you decide to call it) is unique at the
> *device* level, and there seems to be no sense to map its operation to its
> function at the level of the *driver*. Place a master map at the device
> level.
The central system will hit certain conditions that require service from an
instrument. At that time, there will be a device code that indicates which
device should handle the situation, an operation code that indicates what to
do, and a data word with specific information. None of that can be changed.
The design of most of this is well along and can't be changed. For good or
for ill.
At the driver level, I need to map operation codes to driver functions. The
original code had large case statements. I've been breaking that into
smaller "handlers" for the various op codes.
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