|Creating Interreality: The Virtual Object System: Version 0.23.0|
|Prev||Chapter 5. VOS Programming in C++||Next|
As an aid to prevent redundant frustration, here is a list of common VOS programming errors. If you have encountered an annoying error that you think might plague others (especially newbies), please post it in the VOS discussion forum or mailing list at interreality.org.
All objects must have access control, and all properties must have property access control. Typically access control on new objects is set from its site's default access control policy. See the API reference documentation and the tutorials for more information about access control.
Many MetaObjects (e.g. A3DL) have required subproperties. Applications will assume these properties exist. Make sure you set those subproperties immediately after creating the object. Some MetaObjects have an initialize() method which will set all non-optional subproperties to default values. Applications should catch the exception Vobject::NoSuchObjectError when attempting to access optional subproperties.
An object can be a child of only one, local site, and cannot be the child of that or any other site under any name. In other words, this is illegal:
MetaObject* c = site.createMetaObject( "foo", ... ); site.insertChild(-1, "bar", c);