/////////////////////////////////////////////////////////////////////////////// // 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_ARRAY_H #define _DAI_ARRAY_H #include "OdPlatformSettings.h" #include "OdaCommon.h" #include "daiAggrOrdered.h" #include "daiIteratorCollection.h" #include "daiConstIteratorCollection.h" #include "TD_PackPush.h" namespace OdDAI { /** \details Template class for containers defined within a schema. */ template class DAI_EXPORT Array : public AggrOrdered { public: typedef TItem template_type; typedef TItem value_type; typedef Array base_type; public: /**\details Creates a new array aggregate. */ Array(); /**\details Creates a new Array aggregate. \param aggregationType [in] aggregation type for array. */ Array(const AggregationType* aggregationType); /**\details Copy constructor of Array aggregate. \param other [in] aggregate to copy from. */ Array(const Array& other); /**\details Move constructor of Array aggregate. \param other [in] aggregate to move from. */ Array(Array&& other); /**\details Resize the specified array instance. */ void reindex(); /**\details Resize the specified array instance index bounds. \param lower [in] New lower index value. \param upper [in] New upper index value. */ void resetIndex(int lower, int upper); /**\details Check item by index for unset value. \param indexToTest [in] item index \returns Returns true if settled value is not equal unset and false otherwise. */ bool testByIndex(int indexToTest) const; /**\details Reset item by index to unset value. \param indexToUnset [in] Item index. */ void unsetValueByIndex(int indexToUnset); /**\details Returns upper index, last settled item. \param indexToUnset [in] Item index. \returns Returns the last settled item index. If all items are unset, returns lower bound. */ int getUpperIndex() const; /**\details Returns lower index, first settled item. \param indexToUnset [in] Item index. \returns Returns the first settled item index. If all items are unset, returns lower bound. */ int getLowerIndex() const; /** \details Equal to operator \param aggr [in] Aggregate to compare. \returns Returns true if equal, otherwise false. */ bool operator == (const Array& aggr) const; /** \details Copy assignment operator \param right [in] Aggregate to copy from. \returns Returns the reference to itself. */ Array& operator= (const Array& right); /** \details Move assignment operator \param right [in] Aggregate to move from. \returns Returns the reference to itself. */ Array& operator= (Array&& right); /**\details Retrieves internal constant array of items. \returns Returns constant reference to internal items OdArray. */ const OdArray& getArray() const { return Aggr::instance*>()->getArray(); } /**\details Move all unset params to the beginning of array. */ void pack(); //DOM-IGNORE-BEGIN protected: Array(AggrInstance* defaultInstance); template friend class ArrayInstance; template friend class TypedAggrInstanceDefault; }; class Logical; using ArrayOfLogical = Array ; using ArrayOfLogicalPtr = OdSharedPtr; using ArrayOfDouble = Array; using ArrayOfDoublePtr = OdSharedPtr; using ArrayOfInt = Array; using ArrayOfIntPtr = OdSharedPtr; using ArrayOfOdDAIObjectId = Array; using ArrayOfOdDAIObjectIdPtr = OdSharedPtr; using ArrayOfOdAnsiString = Array; using ArrayOfOdAnsiStringPtr = OdSharedPtr; class Select; using ArrayOfSelect = Array