This reference page is linked to from the following overview topics: List of Python FBX classes.
KFbxLayerElementArray is the base class for KFbxLayerElementArrayTemplate, it provides lock handling and data array manipulation of the data buffer for KFbxLayerElement.
Definition at line 390 of file kfbxlayer.h.
#include <kfbxlayer.h>
Public Types |
|
enum | ELockMode { eREAD_LOCK = 1, eWRITE_LOCK = 2, eREADWRITE_LOCK = 3 } |
Identifies the access mode to the data buffer. More... |
|
Public Member Functions |
|
bool | IsInUse () const |
Returns whether this Array is accessed in
any way. |
|
int | ReadLock () const |
Increments the number of read locks on this
array. |
|
int | ReadUnlock () const |
Releases a read lock on this array. |
|
bool | WriteLock () const |
Locks this array for writing. |
|
void | WriteUnlock () const |
Releases the write lock on this array.
|
|
bool | ReadWriteLock () const |
Locks this array for writing. |
|
void | ReadWriteUnlock () const |
Releases the write lock on this array.
|
|
virtual void * | GetLocked (ELockMode pLockMode, EFbxType pDataType) |
Grants a locked access to the data buffer.
|
|
void * | GetLocked (ELockMode pLockMode=eREADWRITE_LOCK) |
Grants a locked access to the data buffer.
|
|
template<class T > | |
T * | GetLocked (T *dummy=NULL, ELockMode pLockMode=eREADWRITE_LOCK) |
Grants a locked access to the data buffer.
|
|
virtual void | Release (void **pDataPtr, EFbxType pDataType) |
Unlock the data buffer. |
|
void | Release (void **pDataPtr) |
Unlock the data buffer. |
|
template<class T > | |
void | Release (T **pDataPtr, T *dummy) |
Unlock the data buffer. |
|
virtual size_t | GetStride () const |
Returns the Stride size which equals the
size of the data type of the data buffer. |
|
Protected Member Functions |
|
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 |
|
EFbxType | mDataType |
Constructor and Destructor |
|
KFbxLayerElementArray (EFbxType pDataType) | |
Constructor. |
|
virtual | ~KFbxLayerElementArray () |
Destructor. |
|
Status handling |
|
void | ClearStatus () |
Clears the access state and sets it to
eSuccess. |
|
LockAccessStatus::ELockAccessStatus | GetStatus () const |
Retrieves the access state. |
|
Locks handling |
|
bool | IsWriteLocked () const |
Returns whether write is locked. |
|
int | GetReadLockCount () const |
Retrieves the read lock count. |
|
Data array manipulation |
|
int | GetCount () const |
Returns the count of items in the data
buffer. |
|
void | SetCount (int pCount) |
Sets the count of items in the data buffer.
|
|
void | Clear () |
Clears the data buffer. |
|
void | Resize (int pItemCount) |
Resizes the data buffer. |
|
void | AddMultiple (int pItemCount) |
Appends space to the data buffer. |
|
int | Add (void const *pItem, EFbxType pValueType) |
Appends a new item to the end of the data
buffer. |
|
int | InsertAt (int pIndex, void const *pItem, EFbxType pValueType) |
Inserts a new item at the specified position
of the data buffer. |
|
void | SetAt (int pIndex, void const *pItem, EFbxType pValueType) |
Sets the value for the specified item.
|
|
void | SetLast (void const *pItem, EFbxType pValueType) |
Sets the value of the last item. |
|
void | RemoveAt (int pIndex, void **pItem, EFbxType pValueType) |
Removes the specified item from the data
buffer. |
|
void | RemoveLast (void **pItem, EFbxType pValueType) |
Removes the last item from the data buffer.
|
|
bool | RemoveIt (void **pItem, EFbxType pValueType) |
Removes one item from the data buffer.
|
|
bool | GetAt (int pIndex, void **pItem, EFbxType pValueType) const |
Returns the specified item's value. |
|
bool | GetFirst (void **pItem, EFbxType pValueType) const |
Returns the first item's value. |
|
bool | GetLast (void **pItem, EFbxType pValueType) const |
Returns the last item's value. |
|
int | Find (void const *pItem, EFbxType pValueType) const |
Searches for an item in the data buffer.
|
|
int | FindAfter (int pAfterIndex, void const *pItem, EFbxType pValueType) const |
Searches for an item after the specified
index in the data buffer. |
|
int | FindBefore (int pBeforeIndex, void const *pItem, EFbxType pValueType) const |
Searches for an item before the specified
index in the data buffer. |
|
bool | IsEqual (const KFbxLayerElementArray &pArray) const |
Equivalence operator. |
|
template<class T > | |
int | Add (T const &pItem) |
Appends a new item to the end of the data
buffer. |
|
template<class T > | |
int | InsertAt (int pIndex, T const &pItem) |
Inserts a new item at the specified position
of the data buffer. |
|
template<class T > | |
void | SetAt (int pIndex, T const &pItem) |
Sets the value of the specified item.
|
|
template<class T > | |
void | SetLast (T const &pItem) |
Sets the value of the last item. |
|
template<class T > | |
void | RemoveAt (int pIndex, T *pItem) |
Removes the specified item from the data
buffer. |
|
template<class T > | |
void | RemoveLast (T *pItem) |
Removes the last item from the data buffer.
|
|
template<class T > | |
bool | RemoveIt (T *pItem) |
Removes one item from the data buffer.
|
|
template<class T > | |
bool | GetAt (int pIndex, T *pItem) const |
Returns the specified item's value. |
|
template<class T > | |
bool | GetFirst (T *pItem) const |
Returns the first item's value. |
|
template<class T > | |
bool | GetLast (T *pItem) const |
Returns the last item's value. |
|
template<class T > | |
int | Find (T const &pItem) const |
Searches for an item in the data buffer.
|
|
template<class T > | |
int | FindAfter (int pAfterIndex, T const &pItem) const |
Searches for an item after the specified
index in the data buffer. |
|
template<class T > | |
int | FindBefore (int pBeforeIndex, T const &pItem) const |
Searches for one item before the specified
index in the data buffer. |
|
template<typename T > | |
void | CopyTo (KArrayTemplate< T > &pDst) |
Copies the items in the data buffer to an
array. |
enum ELockMode |
Identifies the access mode to the data buffer.
Definition at line 477 of file kfbxlayer.h.
{ eREAD_LOCK = 1, eWRITE_LOCK = 2, eREADWRITE_LOCK = 3 } ELockMode;
KFbxLayerElementArray | ( | EFbxType | pDataType | ) |
Constructor.
pDataType | The data type of the items in the data array. |
virtual ~KFbxLayerElementArray | ( | ) | [virtual] |
Destructor.
void ClearStatus | ( | ) | [inline] |
Clears the access state and sets it to eSuccess.
Definition at line 414 of file kfbxlayer.h.
{ mStatus = LockAccessStatus::eSuccess; }
LockAccessStatus::ELockAccessStatus GetStatus | ( | ) | const [inline] |
bool IsWriteLocked | ( | ) | const [inline] |
Returns whether write is locked.
True
if write is locked, false
otherwise.Definition at line 428 of file kfbxlayer.h.
{ return mWriteLock; };
int GetReadLockCount | ( | ) | const [inline] |
Retrieves the read lock count.
Definition at line 433 of file kfbxlayer.h.
{ return mReadLockCount; }
bool IsInUse | ( | ) | const |
Returns whether this Array is accessed in any way.
True
if it is in use, false
otherwise.int ReadLock | ( | ) | const |
Increments the number of read locks on this array.
int ReadUnlock | ( | ) | const |
Releases a read lock on this array.
bool WriteLock | ( | ) | const |
Locks this array for writing.
The data in the array is wiped out.
True
if a write lock has been successfully
granted, false
if one or more read locks are
active.void WriteUnlock | ( | ) | const |
Releases the write lock on this array.
bool ReadWriteLock | ( | ) | const |
Locks this array for writing.
The data that already exists in the array is kept and is valid.
True
if a write lock has been successfully
granted, false
if one or more read locks are
active.void ReadWriteUnlock | ( | ) | const |
Releases the write lock on this array.
Grants a locked access to the data buffer.
pLockMode | Access mode to the data buffer. |
pDataType | If defined, tries to return the data as this type. |
void* GetLocked | ( | ELockMode | pLockMode =
eREADWRITE_LOCK |
) | [inline] |
Grants a locked access to the data buffer.
pLockMode | Access mode to the data buffer. |
Definition at line 508 of file kfbxlayer.h.
T* GetLocked | ( | T * | dummy = NULL , |
ELockMode | pLockMode =
eREADWRITE_LOCK |
||
) | [inline] |
Grants a locked access to the data buffer.
dummy | The data type of dummy is used to specialize this function. |
pLockMode | Access mode to the data buffer. |
Definition at line 522 of file kfbxlayer.h.
{T v; return (T*)GetLocked(pLockMode, _FbxTypeOf(v)); }
virtual void Release | ( | void ** | pDataPtr, |
EFbxType | pDataType | ||
) | [virtual] |
Unlock the data buffer.
pDataPtr | The buffer to be released. |
pDataType | The data type of the data buffer. |
void Release | ( | void ** | pDataPtr | ) | [inline] |
Unlock the data buffer.
pDataPtr | The buffer to be released. |
Definition at line 545 of file kfbxlayer.h.
void Release | ( | T ** | pDataPtr, |
T * | dummy | ||
) | [inline] |
Unlock the data buffer.
pDataPtr | The buffer to be released. |
dummy | The data type of dummy is used to specialize this function. |
Definition at line 557 of file kfbxlayer.h.
{ Release((void**)pDataPtr, _FbxTypeOf(*dummy)); }
virtual size_t GetStride | ( | ) | const [virtual] |
Returns the Stride size which equals the size of the data type of the data buffer.
int GetCount | ( | ) | const |
Returns the count of items in the data buffer.
void SetCount | ( | int | pCount | ) |
Sets the count of items in the data buffer.
pCount | The count of items to be set. |
void Clear | ( | ) |
Clears the data buffer.
void Resize | ( | int | pItemCount | ) |
Resizes the data buffer.
pItemCount | The new size of the data buffer. |
void AddMultiple | ( | int | pItemCount | ) |
Appends space to the data buffer.
pItemCount | The appended space size |
int Add | ( | void const * | pItem, |
EFbxType | pValueType | ||
) |
Appends a new item to the end of the data buffer.
pItem | Pointer of the new item to be added |
pValueType | Data type of the new item |
int InsertAt | ( | int | pIndex, |
void const * | pItem, | ||
EFbxType | pValueType | ||
) |
Inserts a new item at the specified position of the data buffer.
pIndex | The specified position |
pItem | Pointer of the new item to be inserted |
pValueType | Data type of the new item |
void SetAt | ( | int | pIndex, |
void const * | pItem, | ||
EFbxType | pValueType | ||
) |
Sets the value for the specified item.
pIndex | The index of the item to be updated. |
pItem | Pointer of the item whose value is copied to pIndex'th item |
pValueType | Data type of the item |
void SetLast | ( | void const * | pItem, |
EFbxType | pValueType | ||
) |
Sets the value of the last item.
pItem | Pointer of the item whose value is copied to the last item |
pValueType | Data type of the item |
void RemoveAt | ( | int | pIndex, |
void ** | pItem, | ||
EFbxType | pValueType | ||
) |
Removes the specified item from the data buffer.
pIndex | The index of the item to be removed |
pItem | Place to hold the value of the removed item. |
pValueType | Data type of the item |
void RemoveLast | ( | void ** | pItem, |
EFbxType | pValueType | ||
) |
Removes the last item from the data buffer.
pItem | Place to hold the value of the removed item. |
pValueType | Data type of the item |
bool RemoveIt | ( | void ** | pItem, |
EFbxType | pValueType | ||
) |
Removes one item from the data buffer.
pItem | The first item who equals pItem is to be removed |
pValueType | Data type of the item |
True
if the item is removed successfully,
false
otherwisebool GetAt | ( | int | pIndex, |
void ** | pItem, | ||
EFbxType | pValueType | ||
) | const |
Returns the specified item's value.
pIndex | Index of the item |
pItem | Place to hold the item's value |
pValueType | Data type of the item |
True
if the item's value is returned successfully,
false
otherwisebool GetFirst | ( | void ** | pItem, |
EFbxType | pValueType | ||
) | const |
Returns the first item's value.
pItem | Place to hold the item's value |
pValueType | Data type of the item |
True
if the item's value is returned successfully,
false
otherwisebool GetLast | ( | void ** | pItem, |
EFbxType | pValueType | ||
) | const |
Returns the last item's value.
pItem | Place to hold the item's value |
pValueType | Data type of the item |
True
if the item's value is returned successfully,
false
otherwiseint Find | ( | void const * | pItem, |
EFbxType | pValueType | ||
) | const |
Searches for an item in the data buffer.
pItem | The value of the item for which to search. |
pValueType | Data type of the item |
int FindAfter | ( | int | pAfterIndex, |
void const * | pItem, | ||
EFbxType | pValueType | ||
) | const |
Searches for an item after the specified index in the data buffer.
pAfterIndex | The specified index after which the searching begins |
pItem | The value of the item for which to search, the searching begins after pAfterIndex. |
pValueType | Data type of the item |
int FindBefore | ( | int | pBeforeIndex, |
void const * | pItem, | ||
EFbxType | pValueType | ||
) | const |
Searches for an item before the specified index in the data buffer.
pBeforeIndex | The specified index before which the searching begins |
pItem | The value of the item for which to search, the searching begins before pBeforeIndex. |
pValueType | The item's data type. |
bool IsEqual | ( | const KFbxLayerElementArray & | pArray | ) | const |
Equivalence operator.
pArray | Array compared to this one |
True
if equal. false
otherwise.int Add | ( | T const & | pItem | ) | [inline] |
Appends a new item to the end of the data buffer.
pItem | The new item to be added |
Reimplemented in KFbxLayerElementArrayTemplate< T >.
Definition at line 701 of file kfbxlayer.h.
{ return Add((void const*)&pItem, _FbxTypeOf(pItem)); }
int InsertAt | ( | int | pIndex, |
T const & | pItem | ||
) | [inline] |
Inserts a new item at the specified position of the data buffer.
pIndex | The specified position |
pItem | The new item to be inserted |
Reimplemented in KFbxLayerElementArrayTemplate< T >.
Definition at line 709 of file kfbxlayer.h.
{ return InsertAt(pIndex, (void const*)&pItem, _FbxTypeOf(pItem)); }
void SetAt | ( | int | pIndex, |
T const & | pItem | ||
) | [inline] |
Sets the value of the specified item.
pIndex | The index of the item to be updated. |
pItem | The item whose value is copied to pIndex'th item |
Reimplemented in KFbxLayerElementArrayTemplate< T >.
Definition at line 716 of file kfbxlayer.h.
{ SetAt(pIndex, (void const*)&pItem, _FbxTypeOf(pItem)); }
void SetLast | ( | T const & | pItem | ) | [inline] |
Sets the value of the last item.
pItem | The item whose value is copied to the last item |
Reimplemented in KFbxLayerElementArrayTemplate< T >.
Definition at line 722 of file kfbxlayer.h.
{ SetLast((void const*)&pItem, _FbxTypeOf(pItem)); }
void RemoveAt | ( | int | pIndex, |
T * | pItem | ||
) | [inline] |
Removes the specified item from the data buffer.
pIndex | The index of the item to be removed |
pItem | Place to hold the value of the removed item. |
Definition at line 729 of file kfbxlayer.h.
{ RemoveAt(pIndex, (void**)&pItem, _FbxTypeOf(*pItem)); }
void RemoveLast | ( | T * | pItem | ) | [inline] |
Removes the last item from the data buffer.
pItem | Place to hold the value of the removed item. |
Definition at line 735 of file kfbxlayer.h.
{ RemoveLast((void**)&pItem, _FbxTypeOf(*pItem)); }
bool RemoveIt | ( | T * | pItem | ) | [inline] |
Removes one item from the data buffer.
pItem | The first item who equals pItem is to be removed |
True
if the item is removed successfully,
false
otherwiseDefinition at line 741 of file kfbxlayer.h.
{ return RemoveIt((void**)&pItem, _FbxTypeOf(*pItem)); }
bool GetAt | ( | int | pIndex, |
T * | pItem | ||
) | const [inline] |
Returns the specified item's value.
pIndex | Index of the item |
pItem | Place to hold the item's value |
True
if the item's value is returned successfully,
false
otherwiseDefinition at line 749 of file kfbxlayer.h.
{ return GetAt(pIndex, (void**)&pItem, _FbxTypeOf(*pItem)); }
bool GetFirst | ( | T * | pItem | ) | const [inline] |
Returns the first item's value.
pItem | Place to hold the item's value |
True
if the item's value is returned successfully,
false
otherwiseDefinition at line 755 of file kfbxlayer.h.
{ return GetFirst((void**)&pItem, _FbxTypeOf(*pItem)); }
bool GetLast | ( | T * | pItem | ) | const [inline] |
Returns the last item's value.
pItem | Place to hold the item's value |
True
if the item's value is returned successfully,
false
otherwiseDefinition at line 761 of file kfbxlayer.h.
{ return GetLast((void**)&pItem, _FbxTypeOf(*pItem)); }
int Find | ( | T const & | pItem | ) | const [inline] |
Searches for an item in the data buffer.
pItem | The value of the item for which to search. |
Definition at line 768 of file kfbxlayer.h.
{ return Find((void const*)&pItem, _FbxTypeOf(pItem)); }
int FindAfter | ( | int | pAfterIndex, |
T const & | pItem | ||
) | const [inline] |
Searches for an item after the specified index in the data buffer.
pAfterIndex | The specified index after which the searching begins |
pItem | The value of the item for which to search, the searching begins after pAfterIndex. |
Definition at line 776 of file kfbxlayer.h.
{ return FindAfter(pAfterIndex, (void const*)&pItem, _FbxTypeOf(pItem)); }
int FindBefore | ( | int | pBeforeIndex, |
T const & | pItem | ||
) | const [inline] |
Searches for one item before the specified index in the data buffer.
pBeforeIndex | The specified index before which the searching begins |
pItem | The value of the item for which to search, the searching begins before pBeforeIndex. |
Definition at line 784 of file kfbxlayer.h.
{ return FindBefore(pBeforeIndex, (void const*)&pItem, _FbxTypeOf(pItem)); }
void CopyTo | ( | KArrayTemplate< T > & | pDst | ) | [inline] |
Copies the items in the data buffer to an array.
pDst | The destination array where the items are to be copied. |
Definition at line 790 of file kfbxlayer.h.
{ T src; T* srcPtr = &src; pDst.Clear(); if (mDataType != _FbxTypeOf(src)) { SetStatus(LockAccessStatus::eUnsupportedDTConversion); return; } pDst.SetCount(GetCount()); for (int i = 0; i < GetCount(); i++) { if (GetAt(i, (void**)&srcPtr, mDataType)) { pDst.SetAt(i, src); } } SetStatus(LockAccessStatus::eSuccess); }
void* GetDataPtr | ( | ) | [protected] |
void* GetReference | ( | int | pIndex, |
EFbxType | pValueType | ||
) | [protected] |
void GetReferenceTo | ( | int | pIndex, |
void ** | pRef, | ||
EFbxType | pValueType | ||
) | [protected] |
void SetStatus | ( | LockAccessStatus::ELockAccessStatus | pVal | ) | const [inline, protected] |
Definition at line 819 of file kfbxlayer.h.
{ const_cast<KFbxLayerElementArray*>(this)->mStatus = pVal; }
void SetImplementation | ( | void * | pImplementation | ) | [protected] |
void* GetImplementation | ( | ) | [inline, protected] |
virtual void ConvertDataType | ( | EFbxType | pDataType, |
void ** | pDataPtr, | ||
size_t * | pStride | ||
) | [protected, virtual] |
Definition at line 828 of file kfbxlayer.h.