/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _DAI_LIST_H #define _DAI_LIST_H #include "OdPlatformSettings.h" #include "OdaCommon.h" #include "daiAggrOrdered.h" #include "daiIteratorCollection.h" #include "daiConstIteratorCollection.h" #include "daiUtils/daiCustomCompare.h" #include #include "TD_PackPush.h" /** \details Implements the Data Access Interface (DAI) that provides functionality for manipulating data that is defined within the EXPRESS SCHEMA format. */ namespace OdDAI { /** \details A template class for ordered list containers defined within a schema. */ template class DAI_EXPORT List : public AggrOrdered { public: /** \details A data type that represents the type of template. */ typedef TItem template_type; /** \details A data type that represents the type of value. */ typedef TItem value_type; /** \details A data type that represents the type of base list container type. */ typedef List base_type; public: /**\details Creates a new List aggregate. */ List(); /**\details Creates a new List aggregate of a specified type. \param aggregationType [in] A raw pointer to the of the List aggregate. */ List(const AggregationType* aggregationType); /**\details A copy constructor for list aggregates. \param other [in] Another list aggregate to copy from. */ List(const List& other); /**\details A move constructor for list aggregates. \param other [in] Another list aggregate to move from. */ List(List&& other); /**\details Adds a new item to the ordered aggregate after a specified position. \param indexAddAfter [in] An index value that determines the position after which a new item is added. \param elementToAdd [in] The new item value. */ void addByIndex(int indexAddAfter, const TItem& elementToAdd); /**\details Creates a child aggregate, puts it to internal collection after a specified position and provides it to outside. \param indexAddAfter [in] An index value that determines the position after which a new item is added. \param aggrToAdd [out] A placeholder for the pointer to the created aggregate due to provide it to a calling subroutine. If an error occurred during the addition operation, the NULL pointer is returned. */ void addAggregateInstanceByIndex(int indexAddAfter, Aggr*& aggrToAdd); /**\details Removes an existing item from the ordered aggregate. \param ind [in] An index of the item to remove. */ void removeByIndex(int ind); /**\details Retrieves the bound of the item value in the ordered aggregate at a specified position. \param index [in] An index value that determines the item position. \returns A signed integer value that represents the value bound. */ int getValueBoundByIndex(int index); /** \details The equality operator for List aggregates. \param right [in] Another aggregate to compare (the right-hand operand of the comparison operation). \returns true if aggregates are equal; otherwise, the operator returns false. */ bool operator== (const List& right) const; /** \details The copy assignment operator for List aggregates. \param right [in] Another aggregate object to copy from (the right-hand operand of the assignment operation). \returns The reference to the List aggregate object modified with the assignment operation. */ List& operator= (const List& right); /** \details The move assignment operator for list aggregates. \param other [in] A list aggregate to move from (right-hand operand of the assignment operation). \returns The reference to the list object modified with the assignment operation. */ List& operator= (List&& other); /**\details Retrieves the array representation of the List aggregate. \returns The constant reference to the array representation of the List aggregate. */ const OdArray& getArray() const { return Aggr::instance*>()->getArray(); } protected: List(AggrInstance* defaultInstance); template friend class ListInstance; template friend class TypedAggrInstanceDefault; }; /** \details A data type that represents a of boolean values. */ class Boolean; using ListOfBoolean = List; using ListOfBooleanPtr = OdSharedPtr; /** \details A data type that represents a of values. */ using ListOfDouble = List; using ListOfDoublePtr = OdSharedPtr; /** \details A data type that represents a of double values. */ using ListOfInt = List; using ListOfIntPtr = OdSharedPtr; using ListOfOdDAIObjectId = List; using ListOfOdDAIObjectIdPtr = OdSharedPtr; class OdDAIObjectSDAI; using NonPersistentList = List; using NonPersistentListPtr = OdSharedPtr; using ListOfOdAnsiString = List; using ListOfOdAnsiStringPtr = OdSharedPtr; using ListOfWhereRule = List; using ListOfWhereRulePtr = OdSharedPtr; class Select; using ListOfSelect = List