Класс Pzl: различия между версиями

Материал из wikiru.visual-prolog.com

Строка 11: Строка 11:
=Домены=
=Домены=


pzlDomains::pzlComponentsRegisterFileName_D  
pzlDomains::pzlComponentsRegisterFileName_D
 
pzlDomains::pzlContainerContentInfo_D
pzlDomains::pzlContainerContentInfo_D
pzlDomains::entityUID_D
pzlDomains::entityUID_D



Версия 09:24, 8 октября 2007

Назначение

Класс pzl предназначен для обеспечения работы с pzl-компонентами и получения информации о состоянии pzl-системы. Этот класс обязательно должен включаться в проект любой pzl-компоненты и главного приложения, генерирующего исполняемый (.EXE) файл, даже если нет необходимости обращения к предикатам этого класса.

Обращения к предикатам этого класса возможны из любого класса, включенного в проект, использующий pzl-технологию.

Имплементация класса pzl содержится:

  • в случае pzl-контейнера (DLL) в библиотеке pzlContainer_YY.lib
  • в случае главного приложения в библиотеке pzlPort_XX.lib

здесь YY и XX - уровень лицензии.

Домены

pzlDomains::pzlComponentsRegisterFileName_D

pzlDomains::pzlContainerContentInfo_D

pzlDomains::entityUID_D

Список предикатов класса

classInfo.
Получение информации о версии и дате последнего изменения класса Pzl
Информация о контейнере
getContainerName:()->string ThisContainerName procedure ().
Получить имя файла-контейнера, в котором находится данная компонента
getContainerVersion:()->string ThisContainerVersion procedure ().
Получить идентификатор версии контейнера, в котором находится данная компонента
getLicenseLevel:()->string PZLUserLicenseLevel procedure ().
Получить значение уровня лицензии контейнера, в котором находится данная компонента
getComponentRegisterFileName:()->pzlDomains::pzlComponentsRegisterFileName_D ComponentRegisterFileName procedure ().
Получить имя файла-реестра компонент, назначенного для данного приложения
getContainerContentList:(string PZLContainerFileName)->pzlDomains::pzlContainerContentInfo_D ContentInfo procedure (i).
Получить список компонент, содержащихся в контейнере с заданным именем
Управление компонентами
newByID:(pzlDomains::entityUID_D,object InObject)->object OutObject.
Создать новый объект, используя уникальный идентификатор компоненты
newByName:(string Name,object InObject)->object OutObject procedure (i,i).
Создать новый объект, используя имя компоненты
setStdOutputStream:(outputStream OutputStream).
Назначить заданный выходной поток в качестве стандартного выходного потока для всех компонент, используемых данным приложением
Регистрация объектов
register:(string ObjectName,object Object) procedure (i,i).
Зарегистрировать объект под указанным именем ObjectName (однократно)
registerMulti:(string ObjectName,object Object) procedure (i,i).
Зарегистрировать объект под указанным именем ObjectName (возможно, многократно)
getObjectByName_nd:(string ObjectName)->object Object nondeterm (i).
Получить объект, зарегистрированный под указанным именем ObjectName
getNameByObject_nd:(object Object)->string ObjectNameLow nondeterm (i).
Получить регистрационное имя объекта
getNameAndObject_nd:(string ObjectName,object Object) nondeterm (o,o).
Получить имя объекта и сам объект
unRegister:(string ObjectName,object Object) procedure (i,i).
Снять с регистрации объект Object с указанным именем ObjectName
unRegisterByName:(string ObjectName) procedure (i).
Снять с регистрации все объекты с указанным именем ObjectName
unRegisterByObject:(object Object) procedure (i).
Снять с регистрации объект Object
unRegisterAll:() procedure ().
Очистить регистр объектов (снять с регистрации все объекты)
Служебные предикаты. Не документируются
releaseInactiveContainers:().
getContainerActivity_nd:(string FileName,unsigned RefCounter) nondeterm (o,o).
getContainerToBeUnloaded_nd:(string FileName) nondeterm (o).
subscribe:(notificationAgency::notificationListener NotificationListener).
unSubscribe:(notificationAgency::notificationListener NotificationListener).
newInstance:().
release:().

Используемые дополнительные ресурсы

Обязательно:

  • использование библиотеки pzlPort_XX.lib, где XX - квалификатор лицензии. Библиотека фактически содержит имплементацию класса pzlPort и включает имплементацию свойств pzl-Контейнера главного исполняемого приложения.
  • наличие пакета pzlConfig, который участвует в процессе инициализации.

Описание предикатов

predicates
    classInfo : core::classInfo.
    % @short Class information  predicate.
    % @detail This predicate represents information predicate of this class.
    % @end
 
predicates
    getContainerName:()->string ThisContainerName procedure ().
    % @short get the file name of the pzlContainer, in which the given class is placed
    % @detail Returnes the name (full path) of the file, where the given pzlComponent is placed.<br>
    % example:<br>
    %  ...<br>
    %  ContainerName=pzl:getContainerName(),<br>
    %  stdIO::writef("The component "MyComponent" placed in the Container %",ContainerName),<br>
    %  ...
    % @exception No special exception generated by the PzlSystem<br>
    % @end
 
predicates
    getContainerVersion:()->string ThisContainerVersion procedure ().
    % @short get the version of the current pzlContainer, in which the given class is placed
    % @detail Returnes the version of the pzlContainer, where the given pzlComponent is placed.<br>
    % The version of the pzlContainer is of string type and is defined by the constant "pzlContainerVersion_C" in the file iPzlConfig.i 
    % of the pzlContainer's Project<br>
    % example:<br>
    %  the file iPzlCongig.i of the given pzlContainer contains the declaration of the constant<br>
    %   constants<br>
    %   pzlContainerVersion_C="1.0;001".<br>
    % the code below can obtain the version of the current pzlContainer<br>
    %  ContainerVersion=pzl::getContainerVersion(),<br>
    %  stdIO::writef("The version of the Container is  %",ContainerVersion),<br>
    %  ...
    % @exception No special exception generated by the PzlSystem<br>
    % @end
 
predicates
    getLicenseLevel:()->string PZLUserLicenseLevel procedure ().
    % @short get the license level of the given pzlContainer, in which the given class is placed
    % @detail Returnes the license level of the pzlContainer, where the given pzlComponent is placed.<br>
    % The License Level is defined by the company, which produces the pzlContainer<br>
    % and may have one of the following string values<br>
    % "Public"<br>
    % "Commercial"<br>
    % "Exclusive"<br>
    % "SuperExclusive"<br>
    % "Unknown"<br>
    %  if the current pzlContainer is the application, then the LicenseLevel returns the License
    %  level of the PzlPort 
    %
    % example:<br>
    % the code below can obtain the license level of the current pzlContainer<br>
    %  ...<br>
    %  LicenseLevel=pzl:getLicenseLevel(),<br>
    %  stdIO::writef("The License Level of the current pzlContainer is  %",LicenseLevel),<br>
    %  ...
    % @exception No special exception generated by the PzlSystem<br>
    % @end
 
predicates
    setStdOutputStream:(outputStream OutputStream).
 
predicates
    getComponentRegisterFileName:()->pzlDomains::pzlComponentsRegisterFileName_D ComponentRegisterFileName procedure ().
    getContainerContentList:(string PZLContainerFileName)->pzlDomains::pzlContainerContentInfo_D ContentInfo procedure (i).
 
 
predicates
    newByID:(pzlDomains::entityUID_D,object InObject)->object OutObject.
 
predicates % Creation Object By Name
    newByName:(string Name,object InObject)->object OutObject procedure (i,i).
    % @short The class constructor, which creates the new instance of the PzlComponent with the given name
    % @detail Creates the new instance of the pzlComponent with the name Name.
    % The pzlComponent with the name Name must be registered in one of 
    % the registration domains - in the Windows Registry or in the local registration file *.pzr.
    % The InObject may be the object pointer of any class instance. And the pzlComponent must
    % know the domain of this Object, if the conversion in the pzlComponent is to be performed.<br>
    %<br>
    % The returned object OutObject is the pointer to the requested object. To invoke the 
    % predicate of the named pzlComponent the OutObject must be converted to the domain of
    % this class, for example:<br>
    %  ...<br>
    %  Object=newByName("MyComponent",This),<br>
    %  MyComponentInstance=tryConvert(iMyComponent,Object),<br>
    %  MyComponentInstance:myPredicate(...),<br>
    %  ...
    %
    % @exception The exception is rized if the pzlSystem can not perform the constructor by reasons:<br>
    % - the PzlSystem has no access to the registry store.<br>
    % - the pzlComponent with the given name is not found in the registry Store.<br>
    % - the pzlContainer, which contains the given pzlComponent can not be loaded<br>
    % - the lodaded pzlContainer doesn't contain the given pzlComponent<br>
    % - the constructor of the given pzlComponent can not create the instance<br>
    % The last exception desription contains the text: <br>
    % 'New2. newByName failured for the Component 'Name' '<br>
    % @end
 
 
    releaseInactiveContainers:().
    getContainerActivity_nd:(string FileName,unsigned RefCounter) nondeterm (o,o).
    getContainerToBeUnloaded_nd:(string FileName) nondeterm (o).
 
    subscribe:(notificationAgency::notificationListener NotificationListener).
    unSubscribe:(notificationAgency::notificationListener NotificationListener).
 
predicates % Object registration
    register:(string ObjectName,object Object) procedure (i,i).
    registerMulti:(string ObjectName,object Object) procedure (i,i).
    getObjectByName_nd:(string ObjectName)->object Object nondeterm (i).
    getNameByObject_nd:(object Object)->string ObjectNameLow nondeterm (i).
    getNameAndObject_nd:(string ObjectName,object Object) nondeterm (o,o).
    unRegister:(string ObjectName,object Object) procedure (i,i).
    unRegisterByName:(string ObjectName) procedure (i).
    unRegisterByObject:(object Object) procedure (i).
    unRegisterAll:() procedure ().