GSAPI::APIOutputApplicaton class

The application class which contains only one method (with a few overloads to allow for different use-cases): the OutputElements () method.

class APIOutputApplicaton;
template <typename ElemContainerType,
          typename OutputFactoryType,
          typename ElemSelectorType,
          typename AttributeProxyType,
          typename AttributeFactoryType>
GSErrCode OutputElements (GSAPI::IAPIOutputManager&       manager,
                          const API_ElemFilter&           elemFilter,
                          const GSAPI::AttributeFilter&   attributeFilter,
                          GSAPI::OutputUsedAttributesType attributeOutputType  = DoNotOutput,
                          bool                            dumpDatabaseSettings = true);
template <typename ElemContainerType,
          typename OutputFactoryType,
          typename ElemSelectorType,
          typename AttributeFactoryType>
GSErrCode OutputElements (GSAPI::IAPIOutputManager&       manager,
                          const API_ElemFilter&           elemFilter,
                          const GSAPI::AttributeFilter&   attributeFilter,
                          GSAPI::IAttributeProxy&         attributeProxy,
                          GSAPI::OutputUsedAttributesType attributeOutputType  = DoNotOutput,
                          bool                            dumpDatabaseSettings = true);
template <typename ElemContainerType,
          typename OutputFactoryType,
          typename ElemSelectorType>
GSErrCode OutputElements (GSAPI::IAPIOutputManager&       manager,
                          const API_ElemFilter&           elemFilter,
                          bool                            dumpDatabaseSettings = true);
template <typename ElemContainerType,
          typename OutputFactoryType,
          typename AttributeProxyType,
          typename AttributeFactoryType>
GSErrCode OutputElements (GSAPI::IAPIOutputManager&       manager,
                          const API_ElemFilter&           elemFilter,
                          const GSAPI::IDatabaseSelector& selector,
                          const GSAPI::AttributeFilter&   attributeFilter,
                          GSAPI::OutputUsedAttributesType attributeOutputType  = DoNotOutput,
                          bool                            dumpDatabaseSettings = true);
template <typename ElemContainerType,
          typename OutputFactoryType>
GSErrCode OutputElements (GSAPI::IAPIOutputManager&       manager,
                          const API_ElemFilter&           elemFilter,
                          const GSAPI::IDatabaseSelector& selector,
                          bool                            dumpDatabaseSettings = true);
template <typename ElemContainerType,
          typename OutputFactoryType,
          typename AttributeFactoryType>
GSErrCode OutputElements (GSAPI::IAPIOutputManager&       manager,
                          const API_ElemFilter&           elemFilter,
                          const GSAPI::IDatabaseSelector& selector,
                          const GSAPI::AttributeFilter&   attributeFilter,
                          GSAPI::IAttributeProxy&         attributeProxy,
                          GSAPI::OutputUsedAttributesType attributeOutputType  = DoNotOutput,
                          bool                            dumpDatabaseSettings = true);

Template parameters

ElemContainerType
The element container type (must implement the IAPIPseudoContainer interface).
OutputFactoryType
The output adapter factory type (must implement the IAPIOutputAdapterFactory interface).
ElemSelectorType
The database selector functor type (must implement the IDatabaseSelector interface).
AttributeProxyType
The attribute proxy container type (must implement the IAttributeProxy interface).
AttributeFactoryType
The attribute adapter factory type (must implement the IAPIAttributeAdapterFactory interface).

Parameters

manager
The output manager object (see the IAPIOutputManager interface).
elemFilter
Output only these types.
attributeFilter
Output only these types (GSAPI::AttributeFilter is a bool array similar to API_ElemFilter for attributes).
attributeOutputType
A setting of where and how to output attributes.
dumpDatabaseSettings
A flag to output layout/master layout settings or not.
attributeProxy
The attribute proxy container object (must implement the IAttributeProxy interface).
selector
The database selector functor object (must implement the IDatabaseSelector interface).

Description

The OutputElements () method does the following:

  1. builds a database graph of the Archicad databases
  2. selects the required databases from this graph using the user provided IDatabaseSelector type/object
  3. for each of the selected databases
    1. creates an IAPIPseudoContainer using the user provided type
    2. iterates through the container with IAPIPseudoIterators (provided with the container type)
    3. gets an IAPIOutputAdapter for each element from the user provided IAPIOutputAdapterFactory, and uses the adapter’s operator>> () (wrapper for it’s Output () method) on the GS::OChannel gained from the IAPIOutputManager object provided by the user (basically output the element)
    4. if the user asked for attribute output after each database then iterates through the attributes loaded into the user provided IAttributeProxy type/object container, which are from this database and output them as well (in the same way as the elements)
  4. if the user asked for attribute output after full element output then iterates through the attributes loaded into the user provided IAttributeProxy type/object container and output them as well

Requirements

Namespace: GSAPI

Header: APIOutputApplication.hpp

Version: API 10.21 or later