C++ Development

On this page:

HP Omnicept Client Samples

These samples demonstrate how to set up a C++ project to interact with HP Omnicept. These samples are located at the SDK installation path, you will need to move the omnicept-client samples directory from the HP Omnicept SDK install location to a designated workspace on your system

Prerequisites

Windows 10, version 1809 or higher
Visual Studio 2019
CMake 3.14 or higher (with cmake-gui)

Overview

The omnicept-client-samples directory contains the following samples.

omnicept-setup

Demonstrates how to set up an Omnicept SDK C++ project, and how to utilize the Omnicept SDK C++ library and interfaces.

omnicept-licensing

Demonstrates how to set up an Omnicept SDK C++ project, and add code to connect to Omnicept using a license.

omnicept-lvc

Demonstrates how to set up an Omnicept SDK C++ project, add code to connect to Omnicept using a license, and receive Omnicept messages from the Omnicept Client's Last Value Cached (LVC) when prompted.

omnicept-callback

Demonstrates how to set up an Omnicept SDK C++ project, add code to connect to Omnicept using a license, and receive Omnicept messages from the Omnicept Client's callback functions.

omnicept-subscriptions

Demonstrates how to set up an Omnicept SDK C++ project, add code to connect to Omnicept using a license, to subscribe to CognitiveLoad messages and print the subscription result.

Directory structure

omnicept-client-samples
+--- CMakeLists.txt                 # Used to generate project files for samples
+--- README.md                      # This file
+--- omnicept-licensing             # Contains source code for omnicept-licensing
|    +--- CMakeLists.txt
|    \--- OmniceptLicensing.cpp
+--- omnicept-lvc                   # Contains source code for omnicept-lvc
|    +--- CMakeLists.txt
|    \--- OmniceptLvc.cpp
+--- omnicept-callback              # Contains source code for omnicept-callback
|    +--- CMakeLists.txt
|    \--- OmniceptCallback.cpp
+--- omnicept-subscriptions         # Contains source code for omnicept-subscriptions 
| +--- CMakeLists.txt 
| \--- OmniceptSubscriptions.cpp
+--- omnicept-setup                 # Contains source code for omnicept-setup
|    +--- CMakeLists.txt
|    \--- OmniceptSetup.cpp
\--- omnicept-shared                # Contains source code for shared by samples
     +--- CMakeLists.txt
     +--- ClientBuilderHelper.cpp
     +--- ClientBuilderHelper.h
     +--- SessionLicenseHelper.cpp
     \--- SessionLicenseHelper.h

Building Samples

  1. Move the omnicept-client-samples directory from the HP Omnicept SDK install location to a designated workspace on your system

  2. Open the CMake GUI

    1. Set the path to source code by browsing to the new location of the omnicept-client-samples directory on your system

    2. Set the build location by adding build onto the end of the source code path

    3. Click Configure (be sure to select x64 as platform for generator, select Yes when prompted if CMake should create build directory)

    4. Click Generate

    5. Click Open Project (this should open the generated solution file in Visual Studio)

  3. Once in Visual Studio

    1. Select a configuration (Debug or Release)

    2. Build Solution

These steps should create the following structure within omnicept-client-samples directory.

omnicept-client-samples
\--- build                                            # Contains built executable files and libraries
     +--- omnicept-client-samples.sln              # Visual Studio solution file
     +--- omnicept-licensing
     |    +--- Debug
     |    |    \--- omnicept-licensing.exe
     |    \--- Release
     |         \--- omnicept-licensing.exe
     +--- omnicept-lvc
     |    +--- Debug
     |    |    \--- omnicept-lvc.exe
     |    \--- Release
     |         \--- omnicept-lvc.exe
     +--- omnicept-callback
     |    +--- Debug
     |    |    \--- omnicept-callback.exe
     |    \--- Release
     |         \--- omnicept-callback.exe
     +--- omnicept-subscriptions
     |    +--- Debug
     |    |    \--- omnicept-subscriptions.exe
     |    \--- Release
     |         \--- omnicept-subscriptions.exe  
     +--- omnicept-setup
          +--- Debug
          |    \--- omnicept-setup.exe
          \--- Release
               \--- omnicept-setup.exe

Running Samples

As mentioned above, there will be executable files generated by the HP Omnicept Client Samples source code. You can run each in the following manner.

omnicept-setup.exe
omnicept-licensing.exe --clientId <client id> --accessKey <access key> --licenseModel <license model number=[ 1|2|3|4 ]>
omnicept-lvc.exe --clientId <client id> --accessKey <access key> --licenseModel <license model number=[ 1|2|3|4 ]>
omnicept-callback.exe --clientId <client id> --accessKey <access key> --licenseModel <license model number=[ 1|2|3|4 ]>
omnicept-subscriptions.exe --clientId <client id> --accessKey <access key> --licenseModel <license model number=[ 1|2|3|4 ]>

License model option

  • 1 => CORE (default)
  • 2 => TRIAL
  • 3 => ENTERPRISE
  • 4 => REV_SHARE