/////////////////////////////////////////////////////////////////////////////// // 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_BAG_H #define _DAI_BAG_H #include "OdPlatformSettings.h" #include "OdaCommon.h" #include "daiAggrUnordered.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 Bag : public AggrUnordered { public: typedef TItem template_type; typedef TItem value_type; typedef Bag base_type; public: /**\details Creates a new bag aggregate. */ Bag(); /**\details Creates a new bag aggregate. \param aggregationType [in] Aggregation type for bag. */ Bag(const AggregationType* aggregationType); /**\details Copy constructor of bag aggregate. \param other [in] Aggregate to copy from. */ Bag(const Bag& other); /**\details Move constructor of bag aggregate. \param other [in] Aggregate to move from. */ Bag(Bag&& other); /** \details Equality to operator. \param aggr [in] Aggregate to compare. \returns Returns true if equal, otherwise false. */ bool operator == (const Bag& aggr) const; /** \details Copy assignment operator \param right [in] Aggregate to copy from. \returns Returns the reference to itself. */ Bag& operator= (const Bag& right); /**\details Move assignment operator. \param right [in] Aggregate to move from. \returns Returns the reference to itself. */ Bag& operator= (Bag&& 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 Creates a nested aggregate item. \param newAggr [in/out] Output parameter. If succeeded it should filled by a pointer of new child aggregate. */ void createAggrInstance(Aggr*& newAggr); //DOM-IGNORE-BEGIN protected: Bag(AggrInstance* defaultInstance); template friend class BagInstance; template friend class TypedAggrInstanceDefault; }; using BagOfDouble = Bag; using BagOfDoublePtr = OdSharedPtr; using BagOfInt = Bag; using BagOfIntPtr = OdSharedPtr; using BagOfOdDAIObjectId = Bag; using BagOfOdDAIObjectIdPtr = OdSharedPtr; using BagOfOdAnsiString = Bag; using BagOfOdAnsiStringPtr = OdSharedPtr; class Boolean; using BagOfBoolean = Bag; using BagOfBooleanPtr = OdSharedPtr; class Select; using BagOfSelect = Bag