EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [Merge] lp:~johill-lanl/epics-base/epics-base-enclosure-of into lp:epics-base
From: Jeff Hill <[email protected]>
To: Jeff Hill <[email protected]>
Date: Thu, 21 Nov 2013 01:37:18 -0000
> I take it that the use of reinterpret_cast<>() is meant to bypass the
> restriction that offsetof() won't work on complex types?

The reinterpret cast is used to convert the pointer to an Octet pointer so that we can get an Octet offset. Since we are crossing fields of different data types we need to have that. if you look under the hood in the offsetof macro you will see the same type of implementation.

The offsetof() is implemented as a macro, and therefore less suitable for use in templates. 

This implementation should work just fine with user defined types, and I believe that the regression test should be testing that situation.

> What, if any, trouble could I expect when using "enclosureOf" on a class w/ inheritance?

I use enclosureOf frequently with embedded members that have simple single base class inheritance, and I doubt that there could be any issues with the enclosing class using simple inheritance. I don't currently use multiple inheritance very often but doubt that there would be any issues. If you used virtual base classes, especially double diamond virtual base classes, then proceed with caution, but that goes with the territory DKN.

-- 
https://code.launchpad.net/~johill-lanl/epics-base/epics-base-enclosure-of/+merge/196010
Your team EPICS Core Developers is requested to review the proposed merge of lp:~johill-lanl/epics-base/epics-base-enclosure-of into lp:epics-base.


Replies:
Re: [Merge] lp:~johill-lanl/epics-base/epics-base-enclosure-of into lp:epics-base mdavidsaver
References:
[Merge] lp:~johill-lanl/epics-base/epics-base-enclosure-of into lp:epics-base Jeff Hill

Navigate by Date:
Prev: Re: [Merge] lp:~johill-lanl/epics-base/epics-base-enclosure-of into lp:epics-base mdavidsaver
Next: Re: [Merge] lp:~johill-lanl/epics-base/epics-base-enclosure-of into lp:epics-base Jeff Hill
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: [Merge] lp:~johill-lanl/epics-base/epics-base-enclosure-of into lp:epics-base mdavidsaver
Next: Re: [Merge] lp:~johill-lanl/epics-base/epics-base-enclosure-of into lp:epics-base mdavidsaver
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 21 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·