18 #ifndef ATTRIBUTE_HEADER
19 #define ATTRIBUTE_HEADER
94 static void init(Uint32* aHeaderPtr, Uint32 anAttributeId, Uint32 aByteSize);
110 void setAttributeId(Uint32);
111 Uint32 getByteSize()
const;
112 void setByteSize(Uint32);
113 Uint32 getDataSize()
const;
114 void setDataSize(Uint32);
122 static Uint32 getByteSize(Uint32);
123 static Uint32 getDataSize(Uint32);
159 *aHeaderPtr = ah.m_value;
163 AttributeHeader::AttributeHeader(Uint32 aHeader)
169 AttributeHeader::AttributeHeader(Uint32 anAttributeId, Uint32 aByteSize)
172 this->setAttributeId(anAttributeId);
173 this->setByteSize(aByteSize);
177 AttributeHeader::~AttributeHeader()
190 return (m_value & 0xFFFF0000) >> 16;
194 void AttributeHeader::setAttributeId(Uint32 anAttributeId)
196 m_value &= 0x0000FFFF;
197 m_value |= (anAttributeId << 16);
201 Uint32 AttributeHeader::getByteSize()
const
203 return (m_value & 0xFFFF);
207 void AttributeHeader::setByteSize(Uint32 aByteSize)
209 m_value &= (~0xFFFF);
210 m_value |= aByteSize;
214 Uint32 AttributeHeader::getDataSize()
const
216 return (((m_value & 0xFFFF) + 3) >> 2);
220 void AttributeHeader::setDataSize(Uint32 aDataSize)
222 m_value &= (~0xFFFF);
223 m_value |= (aDataSize << 2);
227 bool AttributeHeader::isNULL()
const
229 return (getDataSize() == 0);
233 void AttributeHeader::setNULL()
260 fprintf(output,
"AttributeId: H\'%.8x (D\'%d), DataSize: H\'%.8x (D\'%d), "
263 getDataSize(), getDataSize(),
269 AttributeHeader::getByteSize(Uint32 m_value){
270 return (m_value & 0xFFFF);
275 AttributeHeader::getDataSize(Uint32 m_value){
276 return (((m_value & 0xFFFF) + 3) >> 2);
283 return m_value >> 16;