|
NX Open C++ 参考指南 2406 v1.1
|
许可证管理器 更多...
#include <LicenseManager.hxx>
类 | |
| struct | LicenseBundle |
Public 成员函数 | |
| bool | CheckPresence (const char *licenseName) |
| bool | CheckPresence (const NXString &licenseName) |
| std::vector< NXString > | GetActiveLicensesInABundle (const char *bundleName) |
| std::vector< NXString > | GetActiveLicensesInABundle (const NXString &bundleName) |
| std::vector< NXOpen::LicenseManager::LicenseBundle > | GetBundlesSelected () |
| std::vector< NXString > | GetBundlesUsed () |
| std::vector< NXString > | GetReservedLicenses (const char *contextName) |
| std::vector< NXString > | GetReservedLicenses (const NXString &contextName) |
| bool | IsCheckedOut (const char *license) |
| bool | IsCheckedOut (const NXString &license) |
| void | Release (const char *license, const char *contextName) |
| void | Release (const NXString &license, const NXString &contextName) |
| void | ReleaseAll (const char *contextName) |
| void | ReleaseAll (const NXString &contextName) |
| void | Reserve (const char *license, const char *contextName) |
| void | Reserve (const NXString &license, const NXString &contextName) |
| void | SetBundlesForUse (std::vector< NXString > &bundles) |
| tag_t | Tag () const |
许可证管理器
提供用于管理许可证的工具方法。
此类管理当前NX Open应用程序使用的许可证。不过,它也允许查询当前NX Open应用程序范围之外的信息;例如,许可证是否被交互式会话或其他自动化程序检出。
如果会话中加载了多个应用程序,每个应用程序将拥有自己独立的许可证管理器。两个应用程序可能会同时保留同一个许可证。尽管这只会从FLEX服务器中保留一个许可证,但该许可证只有在两个应用程序都释放后才会返回给服务器。
从NX6开始,引入了用户定义许可证上下文的概念。该概念为应用程序的许可证管理提供了更大的控制权。要了解有关此主题的更多信息,请参考NX Open程序员指南。所有用户定义的上下文名称长度最大为128个字符,且只能包含数字和字母。
NX主用户界面也会独立管理许可证。如果NX Open应用程序释放了“solid_modeling”许可证,但NX主界面仍在使用该许可证,则该许可证不会返回给服务器。
此类的方法使用许可证功能名称,该名称可在NX Open方法和属性的文档中找到。格式为 许可证要求:许可证功能名称 ("许可证描述")。例如,给定 许可证要求:solid_modeling ("SOLIDS MODELING"),则使用许可证功能名称 solid_modeling。
要获取此类的实例,请参考 NXOpen::Session
创建于NX4.0.0。
| bool NXOpen::LicenseManager::CheckPresence | ( | const char * | licenseName | ) |
判断指定许可证是否存在
| licenseName | 许可证名称 |
| bool NXOpen::LicenseManager::CheckPresence | ( | const NXString & | licenseName | ) |
判断指定许可证是否存在
| licenseName | 许可证名称 |
| std::vector< NXString > NXOpen::LicenseManager::GetActiveLicensesInABundle | ( | const char * | bundleName | ) |
获取给定包中已签出的许可证列表。
| bundleName | 包名称 |
| std::vector< NXString > NXOpen::LicenseManager::GetActiveLicensesInABundle | ( | const NXString & | bundleName | ) |
获取给定包中已签出的许可证列表。
| bundleName | 包名称 |
| std::vector< NXOpen::LicenseManager::LicenseBundle > NXOpen::LicenseManager::GetBundlesSelected | ( | ) |
获取当前所选许可证包的数组,形式为 LicenseManager::LicenseBundle 结构。
| std::vector< NXString > NXOpen::LicenseManager::GetBundlesUsed | ( | ) |
获取当前已签出许可证的包列表。
| std::vector< NXString > NXOpen::LicenseManager::GetReservedLicenses | ( | const char * | contextName | ) |
获取当前保留在上下文中的许可证。此方法还会在系统日志中输出默认上下文中保留的许可证。
| contextName | 要获取的上下文名称。如果指定 NULL,则使用默认上下文。 |
获取当前保留在上下文中的许可证。此方法还会在系统日志中输出默认上下文中保留的许可证。
| contextName | 要获取的上下文名称。如果指定 NULL,则使用默认上下文。 |
| bool NXOpen::LicenseManager::IsCheckedOut | ( | const char * | license | ) |
如果许可证在任何自动化上下文或交互式UI中已签出,则返回true。此方法仅返回许可证是否已保留,但不返回保留许可证的上下文。要查看许可证是否在程序上下文保留,请使用NXOpen::LicenseManager::GetReservedLicenses。
| license | 要保留的许可证功能名称 |
| bool NXOpen::LicenseManager::IsCheckedOut | ( | const NXString & | license | ) |
如果许可证在任何自动化上下文或交互式UI中已签出,则返回true。此方法仅返回许可证是否已保留,但不返回保留许可证的上下文。要查看许可证是否在程序上下文保留,请使用NXOpen::LicenseManager::GetReservedLicenses。
| license | 要保留的许可证功能名称 |
| void NXOpen::LicenseManager::Release | ( | const char * | license, |
| const char * | contextName ) |
针对指定的许可证上下文释放许可证。
在 NX6.0.0 中创建。
许可证要求:无
| license | 要释放的许可证功能名称 |
| contextName | 释放许可证时关联的上下文名称。如果指定 NULL,则使用默认上下文。 |
针对指定的许可证上下文释放许可证。
在 NX6.0.0 中创建。
许可证要求:无
| license | 要释放的许可证功能名称 |
| contextName | 释放许可证时关联的上下文名称。如果指定 NULL,则使用默认上下文。 |
| void NXOpen::LicenseManager::ReleaseAll | ( | const char * | contextName | ) |
释放指定许可证上下文中的所有许可证。如果指定的上下文是用户定义的上下文,则会删除该上下文。
在 NX6.0.0 中创建。
许可证要求:无
| contextName | 要释放的上下文名称。如果指定 NULL,则使用默认上下文。 |
| void NXOpen::LicenseManager::ReleaseAll | ( | const NXString & | contextName | ) |
释放指定许可证上下文中的所有许可证。如果指定的上下文是用户定义的上下文,则会删除该上下文。
在 NX6.0.0 中创建。
许可证要求:无
| contextName | 要释放的上下文名称。如果指定 NULL,则使用默认上下文。 |
| void NXOpen::LicenseManager::Reserve | ( | const char * | license, |
| const char * | contextName ) |
针对指定的许可证上下文保留许可证。如果指定的用户定义上下文不存在,则会创建该上下文。
在 NX6.0.0 中创建。
许可证要求:无
| license | 要保留的许可证功能名称 |
| contextName | 保留许可证时关联的上下文名称。如果指定 NULL,则使用默认上下文。 |
针对指定的许可证上下文保留许可证。如果指定的用户定义上下文不存在,则会创建该上下文。
在 NX6.0.0 中创建。
许可证要求:无
| license | 要保留的许可证功能名称 |
| contextName | 保留许可证时关联的上下文名称。如果指定 NULL,则使用默认上下文。 |
| void NXOpen::LicenseManager::SetBundlesForUse | ( | std::vector< NXString > & | bundles | ) |
更改现有的许可证包选择。 如果包切换失败(原因是正在使用的许可证在新包中不可用),则会返回错误,且包配置不会更改。
在 NX11.0.0 中创建。
许可证要求:无
| bundles | 包按指定的顺序设置 |
| tag_t NXOpen::LicenseManager::Tag | ( | ) | const |
获取此对象的标签。