nightstyles / alembic

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

Remove "using namespace" statements from header files, and add explicit namespace qualifications for out-of-library argument and return types #94

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Libraries in the higher layers of Alembic (eg, Abc, AbcGeom) have "using 
namespace ::Alembic::*" where '*' is AbcCoreAbstract, etc. in their 
Foundation.h header files.  These statements are scoped inside their 
appropriate namespaces, so no new typeids are introduced, and this enables the 
omission of explicit namespace qualifications for lower-level types, eg, in the 
Abc namespace, you can refer to simply "ArraySample" or "MetaData" without 
saying "::Alembic::AbcCoreAbstract::v1::ArraySample".

However, this brevity in typing comes at the cost of increasing the learning 
curve for people trying to use the library; if something in AbcGeom returns a 
V3fArraySamplePtr, it's not obvious that it's coming from ::Alembic::Abc (and 
then when looking in Abc, it's not obvious that ArraySample comes from 
AbcCoreAbstract).

So instead of that, we will establish the following namespace aliases as 
standard:

AbcA = ::Alembic::AbcCoreAbstract::v1
AbcG = ::Alembic::AbcGeom

and then in library header files, argument and return types would be, eg:

const AbcA::MetaData& Abc::IObject::getMetaData();

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

GoogleCodeExporter commented 9 years ago
This has been done in the "joemetry" branch.  Assigning to Lucas to verify and 
close.

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

GoogleCodeExporter commented 9 years ago
Namespaces are there, and everything is working as we currently expect it to.

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