ODA Product: | ODA PRC SDK |
Sample Name: | Common |
Categories: | C++ / Beginner, Advanced / Working with .prc files / Android, iOS, macOS, Linux, Windows |
Source Code Location: | Prc/Examples/Common |
These files contain custom service class definitions and functions for custom assertions, local time freezing, and console printing.
The custom service class combines platform-dependent functionality of the OdRxSystemServices and OdPrcHostAppServices classes and allows custom applications based on ODA PRC SDK to interact with core ODA Platform functionality.
The functionality implemented in PrcExamplesCommon.h and PrcWithTDExamplesCommon.h is described below.
The PrcExamplesCommon.h file contains definitions and declarations for the following elements:
extern FIRSTDLL_EXPORT_STATIC PgetLocalTime g_pLocalTimeFunc; static void getLocalTime(OdTimeStamp &localTime) { localTime.setDate(12, 22, 2009); localTime.setTime(18, 0, 0, 0); }
Then in a custom application, set a new value for the g_pLocalTimeFunc variable:g_pLocalTimeFunc = getLocalTime;
The function accepts a reference to an OdTimeStamp object to return a custom date and time value.
Most of the methods in the MyService class contain only a default implementation and therefore are available for custom implementation in derived classes.
The PrcWithTDExamplesCommon.h file contains definitions and declarations that are useful for creating custom applications based on both ODA Platform and ODA PRC SDK products.
The MyServicesBase class combines platform dependent, progress metering and system operation functionality for ODA Platform and ODA PRC SDK by providing the ability to create a derived class with custom implementation.
All ODA PRC SDK console sample applications have a similar structure, and in most cases differ only with the source code used to implement specific functionality.
First, sample application source code is allocated in one .cpp file. This file contains a platform-dependent definition of the main() function. The name of the .cpp file usually matches the sample application name. For example, OdPrcToXml.cpp is the main file of the OdPrcToXml sample application. The main() function contains a set of actions that are run before and after a code fragment that illustrates a feature. Below is the common structure of a ODA PRC SDK console sample application:
ODA PRC SDK Sample Applications
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|