On 8/23/2011 3:30 PM, Default User wrote:
> "Victor Bazarov"<v.baza...@comcast.invalid> wrote in messageThat's your design. That's not the problem definition, though.
>> 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
> 2. The driver objects will be contained by other, higher-level ones. TheseOK. A device consists of (or contains) a collection of drivers. Let's
> higher level "device" modules are derived from a common base class
go with that.
> That base class has a pointer to the driver base class.
A *single* pointer? How does that work with the collection (see above)?
> derived class objects will populate that pointer with the particular driverA single pointer? Is that some kind of an "active" driver? From where
> that they need.
do those get populated? Is there a repository of driver objects?
> 3. The "device" objects will call the small set of public methods usingWhose methods? Driver's?
> Some methods are in the base class, others specific to a
> particular device. Mostly these route op codes and data to the driver, or"The" instrument? The "active" one? There is only one instrument at a
> retrieve data pulled from the instrument.
time? Can there be the need to retrieve data from a driver/instrument
that is not active?
> 4. The drivers will have class attributes that contain state informationYou're explaining your design instead of explaining the problem. Can
> 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.
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
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.