dca_interface  6.3.4
generic_samples: getversionsample

Introduction

This sample shows how to obtain all version numbers of the initialized DCA classes and how to print them out.

You may extend the sample simply by initializing more DCA modules.

Then you will get more version information about these additional modules.

It also shows how to use the classes:

Syntax:

getversionsample <dca-redist-folder> <ticket> <product>
See also
Samples Main Documentation: Samples

Files

file  generic_samples/getversionsample/main.cpp
 GetVersion DCA sample.
 

Macros

#define DCA_BINDIR   "bin/linux"
 DCA subdirectory of the DCA binaries.
 
#define DCA_INITDIR   "init"
 DCA subdirectory of the DCA initialization data.
 
#define DCA_LOGDIR   "./logs"
 Relative directory for logfile(s).
 

Functions

static void SetupInitData (const std::string &redist_folder, InitData &initData)
 Sets up the given initData by substituting the given redist_folder with DCA subdirectories. More...
 
static void SetupLicense (const std::string &ticket, const std::string &product, LicenseData &licenseData)
 Sets up the given licenseData by copying the given ticket and product strings. More...
 
static void PrintLicenseInfo (const License &aLicense)
 Prints out the information about the provided License. More...
 
static void PrintVersion (const VersionInfoResults &aVersionInfoResults)
 Prints out the version information gathered from current DcaInstance. More...
 
static void PrintToolHeader ()
 Prints out the name and the version of this sample.
 
static void PrintUsage (const char *name)
 Prints out the syntax of the sample. More...
 
int main (int argc, char *argv[])
 The main routine. More...
 

Variables

const std::string S_UsageString
 Usage string, displayed if a parameter is missing. More...
 

Function Documentation

◆ SetupInitData()

static void SetupInitData ( const std::string &  redist_folder,
InitData initData 
)
static

Sets up the given initData by substituting the given redist_folder with DCA subdirectories.

Parameters
[in]redist_folderThis is the folder where the DCA has been installed to (assuming trailing fileslash)
[out]initDataThe InitData structure to set up
Note
Only DCA_BINDIR differs between Windows and Linux
The directory ./logs is used for the logfile(s)

Definition at line 88 of file generic_samples/getversionsample/main.cpp.

◆ SetupLicense()

static void SetupLicense ( const std::string &  ticket,
const std::string &  product,
LicenseData licenseData 
)
static

Sets up the given licenseData by copying the given ticket and product strings.

Parameters
[in]ticketThis is the ticket data as provided with your DCA license
[in]productThis is the product shortcut e.g. DC oder MS etc
[out]licenseDataThe LicenseData structure to set up

Definition at line 102 of file generic_samples/getversionsample/main.cpp.

◆ PrintLicenseInfo()

static void PrintLicenseInfo ( const License aLicense)
static

Prints out the information about the provided License.

Parameters
[in]aLicenseThe license for which information should be displayed.

Definition at line 114 of file generic_samples/getversionsample/main.cpp.

◆ PrintVersion()

static void PrintVersion ( const VersionInfoResults aVersionInfoResults)
static

Prints out the version information gathered from current DcaInstance.

Parameters
[in]aVersionInfoResultsThe result of a DcaInstance::getVersionInfo() call

Definition at line 141 of file generic_samples/getversionsample/main.cpp.

◆ PrintUsage()

static void PrintUsage ( const char *  name)
static

Prints out the syntax of the sample.

Parameters
[in]nameThe name of the executable

Definition at line 188 of file generic_samples/getversionsample/main.cpp.

◆ main()

int main ( int  argc,
char *  argv[] 
)

The main routine.

Parameters
[in]argcThe count of arguments provided
[in]argvAn array of provided arguments
Returns
5 on usage error, 10 on exception and internal error and 0 on success

Definition at line 201 of file generic_samples/getversionsample/main.cpp.

Variable Documentation

◆ S_UsageString

const std::string S_UsageString
Initial value:
=
"<dca-redist-folder> <ticket> <product>\n"
" dca-redist-folder - the folder where the DCA is installed to\n"
" ticket - a valid ticket\n"
" product - the product associated with your ticket\n\n"

Usage string, displayed if a parameter is missing.

Definition at line 52 of file generic_samples/getversionsample/main.cpp.