![]() |
VR-Vantage 3.2 API Documentation
|
This section describes the conventions used in the VR-Vantage Toolkitfor including files and using namespaces.
All header files include the directory path relative to the include directory. For example, the file ./include/makVrv/DtDe.h is included using the include line
The forward slash is used to ensure cross-platform compatibility. The convention is also followed by OpenSceneGraph and Boost.
All VR-Vantage Toolkitclasses are in the makVrv namespace. When referring to a class in a header file, you must specify the namespace.
To predeclare a class in a header file, use the following syntax:
To use a class in a header file, use the following syntax:
When writing code in a source file, either specify the namespace with the type or use the using namespace declaration, as follows:
or:
Most libraries have a secondary namespace that is used when there are duplicate names, such as the standard init() functions, or in the protocol-specific libraries when they share the same source code. The name of the secondary namespace matches the name of the library.
For example, vrvCoreQt has the secondary namespace vrvCoreQt, which has the library's init() function. To initialize the vrvCoreQt library, use the following code:
The VR-Vantage Toolkitfollows the standard MAK policy of prefixing all classes with "Dt".
All functions, variables, and enumerations are inside classes. Subtypes and enumerations do not get a leading Dt. All class member variables start with the word "my". All class static variables start with the word "the".
The VR-Vantage Toolkituses the following conventions for naming functions:
Functions that set the internal state of an object start with the word "set", for example:
Functions that return a value through a passed reference start with the word "get":
Functions that return a valid state value in the return type use the name of the value without any qualifying verb, for example:
Functions that return an object that may not be valid start with the word "find", for example:
The use of find is to encourage testing the validity of a variable that might be invalid. Functions that return potentially invalid variables through references and return a boolean can also use the word find.
Functions that delete or destroy an object contain the word "destroy", for example:
Functions that remove an object from another object's internal management contain the word "remove", for example:
This may assume a transfer of ownership if the second object was the sole manager of the first object.
Most signals that are based on Boost start with the prefix "signal_". Signals that occur before an event contain the words ToBe and then the event, for example:
[<< VR-Vantage Toolkit Libraries] [Home] [Top of Page] [The Qt Toolkit >>]