As described in the Users_Guide page, the database schema consists of a set of classes (tables) containing fields (columns) and indexes that implement the application's information model . For C++ applications, the schema is defined, and the generated header and implementation files are incorporated into the project, exactly as for C applications. (Please see the C Schema Definition page for further details).
However, additional C++ class implementation can be generated by the schema compiler and the class implementation can be optionally incorporated into the C++ application.
Compiling the schema
As explained for C applications, the schema file is compiled by the
mcocomputility found in theeXtremeDB/host/bindirectory of the eXtremeDB installation. To generate additional C++ class implementation, the-hpp,-c++and-smartptroptions can be specified when callingmcocomp. When either-hppor-c++are specified an additional<database_name>.hppfile will be generated containing the class implementations. The-smartptroption causesmcocompto generate code that makes database fields appear effectively as classproperties. This allows applications to access object fields in a С++ fashion, usingsettersandgetters, as opposed to using theC API_put()and_get()functions.For example, instead of:
anObject.aField_get(&value)); anObject.aField_put(1));Using a smart pointer this can be written as:
value = anObject.aField; anObject.aField = 1;
Note that the generated
.hand.cfiles, and optionally the.hppfile, must be included also in eXtremeSQL applications - even if all access to the eXtremeDB database will be through SQL only.