nightstyles / alembic

Automatically exported from code.google.com/p/alembic
Other
1 stars 0 forks source link

Add versioned sub-namespace for the rest of the Alembic libraries, not just CoreAbstract #97

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For long-term safety and consistency in Alembic, we might want to add a 
versioned sub-namespace for the rest of the libraries (AbcGeom, Abc, 
AbcCoreHDF5, maybe Util and MD5Hash).  Then, add compiler definitions at the 
top-level CMakeLists.txt to fill them out automatically.

Original issue reported on code.google.com by ard...@gmail.com on 16 Nov 2010 at 11:04

GoogleCodeExporter commented 9 years ago

Original comment by ard...@gmail.com on 16 Nov 2010 at 11:42

GoogleCodeExporter commented 9 years ago
This does need to be done before 1.0.

Original comment by ard...@gmail.com on 30 Nov 2010 at 8:35

GoogleCodeExporter commented 9 years ago

Original comment by scottmmo...@gmail.com on 2 Dec 2010 at 2:15

GoogleCodeExporter commented 9 years ago
As discussed in todays meeting I'll do this for AbcCoreHDF5, Util and MD5Hash 
(as well as doing the using namespace version trick to all these and adding it 
to AbcCoreAbstract)

Original comment by miller.lucas on 24 Feb 2011 at 1:22

GoogleCodeExporter commented 9 years ago
Checkin is here:

http://code.google.com/r/millerlucas-dev/source/detail?r=821aba249949d0970b1114f
917480ee916355227

Currently the versions are resolved in the respective Foundation.h, instead of 
CMakeLists.txt, only because I haven't looked up the syntax in CMake yet.

Original comment by miller.lucas on 4 Mar 2011 at 2:07

GoogleCodeExporter commented 9 years ago

Original comment by miller.lucas on 4 Mar 2011 at 2:08

GoogleCodeExporter commented 9 years ago
Thanks, Lucas!  I have a question, though: each sub-library has its own 
separately-defined namespace, though they all seem to be "v1".  I had thought 
that "v1" would be defined Alembic-wide with a single name, like 
ALEMBIC_VERSION.  Is that crazy-talk?

Original comment by ard...@gmail.com on 4 Mar 2011 at 11:38

GoogleCodeExporter commented 9 years ago
That might not be crazy.
I only did it like that because of how AbcCoreAbstract was already setup, and 
thought that we might have a situation in which only one of the sub-libraries 
should be versioned up.

Should the namespaces instead be:

namespace Alembic {
namespace ALEMBIC_VERSION_NS {
namespace AbcCoreAbstract {
}
}
using namespace ALEMBIC_VERSION_NS;
}

Original comment by miller.lucas on 4 Mar 2011 at 11:59

GoogleCodeExporter commented 9 years ago
I was thinking it would be like:

namespace Alembic {
namespace AbcCoreAbstract {
namespace ALEMBIC_VERSION_NS {

...
}
}
}

Then in, eg, Abc, we'd say, "namespace AbcA = 
::Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS; using namespace AbcA;"

I dunno!  Either is fine!

Original comment by ard...@gmail.com on 5 Mar 2011 at 1:23

GoogleCodeExporter commented 9 years ago
Based on todays meeting I changed everything to use just one version namespace:
http://code.google.com/r/millerlucas-dev/source/detail?r=1696e2cdd61019bb67a4ade
7e42f87dac986e8ce

Right now I define it in Util/Foundation.h because I think everything 
eventually ends up including that.

Where should it go long term?  If it goes as into CMakeLists.txt as a 
preprocessor define, won't other external projects that use Alembic have to 
know about it so that they can also define it?

Original comment by miller.lucas on 15 Mar 2011 at 12:44

GoogleCodeExporter commented 9 years ago
Yeah, I think Util/Foundation.h is fine, or maybe some new header file that is 
intended to be included everywhere.

Thanks, Lucas.

Original comment by ard...@gmail.com on 15 Mar 2011 at 1:36