FBX C++ API Reference
FbxLayerElementArrayTemplate< T > Class Template Reference

#include <fbxlayer.h>

Class Description

template<class T>
class FbxLayerElementArrayTemplate< T >

FbxLayerElementArrayTemplate provides data array manipulation of the data buffer for FbxLayerElement.

It is the subclass of FbxLayerElementArray.

Examples:
ExportScene03/main.cxx, ImportScene/DisplayShape.cxx, and ViewScene/SceneCache.cxx.

Definition at line 858 of file fbxlayer.h.

+ Inheritance diagram for FbxLayerElementArrayTemplate< T >:

Public Member Functions

 FbxLayerElementArrayTemplate (EFbxType pDataType)
 Constructor. More...
 
int Add (T const &pItem)
 Appends a new item to the end of the data buffer. More...
 
int InsertAt (int pIndex, T const &pItem)
 Inserts a new item at the specified position of the data buffer. More...
 
void SetAt (int pIndex, T const &pItem)
 Sets the value of the specified item. More...
 
void SetLast (T const &pItem)
 Sets the value of the last item. More...
 
RemoveAt (int pIndex)
 Removes the specified item from the data buffer. More...
 
RemoveLast ()
 Removes the last item from the data buffer. More...
 
bool RemoveIt (T const &pItem)
 Removes one item from the data buffer. More...
 
GetAt (int pIndex) const
 Returns the specified item's value. More...
 
GetFirst () const
 Returns the first item's value. More...
 
GetLast () const
 Returns the last item's value. More...
 
int Find (T const &pItem)
 Searches for an item in the data buffer. More...
 
int FindAfter (int pAfterIndex, T const &pItem)
 Searches for an item after the specified index in the data buffer. More...
 
int FindBefore (int pBeforeIndex, T const &pItem)
 Searches for one item before the specified index in the data buffer. More...
 
operator[] (int pIndex) const
 Returns the specified item's value. More...
 
FbxLayerElementArrayoperator= (const FbxArray< T > &pArrayTemplate)
 Assignment operator. More...
 
FbxLayerElementArrayTemplate< T > & operator= (const FbxLayerElementArrayTemplate< T > &pArrayTemplate)
 Assignment operator. More...
 
- Public Member Functions inherited from FbxLayerElementArray
bool IsInUse () const
 Returns whether this Array is accessed in any way. More...
 
int ReadLock () const
 Increments the number of read locks on this array. More...
 
int ReadUnlock () const
 Releases a read lock on this array. More...
 
bool WriteLock () const
 Locks this array for writing. More...
 
void WriteUnlock () const
 Releases the write lock on this array. More...
 
bool ReadWriteLock () const
 Locks this array for writing. More...
 
void ReadWriteUnlock () const
 Releases the write lock on this array. More...
 
virtual void * GetLocked (ELockMode pLockMode, EFbxType pDataType)
 Grants a locked access to the data buffer. More...
 
void * GetLocked (ELockMode pLockMode=eReadWriteLock)
 Grants a locked access to the data buffer. More...
 
template<class T >
T * GetLocked (T *, ELockMode pLockMode=eReadWriteLock)
 Grants a locked access to the data buffer. More...
 
virtual void Release (void **pDataPtr, EFbxType pDataType)
 Unlock the data buffer. More...
 
void Release (void **pDataPtr)
 Unlock the data buffer. More...
 
template<class T >
void Release (T **pDataPtr, T *dummy)
 Unlock the data buffer. More...
 
virtual size_t GetStride () const
 Returns the Stride size which equals the size of the data type of the data buffer. More...
 
 FbxLayerElementArray (EFbxType pDataType)
 Constructor. More...
 
virtual ~FbxLayerElementArray ()
 Destructor. More...
 
void ClearStatus ()
 Clears the access state and sets it to eSuccess. More...
 
LockAccessStatus::ELockAccessStatus GetStatus () const
 Retrieves the access state. More...
 
bool IsWriteLocked () const
 Returns whether write is locked. More...
 
int GetReadLockCount () const
 Retrieves the read lock count. More...
 
int GetCount () const
 Returns the count of items in the data buffer. More...
 
void SetCount (int pCount)
 Sets the count of items in the data buffer. More...
 
void Clear ()
 Clears the data buffer. More...
 
void Resize (int pItemCount)
 Resizes the data buffer. More...
 
void AddMultiple (int pItemCount)
 Appends space to the data buffer. More...
 
int Add (const void *pItem, EFbxType pValueType)
 Appends a new item to the end of the data buffer. More...
 
int InsertAt (int pIndex, const void *pItem, EFbxType pValueType)
 Inserts a new item at the specified position of the data buffer. More...
 
void SetAt (int pIndex, const void *pItem, EFbxType pValueType)
 Sets the value for the specified item. More...
 
void SetLast (const void *pItem, EFbxType pValueType)
 Sets the value of the last item. More...
 
void RemoveAt (int pIndex, void **pItem, EFbxType pValueType)
 Removes the specified item from the data buffer. More...
 
void RemoveLast (void **pItem, EFbxType pValueType)
 Removes the last item from the data buffer. More...
 
bool RemoveIt (void **pItem, EFbxType pValueType)
 Removes one item from the data buffer. More...
 
bool GetAt (int pIndex, void **pItem, EFbxType pValueType) const
 Returns the specified item's value. More...
 
bool GetFirst (void **pItem, EFbxType pValueType) const
 Returns the first item's value. More...
 
bool GetLast (void **pItem, EFbxType pValueType) const
 Returns the last item's value. More...
 
int Find (const void *pItem, EFbxType pValueType) const
 Searches for an item in the data buffer. More...
 
int FindAfter (int pAfterIndex, const void *pItem, EFbxType pValueType) const
 Searches for an item after the specified index in the data buffer. More...
 
int FindBefore (int pBeforeIndex, const void *pItem, EFbxType pValueType) const
 Searches for an item before the specified index in the data buffer. More...
 
bool IsEqual (const FbxLayerElementArray &pArray) const
 Equivalence operator. More...
 
template<class T >
int Add (T const &pItem)
 Appends a new item to the end of the data buffer. More...
 
template<class T >
int InsertAt (int pIndex, T const &pItem)
 Inserts a new item at the specified position of the data buffer. More...
 
template<class T >
void SetAt (int pIndex, T const &pItem)
 Sets the value of the specified item. More...
 
template<class T >
void SetLast (T const &pItem)
 Sets the value of the last item. More...
 
template<class T >
void RemoveAt (int pIndex, T *pItem)
 Removes the specified item from the data buffer. More...
 
template<class T >
void RemoveLast (T *pItem)
 Removes the last item from the data buffer. More...
 
template<class T >
bool RemoveIt (T *pItem)
 Removes one item from the data buffer. More...
 
template<class T >
bool GetAt (int pIndex, T *pItem) const
 Returns the specified item's value. More...
 
template<class T >
bool GetFirst (T *pItem) const
 Returns the first item's value. More...
 
template<class T >
bool GetLast (T *pItem) const
 Returns the last item's value. More...
 
template<class T >
int Find (T const &pItem) const
 Searches for an item in the data buffer. More...
 
template<class T >
int FindAfter (int pAfterIndex, T const &pItem) const
 Searches for an item after the specified index in the data buffer. More...
 
template<class T >
int FindBefore (int pBeforeIndex, T const &pItem) const
 Searches for one item before the specified index in the data buffer. More...
 
template<typename T >
void CopyTo (FbxArray< T > &pDst)
 Copies the items in the data buffer to an array. More...
 

Friends

class FbxLayerElementUserData
 

Additional Inherited Members

- Public Types inherited from FbxLayerElementArray
enum  ELockMode { eReadLock = 1, eWriteLock = 2, eReadWriteLock = 3 }
 Identifies the access mode to the data buffer. More...
 
- Protected Member Functions inherited from FbxLayerElementArray
void * GetDataPtr ()
 
void * GetReference (int pIndex, EFbxType pValueType)
 
void GetReferenceTo (int pIndex, void **pRef, EFbxType pValueType)
 
void SetStatus (LockAccessStatus::ELockAccessStatus pVal) const
 
void SetImplementation (void *pImplementation)
 
void * GetImplementation ()
 
virtual void ConvertDataType (EFbxType pDataType, void **pDataPtr, size_t *pStride)
 
- Protected Attributes inherited from FbxLayerElementArray
EFbxType mDataType
 

Constructor & Destructor Documentation

◆ FbxLayerElementArrayTemplate()

FbxLayerElementArrayTemplate ( EFbxType  pDataType)
inline

Constructor.

Parameters
pDataTypeThe data type of the array items.

Definition at line 865 of file fbxlayer.h.

865  :
866  FbxLayerElementArray(pDataType)
867  {
868  }
FbxLayerElementArray(EFbxType pDataType)
Constructor.

Member Function Documentation

◆ Add()

int Add ( T const &  pItem)
inline

Appends a new item to the end of the data buffer.

Parameters
pItemThe new item to be added
Returns
The index of the new item

Definition at line 874 of file fbxlayer.h.

874 { return FbxLayerElementArray::Add(pItem); }
int Add(const void *pItem, EFbxType pValueType)
Appends a new item to the end of the data buffer.

◆ InsertAt()

int InsertAt ( int  pIndex,
T const &  pItem 
)
inline

Inserts a new item at the specified position of the data buffer.

Parameters
pIndexThe specified position
pItemThe new item to be inserted
Returns
The index of the inserted item

Definition at line 881 of file fbxlayer.h.

881 { return FbxLayerElementArray::InsertAt(pIndex, pItem); }
int InsertAt(int pIndex, const void *pItem, EFbxType pValueType)
Inserts a new item at the specified position of the data buffer.

◆ SetAt()

void SetAt ( int  pIndex,
T const &  pItem 
)
inline

Sets the value of the specified item.

Parameters
pIndexThe index of the item to be updated.
pItemThe item whose value is copied to pIndex'th item

Definition at line 887 of file fbxlayer.h.

887 { FbxLayerElementArray::SetAt(pIndex, pItem); }
void SetAt(int pIndex, const void *pItem, EFbxType pValueType)
Sets the value for the specified item.

◆ SetLast()

void SetLast ( T const &  pItem)
inline

Sets the value of the last item.

Parameters
pItemThe item whose value is copied to the last item

Definition at line 892 of file fbxlayer.h.

void SetLast(const void *pItem, EFbxType pValueType)
Sets the value of the last item.

◆ RemoveAt()

T RemoveAt ( int  pIndex)
inline

Removes the specified item from the data buffer.

Parameters
pIndexThe index of the item to be removed
Returns
The value of the item removed

Definition at line 898 of file fbxlayer.h.

898 { T lValue; FbxLayerElementArray::RemoveAt(pIndex, &lValue); return lValue; }
void RemoveAt(int pIndex, void **pItem, EFbxType pValueType)
Removes the specified item from the data buffer.

◆ RemoveLast()

T RemoveLast ( )
inline

Removes the last item from the data buffer.

Returns
The value of the last item removed

Definition at line 903 of file fbxlayer.h.

903 { T lValue; FbxLayerElementArray::RemoveLast(&lValue); return lValue; }
void RemoveLast(void **pItem, EFbxType pValueType)
Removes the last item from the data buffer.

◆ RemoveIt()

bool RemoveIt ( T const &  pItem)
inline

Removes one item from the data buffer.

Parameters
pItemThe first item who equals pItem is to be removed
Returns
True if the item is removed successfully, false otherwise

Definition at line 909 of file fbxlayer.h.

909 { return FbxLayerElementArray::RemoveIt(&pItem); }
bool RemoveIt(void **pItem, EFbxType pValueType)
Removes one item from the data buffer.

◆ GetAt()

T GetAt ( int  pIndex) const
inline

Returns the specified item's value.

Parameters
pIndexIndex of the item
Returns
The value of the specified item
Remarks
If the index is invalid, pItem is set to zero.

Definition at line 916 of file fbxlayer.h.

916 { T lValue; FbxLayerElementArray::GetAt(pIndex, &lValue); return lValue; }
bool GetAt(int pIndex, void **pItem, EFbxType pValueType) const
Returns the specified item&#39;s value.

◆ GetFirst()

T GetFirst ( ) const
inline

Returns the first item's value.

Returns
The first item's value.

Definition at line 921 of file fbxlayer.h.

921 { T lValue; FbxLayerElementArray::GetFirst(&lValue); return lValue; }
bool GetFirst(void **pItem, EFbxType pValueType) const
Returns the first item&#39;s value.

◆ GetLast()

T GetLast ( ) const
inline

Returns the last item's value.

Returns
The last item's value.

Definition at line 926 of file fbxlayer.h.

926 { T lValue; FbxLayerElementArray::GetLast(&lValue); return lValue; }
bool GetLast(void **pItem, EFbxType pValueType) const
Returns the last item&#39;s value.

◆ Find()

int Find ( T const &  pItem)
inline

Searches for an item in the data buffer.

Parameters
pItemThe value of the item for which to search
Returns
The index of the item found, -1 if not found.
Remarks
The index of the first item whose value equals pItem is returned.

Definition at line 933 of file fbxlayer.h.

933 { return FbxLayerElementArray::Find(pItem); }
int Find(const void *pItem, EFbxType pValueType) const
Searches for an item in the data buffer.

◆ FindAfter()

int FindAfter ( int  pAfterIndex,
T const &  pItem 
)
inline

Searches for an item after the specified index in the data buffer.

Parameters
pAfterIndexThe specified index after which the searching begins
pItemThe value of the item for which to search, the searching begins after pAfterIndex.
Returns
The index of the item found, -1 if not found.
Remarks
The index of the first item whose value equals pItem is returned.

Definition at line 941 of file fbxlayer.h.

941 { return FbxLayerElementArray::FindAfter(pAfterIndex, pItem); }
int FindAfter(int pAfterIndex, const void *pItem, EFbxType pValueType) const
Searches for an item after the specified index in the data buffer.

◆ FindBefore()

int FindBefore ( int  pBeforeIndex,
T const &  pItem 
)
inline

Searches for one item before the specified index in the data buffer.

Parameters
pBeforeIndexThe specified index before which the searching begins
pItemThe value of the item for which to search, the searching begins before pBeforeIndex.
Returns
The index of the item found, -1 if not found.
Remarks
The index of the first item whose value equals pItem is returned.

Definition at line 949 of file fbxlayer.h.

949 { return FbxLayerElementArray::FindBefore(pBeforeIndex, pItem); }
int FindBefore(int pBeforeIndex, const void *pItem, EFbxType pValueType) const
Searches for an item before the specified index in the data buffer.

◆ operator[]()

T operator[] ( int  pIndex) const
inline

Returns the specified item's value.

Parameters
pIndexIndex of the item
Returns
The value of the item
Remarks
If the index is invalid, pItem is set to zero.

Definition at line 956 of file fbxlayer.h.

956 { T lValue; FbxLayerElementArray::GetAt(pIndex, &lValue); return lValue; }
bool GetAt(int pIndex, void **pItem, EFbxType pValueType) const
Returns the specified item&#39;s value.

◆ operator=() [1/2]

FbxLayerElementArray& operator= ( const FbxArray< T > &  pArrayTemplate)
inline

Assignment operator.

Parameters
pArrayTemplateThe source array whose items are copied to this array.

Definition at line 961 of file fbxlayer.h.

962  {
964  if (WriteLock())
965  {
966  SetCount(pArrayTemplate.GetCount());
967  for (int i = 0; i < pArrayTemplate.GetCount(); i++)
968  SetAt(i, pArrayTemplate.GetAt(i));
969  WriteUnlock();
971  }
972  return *this;
973  }
void SetCount(int pCount)
Sets the count of items in the data buffer.
void SetStatus(LockAccessStatus::ELockAccessStatus pVal) const
Definition: fbxlayer.h:789
void WriteUnlock() const
Releases the write lock on this array.
void SetAt(int pIndex, T const &pItem)
Sets the value of the specified item.
Definition: fbxlayer.h:887
T GetAt(const int pIndex) const
Retrieve a copy of the element at given index position in the array.
Definition: fbxarray.h:139
bool WriteLock() const
Locks this array for writing.

◆ operator=() [2/2]

FbxLayerElementArrayTemplate<T>& operator= ( const FbxLayerElementArrayTemplate< T > &  pArrayTemplate)
inline

Assignment operator.

Parameters
pArrayTemplateThe source array whose items are copied to this array.

Definition at line 978 of file fbxlayer.h.

979  {
980  if ( this != &pArrayTemplate )
981  {
983  if (WriteLock())
984  {
985  SetCount(pArrayTemplate.GetCount());
986  for (int i = 0; i < pArrayTemplate.GetCount(); i++)
987  SetAt(i, pArrayTemplate.GetAt(i));
988  WriteUnlock();
990  }
991  }
992  return *this;
993  }
void SetCount(int pCount)
Sets the count of items in the data buffer.
void SetStatus(LockAccessStatus::ELockAccessStatus pVal) const
Definition: fbxlayer.h:789
void WriteUnlock() const
Releases the write lock on this array.
void SetAt(int pIndex, T const &pItem)
Sets the value of the specified item.
Definition: fbxlayer.h:887
int GetCount() const
Returns the count of items in the data buffer.
bool WriteLock() const
Locks this array for writing.
T GetAt(int pIndex) const
Returns the specified item&#39;s value.
Definition: fbxlayer.h:916

Friends And Related Function Documentation

◆ FbxLayerElementUserData

friend class FbxLayerElementUserData
friend

Definition at line 999 of file fbxlayer.h.


The documentation for this class was generated from the following file: