/////////////////////////////////////////////////////////////////////////////// // 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 _PRCUNIQUEID_INCLUDED_ #define _PRCUNIQUEID_INCLUDED_ #include "PrcUncompressedFiler.h" /** \details A class that stores and operates with the unique identifier (UID) of a PRC object. */ class PRC_TOOLKIT OdPrcUniqueId { private: OdUInt32 m_Id[4]; public: //DOM-IGNORE-BEGIN PRC_DECLARE(OdPrcUniqueId) //DOM-IGNORE-END /** \details A zero value of a unique identifier. */ static OdPrcUniqueId kZero; /** \details Compares the unique identifier with another unique identifier for equality (comparison operator). \param uid [in] Another unique identifier for the comparison. \returns A boolean value that equals true if unique identifiers are equal; otherwise, the operator returns false. */ bool operator == (const OdPrcUniqueId &uid) const; /** \details The "less than" operator for unique identifiers. \param uid [in] Another unique identifier for the comparison. \returns A boolean value that equals true if the unique identifier is less than the other identifier passed as a parameter; otherwise, the operator returns false. */ bool operator < (const OdPrcUniqueId &uid) const; /** \details Creates a new unique identifier with specified digits. \param id0 [in] The first digit of the unique identifier. \param id1 [in] The second digit of the unique identifier. \param id2 [in] The third digit of the unique identifier. \param id3 [in] The fourth digit of the unique identifier. */ OdPrcUniqueId(OdUInt32 id0, OdUInt32 id1, OdUInt32 id2, OdUInt32 id3); /** \details Sets a new value for the unique identifier with specified digits. \param id0 [in] The first digit of the unique identifier. \param id1 [in] The second digit of the unique identifier. \param id2 [in] The third digit of the unique identifier. \param id3 [in] The fourth digit of the unique identifier. */ void setID(OdUInt32 id0, OdUInt32 id1, OdUInt32 id2, OdUInt32 id3); /** \details Requests the current value of the unique identifier. \param id0 [out] A placeholder for the first digit of the unique identifier. \param id1 [out] A placeholder for the second digit of the unique identifier. \param id2 [out] A placeholder for the third digit of the unique identifier. \param id3 [out] A placeholder for the fourth digit of the unique identifier. */ void getID(OdUInt32 &id0, OdUInt32 &id1, OdUInt32 &id2, OdUInt32 &id3); /** \details Checks whether the value of the unique identifier is non-zero. \returns The boolean value that equals true if the unique identifier is non-zero; otherwise, the method returns false. */ bool isNonZero() const; /** \details Generates a new unique identifier. \returns A newly created object. */ static OdPrcUniqueId generateUID(void); /** \details Reads the unique identifier value from a stream associated with an . \param pStream [in] A pointer to an object that represents the input stream (associated with a file or a memory block) to read data. \param pName [in] A pointer to a null-terminated string that contains the name of the file or memory block. */ void prcOut(OdPrcUncompressedFiler *pStream, const char* pName); /** \details Writes the unique identifier to a stream associated with an . \param pStream [in] A pointer to an object that represents the output stream (associated with a file or a memory block) to write data. \param pName [in] A pointer to a null-terminated string that contains the name of the file or memory block. */ void prcIn(OdPrcUncompressedFiler *pStream, const char* pName); /** \details Writes the unique identifier to a stream associated with an . \param pStream [in] A pointer to an object that represents the output stream (associated with a file or a memory block) to write data. \param pName [in] A pointer to a null-terminated string that contains the name of the file or memory block. */ void writeCompressed(OdPrcCompressedFiler *pStream, const char* pName); /** \details Reads the unique identifier value from a stream associated with an . \param pStream [in] A pointer to an object that represents the input stream (associated with a file or a memory block) to read data. \param pName [in] A pointer to a null-terminated string that contains the name of the file or memory block. */ void readCompressed(OdPrcCompressedFiler *pStream, const char* pName); }; /** \details A data type that represents an array of objects. */ typedef OdArray OdPrcUniqueIdArray; #endif // _PRCUNIQUEID_INCLUDED_