← Back to team overview

kicad-developers team mailing list archive

Re: Concerns about clearing disagreements before committing.



On Fri, 25 Nov 2011, Lorenzo Marcantonio wrote:

> On Thu, Nov 24, 2011 at 03:46:58PM -0700, Brian F. G. Bidulock wrote:
> > The only other legacy change that I ran into that I
> > changed a year ago was the number of layers and their
> > representation.  You know, the 32-bit bit mask for
> > layers.  I don't know whether that should be done
> > against "testing" or "experimental"?
> What do you use for that, an unsigned long long (64 layers) or the std
> bitarray? the long long is less painful but limited, the bitarray hasn't
> this problem but I don't know if it's 'sufficiently' fast (we check *a
> lot* of times against the layer mask...)

Well, in fact, almost all bitwise AND comparisons are either testing
for a single layer or all copper layers.  Sometimes a range of layers
(e.g. for buried or blind vias).  This is not a good use of a bit mask.
They were all easily converted into a test for a single layer or a test
for any layer within a layer class, or a layer within a range.

So, I implemented the stack layer mask as std::set but implemented a
layer id and layer pair identifier as one or two 32-bit values broken
into 16-bit layer class and 16-bit layer index.  I also described a
set of abstract base classes for board items (LAYERABLE_ITEM, LAYER_ITEM, 
LAYERED_ITEM, STACKED_ITEM, LAYERS_ITEM) to encapsulate layer behaviour
inside the board item instead of outside it.  But you can find this info
(and the rationale for changes) in the design document and in the code
comments on my kicad-brian branch.


Brian F. G. Bidulock    � The reasonable man adapts himself to the �
bidulock@xxxxxxxxxxx    � world; the unreasonable one persists in  �
http://www.openss7.org/ � trying  to adapt the  world  to himself. �
                        � Therefore  all  progress  depends on the �
                        � unreasonable man. -- George Bernard Shaw �

Follow ups