HxVersion Class

class HxVersion

Version, license and copyright info.

Summary

Functions

getMajorVersionNumber

Returns Hexaly Optimizer major version number.

getMinorVersionNumber

Returns Hexaly Optimizer minor version number.

getBuildDate

Returns Hexaly Optimizer build date.

getPlatform

Returns the platform of the Hexaly Optimizer binary as a string.

getVersion

Returns Hexaly Optimizer version as a string.

getVersionCode

Returns Hexaly Optimizer version code as an integer in the range [0, 29999].

getCopyright

Returns Hexaly Optimizer copyright as a string.

getInfo

Returns version and copyright info as a string.

getLicensePath

Returns the license path of Hexaly Optimizer.

setLicensePath

Change the license path used by Hexaly Optimizer.

getLicenseContent

Returns the license content previously set with setLicenseContent() or the HX_LICENSE_CONTENT environment variable.

setLicenseContent

Change the license content.

Functions

static int HxVersion::getMajorVersionNumber()

Returns Hexaly Optimizer major version number. This number is an integer in the range [0, 2999].

Returns:

Major version number.

static int HxVersion::getMinorVersionNumber()

Returns Hexaly Optimizer minor version number. This number is an integer in the range [0, 9].

Returns:

Minor version number.

static int HxVersion::getBuildDate()

Returns Hexaly Optimizer build date. This number is an integer YYYYMMDD with YYYY the year, MM the month, DD the day.

Returns:

Build date.

static std::string HxVersion::getPlatform()

Returns the platform of the Hexaly Optimizer binary as a string. The format of the string is PPPPXX where PPPP is the platform (Win, Linux or MacOS) and XX is the architecture (32 or 64 bits).

Returns:

Platform as string.

Since:

3.0

static std::string HxVersion::getVersion()

Returns Hexaly Optimizer version as a string. The format of the string is: MA.MI.YYYYMMDD-PPPPXX with MA the major number version, MI the minor number version, YYYY the year, MM the month, DD the day, PPPP the platform (Win, Linux or MacOS) and XX the architecture.

Returns:

Version as string “MA.MI.YYYYMMDD-PPPPXX”.

static int HxVersion::getVersionCode()

Returns Hexaly Optimizer version code as an integer in the range [0, 29999]. The version code is computed as follows: MA * 10 + MI with MA the major number version, MI the minor number version. Note that the version code can be encoded as a 16-bit integer.

Returns:

Version code.

static std::string HxVersion::getCopyright()

Returns Hexaly Optimizer copyright as a string.

Returns:

Copyright notice.

static std::string HxVersion::getInfo()

Returns version and copyright info as a string.

Returns:

Version and copyright info.

static std::string HxVersion::getLicensePath()

Returns the license path of Hexaly Optimizer. By default, Hexaly Optimizer looks for a license file in the following locations, in that order:

  1. A file specified by a call to setLicensePath().

  2. The HX_LICENSE_PATH environment variable.

  3. The deprecated LS_LICENSE_PATH environment variable.

  4. A license.dat file in the current directory.

  5. In the default global location (c:\\hexaly\\license.dat on

    Windows, /opt/hexaly/license.dat on Linux and macOS.

  6. In the deprecated LocalSolver global location

    (c:\localsolver\license.dat on Windows, /opt/localsolver/license.dat on Linux and macOS).

For windows users: If you used the installer to setup Hexaly, the HX_LICENSE_PATH environment variable is already defined and points to the license file present in the installation folder.

Note: The license content can also be set directly with setLicenseContent() or with the HX_LICENSE_CONTENT environment variable and this definition will have priority over the license file. The old environment variable LS_LICENSE_CONTENT can also be used, but its usage is deprecated.

Returns:

Path to the license

See:

HxVersion::setLicensePath()

See:

HxVersion::getLicenseContent()

See:

HxVersion::setLicenseContent()

Since:

3.0

static void HxVersion::setLicensePath(const std::string &licensePath)

Change the license path used by Hexaly Optimizer.

Parameters:

licensePath – new path for the license

See:

HxVersion::getLicensePath()

See:

HxVersion::setLicenseContent()

See:

HxVersion::getLicenseContent()

Since:

3.0

static std::string HxVersion::getLicenseContent()

Returns the license content previously set with setLicenseContent() or the HX_LICENSE_CONTENT environment variable.

See:

HxVersion::setLicenseContent()

See:

HxVersion::getLicensePath()

See:

HxVersion::setLicensePath()

Since:

5.0

Returns:

The content of the license or an empty string if the content was not set.

static void HxVersion::setLicenseContent(const std::string &licenseContent)

Change the license content. By default, Hexaly Optimizer tries to get the license content from the HX_LICENSE_CONTENT environment variable or from the file path specified in setLicensePath() or in a default location. Use this function to set the license content directly, without using a file.

Parameters:

licenseContent – content of the license to use.

See:

HxVersion::getLicenseContent()

See:

HxVersion::setLicensePath()

See:

HxVersion::getLicensePath()

Since:

5.0