kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #11153
Re: Experiments and considerations for more layer
> PS. about more than 64 layers - I attached an example flag set class. Of
> course it's not as fast as a bare int/int64 (4 assembly instructions
> instead of one/two), but it brings type safety and automatic
> serialization (it's just a demo written in 20 minutes, not a quality code).
Tom,
That looks excellent.
I was also thinking bit set. The fact that std::bitset<> takes a size suggests it is
putting the bits in the instance block, not in a separate block of memory.
Efficiency seems is more than adequate, and might even be more than adequate even if
FLAG_SET::operator| () and FLAG_SET::operator& ()
were *not* inlined. It would be worth looking at how much code is put out for those ops
to decide.
If we got rid of the tabs and we could use it tomorrow.
We probably need either 1) or 2) below so we can do:
if( bool( layer1 & layer2 ) )
{
}
1))))))))))))
FLAG_SET::operator bool () to return
return (bool) this.count();
2))))))))))))
change FLAG_SET::operator& () to return
return (bool) rv.count();
In this case you would also need a |= opertor and &= operator to assemble LAYER_SETs.
Follow ups
References
-
Re: Experiments and considerations for more layer
From: Lorenzo Marcantonio, 2013-09-02
-
Re: Experiments and considerations for more layer
From: jp charras, 2013-09-02
-
Re: Experiments and considerations for more layer
From: Lorenzo Marcantonio, 2013-09-02
-
Re: Experiments and considerations for more layer
From: Brian F. G. Bidulock, 2013-09-03
-
Re: Experiments and considerations for more layer
From: Lorenzo Marcantonio, 2013-09-03
-
Re: Experiments and considerations for more layer
From: Brian F. G. Bidulock, 2013-09-03
-
Re: Experiments and considerations for more layer
From: Lorenzo Marcantonio, 2013-09-03
-
Re: Experiments and considerations for more layer
From: Brian F. G. Bidulock, 2013-09-03
-
Re: Experiments and considerations for more layer
From: Lorenzo Marcantonio, 2013-09-03
-
Re: Experiments and considerations for more layer
From: Brian F. G. Bidulock, 2013-09-03
-
Re: Experiments and considerations for more layer
From: Lorenzo Marcantonio, 2013-09-03
-
Re: Experiments and considerations for more layer
From: Tomasz Wlostowski, 2013-09-03