NL3D::CMatrix3x4SSEArray Class Reference


Detailed Description

A CMatrix3x4SSE array correctly aligned NB: SSE is no more used (no speed gain, some memory problem), but keep it for possible future usage.

Definition at line 65 of file mesh_mrm_skin.cpp.

Public Member Functions

void clear ()
void clear ()
 CMatrix3x4SSEArray (const CMatrix3x4SSEArray &other)
 CMatrix3x4SSEArray ()
 CMatrix3x4SSEArray (const CMatrix3x4SSEArray &other)
 CMatrix3x4SSEArray ()
CMatrix3x4SSEgetPtr ()
CMatrix3x4SSEgetPtr ()
CMatrix3x4SSEArrayoperator= (const CMatrix3x4SSEArray &other)
CMatrix3x4SSEArrayoperator= (const CMatrix3x4SSEArray &other)
CMatrix3x4SSEoperator[] (uint i)
CMatrix3x4SSEoperator[] (uint i)
void reserve (uint n)
void reserve (uint n)
void resize (uint n)
void resize (uint n)
uint size () const
uint size () const
 ~CMatrix3x4SSEArray ()
 ~CMatrix3x4SSEArray ()

Private Attributes

void * _AllocData
void * _AllocData
uint _Capacity
void * _Data
void * _Data
uint _Size


Constructor & Destructor Documentation

NL3D::CMatrix3x4SSEArray::CMatrix3x4SSEArray  )  [inline]
 

Definition at line 74 of file mesh_mrm_skin.cpp.

References _AllocData, _Capacity, and _Data.

00075         {
00076                 _AllocData= NULL;
00077                 _Data= NULL;
00078                 _Size= 0;
00079                 _Capacity= 0;
00080         }

NL3D::CMatrix3x4SSEArray::~CMatrix3x4SSEArray  )  [inline]
 

Definition at line 81 of file mesh_mrm_skin.cpp.

References clear().

00082         {
00083                 clear();
00084         }

NL3D::CMatrix3x4SSEArray::CMatrix3x4SSEArray const CMatrix3x4SSEArray other  )  [inline]
 

Definition at line 85 of file mesh_mrm_skin.cpp.

References _AllocData, _Capacity, and _Data.

00086         {
00087                 _AllocData= NULL;
00088                 _Data= NULL;
00089                 _Size= 0;
00090                 _Capacity= 0;
00091                 *this= other;
00092         }

NL3D::CMatrix3x4SSEArray::CMatrix3x4SSEArray  )  [inline]
 

Definition at line 2150 of file mesh_mrm_skinned.cpp.

References _AllocData, _Capacity, and _Data.

02151         {
02152                 _AllocData= NULL;
02153                 _Data= NULL;
02154                 _Size= 0;
02155                 _Capacity= 0;
02156         }

NL3D::CMatrix3x4SSEArray::~CMatrix3x4SSEArray  )  [inline]
 

Definition at line 2157 of file mesh_mrm_skinned.cpp.

References clear().

02158         {
02159                 clear();
02160         }

NL3D::CMatrix3x4SSEArray::CMatrix3x4SSEArray const CMatrix3x4SSEArray other  )  [inline]
 

Definition at line 2161 of file mesh_mrm_skinned.cpp.

References _AllocData, _Capacity, and _Data.

02162         {
02163                 _AllocData= NULL;
02164                 _Data= NULL;
02165                 _Size= 0;
02166                 _Capacity= 0;
02167                 *this= other;
02168         }


Member Function Documentation

void NL3D::CMatrix3x4SSEArray::clear  )  [inline]
 

Definition at line 2186 of file mesh_mrm_skinned.cpp.

References _AllocData, _Capacity, and _Data.

02187         {
02188                 delete [] _AllocData;
02189                 _AllocData= NULL;
02190                 _Data= NULL;
02191                 _Size= 0;
02192                 _Capacity= 0;
02193         }

void NL3D::CMatrix3x4SSEArray::clear  )  [inline]
 

Definition at line 110 of file mesh_mrm_skin.cpp.

References _AllocData, _Capacity, and _Data.

Referenced by reserve(), and ~CMatrix3x4SSEArray().

00111         {
00112                 delete [] _AllocData;
00113                 _AllocData= NULL;
00114                 _Data= NULL;
00115                 _Size= 0;
00116                 _Capacity= 0;
00117         }

CMatrix3x4SSE* NL3D::CMatrix3x4SSEArray::getPtr  )  [inline]
 

Definition at line 2181 of file mesh_mrm_skinned.cpp.

References _Data.

02182         {
02183                 return (CMatrix3x4SSE*)_Data;
02184         }

CMatrix3x4SSE* NL3D::CMatrix3x4SSEArray::getPtr  )  [inline]
 

Definition at line 105 of file mesh_mrm_skin.cpp.

References _Data.

00106         {
00107                 return (CMatrix3x4SSE*)_Data;
00108         }

CMatrix3x4SSEArray& NL3D::CMatrix3x4SSEArray::operator= const CMatrix3x4SSEArray other  )  [inline]
 

Definition at line 2169 of file mesh_mrm_skinned.cpp.

References _Data, resize(), and size.

02170         {
02171                 if( this == &other)
02172                         return *this;
02173                 resize(other.size());
02174                 // copy data from aligned pointers to aligned pointers.
02175                 memcpy(_Data, other._Data, size() * sizeof(CMatrix3x4SSE) );
02176 
02177                 return *this;
02178         }

CMatrix3x4SSEArray& NL3D::CMatrix3x4SSEArray::operator= const CMatrix3x4SSEArray other  )  [inline]
 

Definition at line 93 of file mesh_mrm_skin.cpp.

References _Data, resize(), size, and size().

00094         {
00095                 if( this == &other)
00096                         return *this;
00097                 resize(other.size());
00098                 // copy data from aligned pointers to aligned pointers.
00099                 memcpy(_Data, other._Data, size() * sizeof(CMatrix3x4SSE) );
00100 
00101                 return *this;
00102         }

CMatrix3x4SSE& NL3D::CMatrix3x4SSEArray::operator[] uint  i  )  [inline]
 

Definition at line 2241 of file mesh_mrm_skinned.cpp.

References _Data, and uint.

02241 {return ((CMatrix3x4SSE*)_Data)[i];}

CMatrix3x4SSE& NL3D::CMatrix3x4SSEArray::operator[] uint  i  )  [inline]
 

Definition at line 165 of file mesh_mrm_skin.cpp.

References _Data, and uint.

00165 {return ((CMatrix3x4SSE*)_Data)[i];}

void NL3D::CMatrix3x4SSEArray::reserve uint  n  )  [inline]
 

Definition at line 2203 of file mesh_mrm_skinned.cpp.

References _AllocData, _Capacity, _Data, clear(), NL3D_SSE_ALIGNEMENT, size(), uint, uint32, and uint8.

02204         {
02205                 if(n==0)
02206                         clear();
02207                 else if(n>_Capacity)
02208                 {
02209                         // Alloc new data.
02210                         void    *newAllocData;
02211                         void    *newData;
02212 
02213                         // Alloc for alignement.
02214                         newAllocData= new uint8 [n * sizeof(CMatrix3x4SSE) + NL3D_SSE_ALIGNEMENT-1];
02215                         if(newAllocData==NULL)
02216                                 throw Exception("SSE Allocation Failed");
02217 
02218                         // Align ptr
02219                         newData= (void*) ( ((uint32)newAllocData+NL3D_SSE_ALIGNEMENT-1) & (~(NL3D_SSE_ALIGNEMENT-1)) );
02220 
02221                         // copy valid data from old to new.
02222                         memcpy(newData, _Data, size() * sizeof(CMatrix3x4SSE) );
02223 
02224                         // release old.
02225                         if(_AllocData)
02226                                 delete [] ((uint8*)_AllocData);
02227 
02228                         // change ptrs and capacity.
02229                         _Data= newData;
02230                         _AllocData= newAllocData;
02231                         _Capacity= n;
02232 
02233                         // TestYoyo
02234                         //nlwarning("YOYO Tst SSE P4: %X, %d", _Data, n);
02235                 }
02236         }

void NL3D::CMatrix3x4SSEArray::reserve uint  n  )  [inline]
 

Definition at line 127 of file mesh_mrm_skin.cpp.

References _AllocData, _Capacity, _Data, clear(), NL3D_SSE_ALIGNEMENT, size(), uint, uint32, and uint8.

Referenced by resize().

00128         {
00129                 if(n==0)
00130                         clear();
00131                 else if(n>_Capacity)
00132                 {
00133                         // Alloc new data.
00134                         void    *newAllocData;
00135                         void    *newData;
00136 
00137                         // Alloc for alignement.
00138                         newAllocData= new uint8 [n * sizeof(CMatrix3x4SSE) + NL3D_SSE_ALIGNEMENT-1];
00139                         if(newAllocData==NULL)
00140                                 throw Exception("SSE Allocation Failed");
00141 
00142                         // Align ptr
00143                         newData= (void*) ( ((uint32)newAllocData+NL3D_SSE_ALIGNEMENT-1) & (~(NL3D_SSE_ALIGNEMENT-1)) );
00144 
00145                         // copy valid data from old to new.
00146                         memcpy(newData, _Data, size() * sizeof(CMatrix3x4SSE) );
00147 
00148                         // release old.
00149                         if(_AllocData)
00150                                 delete [] ((uint8*)_AllocData);
00151 
00152                         // change ptrs and capacity.
00153                         _Data= newData;
00154                         _AllocData= newAllocData;
00155                         _Capacity= n;
00156 
00157                         // TestYoyo
00158                         //nlwarning("YOYO Tst SSE P4: %X, %d", _Data, n);
00159                 }
00160         }

void NL3D::CMatrix3x4SSEArray::resize uint  n  )  [inline]
 

Definition at line 2195 of file mesh_mrm_skinned.cpp.

References _Capacity, reserve(), and uint.

02196         {
02197                 // reserve ??
02198                 if(n>_Capacity)
02199                         reserve( max(2*_Capacity, n));
02200                 _Size= n;
02201         }

void NL3D::CMatrix3x4SSEArray::resize uint  n  )  [inline]
 

Definition at line 119 of file mesh_mrm_skin.cpp.

References _Capacity, reserve(), and uint.

Referenced by operator=().

00120         {
00121                 // reserve ??
00122                 if(n>_Capacity)
00123                         reserve( max(2*_Capacity, n));
00124                 _Size= n;
00125         }

uint NL3D::CMatrix3x4SSEArray::size  )  const [inline]
 

Definition at line 2238 of file mesh_mrm_skinned.cpp.

References uint.

02238 {return _Size;}

uint NL3D::CMatrix3x4SSEArray::size  )  const [inline]
 

Definition at line 162 of file mesh_mrm_skin.cpp.

References uint.

Referenced by operator=(), and reserve().

00162 {return _Size;}


Field Documentation

void* NL3D::CMatrix3x4SSEArray::_AllocData [private]
 

Definition at line 2144 of file mesh_mrm_skinned.cpp.

void* NL3D::CMatrix3x4SSEArray::_AllocData [private]
 

Definition at line 68 of file mesh_mrm_skin.cpp.

Referenced by clear(), CMatrix3x4SSEArray(), and reserve().

uint NL3D::CMatrix3x4SSEArray::_Capacity [private]
 

Definition at line 2147 of file mesh_mrm_skinned.cpp.

Referenced by clear(), CMatrix3x4SSEArray(), reserve(), and resize().

void* NL3D::CMatrix3x4SSEArray::_Data [private]
 

Definition at line 2145 of file mesh_mrm_skinned.cpp.

void* NL3D::CMatrix3x4SSEArray::_Data [private]
 

Definition at line 69 of file mesh_mrm_skin.cpp.

Referenced by clear(), CMatrix3x4SSEArray(), getPtr(), operator=(), operator[](), and reserve().

uint NL3D::CMatrix3x4SSEArray::_Size [private]
 

Definition at line 2146 of file mesh_mrm_skinned.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 06:50:49 2004 for NeL by doxygen 1.3.6