/////////////////////////////////////////////////////////////////////////////// // 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 _NWOBJECTITERATOR_H_ #define _NWOBJECTITERATOR_H_ #include "NwObject.h" /** \details This class represents an iterator of an OdNwObject object. */ class NWDBEXPORT OdNwObjectIterator : public OdRxObject { public: //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdNwObjectIterator); //DOM-IGNORE-END /** \details Default constructor. */ OdNwObjectIterator() {} /** \details Sets this iterator object to reference the entity that it would normally return first. \remarks Allows multiple traversals of the iterator list. \param atBeginning [in] True to start at the beginning, false to start at the end. \param skipErased [in]] If and only if true, erased records are skipped. */ virtual void start( bool atBeginning = true, bool skipErased = true) = 0; /** \details Checks whether the traversal by this iterator object is complete. \returns The true value if and only if the traversal by this iterator object is complete. */ virtual bool done() const = 0; /** \details Returns the object ID of the nw object currently referenced by this iterator object. */ virtual OdNwObjectId item() const = 0; /** \details Opens and returns the nw object currently referenced by this iterator object. Arguments: openMode (I) Mode in which to open the entity. openErasedEntity (I) If and only if true, erased records are opened or retrieved. Remarks: Returns a smart pointer to the opened nw object if successful, otherwise returns a null smart pointer. */ virtual OdNwObjectPtr element(NwOpenMode::Enum openMode = NwOpenMode::kForRead, bool openErasedEntity = false) = 0; /** \details Steps this iterator object. \param forward [in] True to step forward, false to step backward. \param skipErased [in] If and only if true, erased records are skipped. */ virtual void step( bool forward = true, bool skipErased = true) = 0; /** \details Positions this iterator object at the specified record. \param objectId [in] Object ID of the entity to position the iterator to. \returns The true value if and only if the positioning is complete. */ virtual bool seek(const OdNwObjectId& objectId) = 0; }; /** \details This template class is a specialization of the OdSmartPtr class for OdNwObjectIterator object pointers. */ typedef OdSmartPtr OdNwObjectIteratorPtr; #endif //_NWOBJECTITERATOR_H_