浏览该文件的文档.
33 template <AkMemID T_MEMID>
38 return AkAlloc(T_MEMID, in_uSize);
43 AkFree(T_MEMID, in_pAddress);
47 template <AkMemID T_MEMID>
57 AkFree(T_MEMID, in_pAddress);
65 template <
class T,
class TAlloc = AkRingBufferAllocatorDefault>
75 , m_nbReadableItems(0)
84 m_nbReadableItems = 0;
86 m_data =
reinterpret_cast<T*
>(TAlloc::Alloc(m_nbItems *
sizeof(T)));
99 m_nbReadableItems = 0;
113 m_nbReadableItems = 0;
125 return &m_data[m_writeIndex];
132 m_writeIndex = (m_writeIndex + nbItems) % m_nbItems;
146 return &m_data[m_readIndex];
153 AkUInt32 uReadIndex = (m_readIndex + uOffset) % m_nbItems;
154 return &m_data[uReadIndex];
161 m_readIndex = (m_readIndex + nbItems) % m_nbItems;
185 AkUInt32 uTargetItems = m_nbItems + in_uGrowBy;
186 if (T* pNewData =
reinterpret_cast<T*
>(TAlloc::Alloc(uTargetItems *
sizeof(T))))
191 if (m_readIndex >= m_writeIndex)
196 memcpy(pNewData, m_data,
sizeof(T) * m_writeIndex);
198 memcpy(pNewData + m_readIndex + in_uGrowBy, m_data + m_readIndex,
sizeof(T) * (m_nbItems - m_readIndex));
199 m_readIndex += in_uGrowBy;
205 memcpy(pNewData + m_readIndex, m_data + m_readIndex,
sizeof(T) * uReadableItems);
211 m_nbItems = uTargetItems;
const T * Peek(AkUInt32 uOffset) const
AkUInt32 GetReadIndex() const
const T * GetReadPtr() const
AkUInt32 GetWriteIndex() const
#define AkFree(_pool, _pvmem)
static AkForceInline void Free(void *in_pAddress)
AKSOUNDENGINE_API void Free(AkMemPoolId in_poolId, void *in_pMemAddress)
static AkForceInline void * Alloc(size_t in_uSize)
AKRESULT
Standard function call result.
AkRingBufferAllocatorAligned< AkMemID_Processing > AkRingBufferAllocatorLEngineAligned
static AkForceInline void * Alloc(size_t in_uSize)
AkRingBufferAllocatorNoAlign< AkMemID_Object > AkRingBufferAllocatorDefault
#define AkAlloc(_pool, _size)
@ AK_Success
The operation was successful.
static AkForceInline void Free(void *in_pAddress)
void IncrementReadIndex(AkUInt32 nbItems)
AkUInt32 GetNbReadableItems() const
AkUInt32 GetNbWritableItems() const
#define AKASSERT(Condition)
AKRESULT Init(AkUInt32 nbItems)
#define AkMalign(_pool, _size, _align)
void IncrementWriteIndex(AkUInt32 nbItems)
uint32_t AkUInt32
Unsigned 32-bit integer
@ AK_InsufficientMemory
Memory error.
bool Grow(AkUInt32 in_uGrowBy)
AkRingBufferAllocatorNoAlign< AkMemID_Processing > AkRingBufferAllocatorLEngine
介绍一下自己的项目。我们会竭力为您提供帮助。
来注册自己的项目,我们帮您快速入门,不带任何附加条件!
开始 Wwise 之旅