xsi_userdataarray.h
Go to the documentation of this file.
00001 //*****************************************************************************
00011 //*****************************************************************************
00012 
00013 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
00014 #pragma once
00015 #endif
00016 
00017 #ifndef __XSIUSERDATAARRAY_H__
00018 #define __XSIUSERDATAARRAY_H__
00019 
00020 #include "sicppsdk.h"
00021 
00022 namespace XSI {
00023 
00024 class CStatus;
00025 
00026 //*************************************************************************
00141 //*************************************************************************
00142 class SICPPSDKDECL CUserDataArray
00143 {
00144 public:
00145     /* Defines the user data structure
00146     */
00147     struct Value
00148     {
00152         Value() : m_pData(0), m_nSize(0) {}
00153 
00158         bool operator==(const Value& in_value) const
00159         {
00160             return m_nSize > in_value.m_nSize;
00161         }
00162 
00163         const unsigned char* m_pData;   
00164         unsigned int m_nSize;           
00165     };
00166 
00170     CUserDataArray( LONG in_size=0);
00171 
00175     CUserDataArray(const CUserDataArray& in_array);
00176 
00178     ~CUserDataArray();
00179 
00184     CUserDataArray& operator=( const CUserDataArray& in_array );
00185 
00189     LONG GetCount() const;
00190 
00195     CStatus Add( const CUserDataArray::Value& in_val );
00196 
00200     CStatus Clear();
00201 
00208     CStatus Resize( LONG in_size);
00209 
00216     const CUserDataArray::Value& operator[]( LONG in_index ) const;
00217 
00223     CUserDataArray::Value& operator[]( LONG in_index );
00224 
00231     bool operator==(const CUserDataArray& in_array) const;
00232 
00238     bool operator!=(const CUserDataArray& in_array) const;
00239 
00240 private:
00241 
00242     void* m_ptr;
00243 };
00244 
00245 };
00246 
00247 #endif // __XSIUSERDATAARRAY_H__