Library file syntax

 

General structure and interpretation rules

An ACT library file is an XML document, with a root element <act>, containing one of the <template-library>, <type-library> or <platform-definition> elements. Each of these elements can contain <template>, <type>, <mapping> or <pattern> elements in any order.

 

The difference between these "library" elements is only considered when forming three separate lists of libraries in the GUI.  Objecteering C++ Developer allows the "type library" and "platform definition" to be separately set in the context of each model element. The library search path is constructed from these separate elements, in the order Platform -> Type library -> other template libraries in the current path (in other words, the platform library is searched for first).

 

The default path always includes the "core" template library Cxx2Core.

 

The library contents can be split up into several files, each containing the same root element with the same id.  The contents will be combined. This allows further structuring of a large library, for example, having types in one file, patterns in another and templates related to a certain functionality grouped in separate files.

 

 

Example

The following is a short example of library file layout.

<act xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="act-schema.xsd">

   <template-library id="Cxx2Core">

        <template …>

        <map …>

        <pattern …>

        <type …>

   </template-library>

</act>

 

 

<template-library>, <type-library> and  <platform-definition> elements

The three elements are generally equivalent, as described above. Each of them has the following attributes:

·         id: This is a string identifier, which should be unique among all different library definitions in all ACT files within the ACT load path.  If you have the same id in different files, this will cause the contents of the files to be merged in the memory, thereby forming a single library.