/////////////////////////////////////////////////////////////////////////////// // 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 _PRCCONTENTSINGLEATTRIBUTE_INCLUDED_ #define _PRCCONTENTSINGLEATTRIBUTE_INCLUDED_ #include "PrcAttributeEntry.h" #include "OdTimeStamp.h" /** \details A class that represents an attribute with its data. */ class PRC_TOOLKIT OdPrcContentSingleAttribute { private: OdPrcAttributeEntry m_AttributeEntry; OdUInt8 m_type; union { OdInt32 int32_data; double double_data; OdUInt32 uint32_data; OdString *pStr_data; } m_data; public: //DOM-IGNORE-BEGIN PRC_DECLARE_CIO(OdPrcContentSingleAttribute) //DOM-IGNORE-END /** \details Requests the title of the attribute. \returns A reference to the object that represents the attribute title. \remarks Since the method returns the attribute title object via a reference, any modification of the returned attribute title object affects the attribute object, and can be used to set a new title. */ OdPrcAttributeEntry &attributeEntry(); /** \details Requests the title of the attribute. \returns A constant reference to the object that represents the attribute title. \remarks Call this method if you want to restrict any modification of the . */ const OdPrcAttributeEntry &attributeEntry() const; /** \details Creates a new attribute as a copy of another existing attribute object (copy constructor). \param source [in] Another object to be copied. */ OdPrcContentSingleAttribute(const OdPrcContentSingleAttribute &source); /** \details Destroys the attribute and its data. */ ~OdPrcContentSingleAttribute(void); /** \details The assignment operator for attributes. \param source [in] Another object to be assigned (right-hand operand of the assignment operation). \returns A reference to the attribute object modified with the assignment operation. */ OdPrcContentSingleAttribute& operator= (const OdPrcContentSingleAttribute &source); /** \details Sets the attribute data represented with a signed 32-bit integer value. \param data [in] A signed 32-bit integer value that represents the data to be set. */ void setData (OdInt32 data); /** \details Sets the attribute data represented with a double value. \param data [in] A double value that represents the data to be set. */ void setData (double data); /** \details Sets the attribute data represented with a date and time value. \param data [in] A date and time value that represents the data to be set. */ void setData (const OdTimeStamp &data); /** \details Sets the attribute data represented with an unsigned 32-bit value. \param data [in] An unsigned 32-bit value that represents the data to be set. */ void setData(OdUInt32 data); /** \details Sets the attribute data represented with a string value. \param data [in] A string value that represents the data to be set. */ void setData (const OdString &data); /** \details Clears the data and type of the attribute. */ void empty(void); /** \details Requests the attribute data type. \returns An value that contains the attribute data type. */ EPRCModellerAttributeType getType() const; /** \details Requests the current value of the attribute cast to the signed 32-bit integer data type. \returns A signed 32-bit integer value that contains the current attribute value. */ OdInt32 getDataInt32() const; /** \details Requests the current value of the attribute cast to the double data type. \returns A double value that contains the current attribute value. */ double getDataDouble() const; /** \details Requests the current value of the attribute cast to the unsigned 32-bit integer data type. \returns An unsigned 32-bit integer value that contains the current attribute value. */ OdUInt32 getDataUInt32() const; /** \details Requests the current value of the attribute cast to the date and time data type. \returns A date and time value that contains the current attribute value. */ OdTimeStamp getDataTime() const; /** \details Requests the current value of the attribute cast to the string data type. \returns A string value that contains the current attribute value. */ const OdString& getDataStr() const; }; /** \details A data type that represents an array of objects. */ typedef OdArray OdPrcContentSingleAttributeArray; #endif // _PRCCONTENTSINGLEATTRIBUTE_INCLUDED_