Re: [myhdl-list] Proposal: SignalType symbol
Brought to you by:
jandecaluwe
From: Christopher L. F. <chr...@gm...> - 2010-06-11 10:31:34
|
On 6/11/2010 4:19 AM, Jan Decaluwe wrote: > Christopher Felton wrote: > >> > Your factory function Signal() must return the correct class object >> > based upon the parameters passed to it. >> > >> > So Signal is just a function now that returns a class object so >> there is >> > no such thing as an instance of it. >> >> Right. For completeness, there is still the guarantee that any returned >> object will be of type SignalType (so that the corresponding isinstance >> check will always be true), but the specific subtype depends on the >> parameters. >> >> >> Ok, I am going to back up and make sure I understand this. >> >> We have a base class, *Signal(...)* and derived classes DelayedSignal, >> ShadowSignal, etc. As you mentioned some earlier design decision guided >> this path. From a users point of view the desired effect is that they >> only care about a *Signal* that may have some different attributes but >> the user doesn't need to know that it is a different object (just >> refreshing and sync'n out loud). >> >> Now we have a factory function (introduced with the ShadowSignal) and a >> proposed SignalType. The SignalType exposes the actual base class >> *_Signal_* because we can't have an instance of the factory function >> (well you can but that is not the use here). So the SignalType property >> exposes the base class so we identify variable's types. >> > Correct. In effect, we decouple the interface to create Signal objects > from their base class SignalType. Everywhere where you tested where > an instance is a Signal, it should merely be a matter of using SignalType > instead. > > Should I already push this change to the public repo's for experimenting? > > > Yes, sounds good to me > > |