Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[CONNECT C++] unorthodox type names

$
0
0

A feature of the MicroStationAPI is the thought given to standardising type names.  For example, the humble DPoint3d leads to const and non-const pointers and references pre-defined as DPoint3dP, DPoint3dCP, DPoint3dR and DPoint3dCR.  The Ptr suffix is ubiquitous to denote a ref-counted class derived from IRefCounted.

Those conventions mean that, most of the time, we can take a guess at the name of a class pointer or reference type without having to consult the MicroStationAPI documention.

I have noted some dusty corners of the API where naming conventions were overlooked.  For example...

AnimCore\AnimationCollections.h(323): typedef bvector<DPoint3d>       DPoint3dVec;
DgnPlatform\LabelHandler.h(36): typedef bvector<DPoint3d>             StdDPointVector;
DgnPlatform\NoteHandler.h(38): typedef bvector<DPoint3d>              StdDPointVector;
DgnPlatform\SectionClip.h(94): typedef bvector<DPoint3d>              DPoint3dVector;
DgnPlatform\SymbologyReporter.h(56): typedef bvector<DPoint3d>        T_StdDPoint3dVector;

That is, there are four different names for a Bentley vector of DPoint3d.  Those having Std in the name are misleading, because Bentley vector is not part of the C++ standard library (i.e. they don't live in the std:: namespace).  Why not say BentleyDPoint3dVector and include it in one of the header files that introduce all those other useful typedefs?


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>