VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
16.1 - Readable, Writable Objects

VR-Forces uses the object parameter database, various configuration files, and scenario files to store information it needs to load scenarios, instantiate objects, and represent objects in the GUI.

(For details about the object parameter database, please see 3.3.2 Object Parameters.) To enable objects to be written to a file and read from a file, VR-Forces uses a class called DtReaderWriter (rdrWritr.h), which all readable, writable objects derive from.

DtReaderWriter provides four member functions - putSelf(), putData(), getSelf(), and getData() that read and write the object. Normally, putSelf() and getSelf() do not need to be overridden. Override getData() and putData() when you need to put and get class-specific data.

DtReaderWriter uses the VT MAK Lisp (MTL) file mechanism for parsing the files it reads. To do so, data must be written in list format. Every readable, writable object has a name, which is used as the first element of the list. The name is provided to the constructor of DtReaderWriter. (A DtReaderWriter object that is going to be read can be specified with a null string as its name. When the object is read, it gets the name specified in the file.)

[Home] [Writing Data to a File >>]


Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)