Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoLicensesInfo Class Reference

VSG extension Class managing every licensed product. More...

#include <Inventor/lock/SoLicensesInfo.h>

Public Member Functions

unsigned int getProductCount () const
 Gets number of licensed products.
 
const SoLicensedProductgetLicensedProductByIndex (unsigned int index) const
 Gets the licensed product corresponding to the given index.
 
const SoLicensedProductgetLicensedProduct (SoLicensedProduct::SbProduct prod) const
 Gets the licensed product corresponding to the given SoLicensedProduct::SbProduct.
 
void registerExpirationCallback (SoLicensesCB *cb)
 Sets the callback to call when a license is expired.
 
void registerWarningCallback (int nbDaysBeforeExpiration, SoLicensesCB *cb)
 Sets the callback to call when a license date of expiration is lower than nbDayBeforeExpiration.
 

Static Public Member Functions

static SoLicensesInfogetInstance ()
 Returns SoLicensesInfo singleton.
 
static const char * getVersion ()
 Returns a character string identifying the version of the Open Inventor library in use.
 
static float getLicensingVersionNumber ()
 Returns the current version number as a float for license checking.
 
static int check (const char *productName, float version, const char *licenseString=NULL, SbBool printWarning=TRUE, char **errReport=NULL)
 Query if Open Inventor or an extension module is licensed on this machine.
 

Detailed Description

VSG extension Class managing every licensed product.

SoLicensesInfo manages licensed products. SoLicensesInfo::setCallback(SoLicensesCB*) deactivates the default message box to call the specified callback.

Version Number: You can query the Open Inventor version number as a string using the getVersion() method or as a floating point value using the getLicensingVersionNumber() method. You can find other integer and string constants in SoVersion.h. For example SO_INVENTOR_VERSION can be used with preprocessor directives to isolate version specific code. It encodes the major, minor and patch numbers as an integer. For example "9400" for version 9.4.

Definition at line 58 of file SoLicensesInfo.h.

Member Function Documentation

◆ check()

static int SoLicensesInfo::check ( const char *  productName,
float  version,
const char *  licenseString = NULL,
SbBool  printWarning = TRUE,
char **  errReport = NULL 
)
static

Query if Open Inventor or an extension module is licensed on this machine.

Returns
< 0 If product or version is NOT licensed on this machine.
>= 0 If product and version are licensed and can be used.

Note: If productName is "ScaleViz" and ScaleViz is licensed on this machine. Then the return value is the number of render nodes allowed.

Parameters
productName: Product to be licensed (no blanks), e.g. OpenInventor or VolumeVizLDM.
version: Version to be licensed (see getLicensingVersionNumber).
licenseString: (optional) Embedded application password string, if any.
printWarning: If true, error and warning messages (if any) will be displayed to user.
errReport: If not NULL, will be set to point to the text of the error or warning messages (if any).
Note! This address is an internal static buffer and must not be freed by the application.

FlexNet Notes:

  • Before checking for a FlexNet license token, SoLicensesInfo::check will automatically append "SDK" to the productName when you need an SDK license to run on the current machine.

◆ getInstance()

static SoLicensesInfo & SoLicensesInfo::getInstance ( )
static

Returns SoLicensesInfo singleton.

◆ getLicensedProduct()

const SoLicensedProduct * SoLicensesInfo::getLicensedProduct ( SoLicensedProduct::SbProduct  prod) const

Gets the licensed product corresponding to the given SoLicensedProduct::SbProduct.

If the given product is invalid, the method returns NULL.

◆ getLicensedProductByIndex()

const SoLicensedProduct * SoLicensesInfo::getLicensedProductByIndex ( unsigned int  index) const

Gets the licensed product corresponding to the given index.

If the given index is greater than the value returned by getProductCount(), the method returns NULL.

◆ getLicensingVersionNumber()

static float SoLicensesInfo::getLicensingVersionNumber ( )
static

Returns the current version number as a float for license checking.

The integer part of the float is the year of the published version and the floating part is 1 or 2 for the version first or second version of the year. For example 2023.2.7 will be returned as 2023.2, which corresponds to the 2nd version of OpenInventor in 2023. See method check for usage of this number.

If you need a descriptive string see getVersion. If you just need the version number as an integer or string, see the macros in SoVersion.h.

◆ getProductCount()

unsigned int SoLicensesInfo::getProductCount ( ) const

Gets number of licensed products.

◆ getVersion()

static const char * SoLicensesInfo::getVersion ( )
static

Returns a character string identifying the version of the Open Inventor library in use.

For example 2023.2.7 for the second version of OIV in 2023 and the 7th patch version.

For a floating point version number see getLicensingVersionNumber. For integer and string constants, see SoVersion.h.

◆ registerExpirationCallback()

void SoLicensesInfo::registerExpirationCallback ( SoLicensesCB cb)

Sets the callback to call when a license is expired.

If a callback is registered, the default message box will not be displayed.

◆ registerWarningCallback()

void SoLicensesInfo::registerWarningCallback ( int  nbDaysBeforeExpiration,
SoLicensesCB cb 
)

Sets the callback to call when a license date of expiration is lower than nbDayBeforeExpiration.

If a callback is registered, the default message box will not be displayed.


The documentation for this class was generated from the following file: