17 #include <pia/clone/clone_definitions.h> 18 #include <pia/clone/clone_CloneElementBase.h> 19 #include <pia/common/common_OffsetList.h> 51 void Trace(u64 flag)
const;
90 u32 GetBufferEventWaitingStationIndexBitmap(
int index)
const;
103 ClockValue GetBufferEventClock(
int index)
const;
110 virtual u16 GetType()
const 112 return GetTypeStatic();
114 virtual bool IsSupportedClone(
int cloneType)
const;
116 static u16 GetTypeStatic()
123 IDataPacker* pAckPacker,
131 static size_t GetDataChunkHeaderSize();
137 enum ReceiveDataResponse
141 RESPONSE_PRESERVER_MIGRATION
143 ReceiveDataResponse ReceiveData(
const void* cpData,
size_t size,
StationIndex src,
StationIndex setter,
ClockValue clock, u64 registerCountAll, u32 destBitmap, Index index, Index eraseIndex);
145 void ReceivePreserverMigration(
StationIndex src, Index index);
151 virtual void ClearData();
159 static const size_t cBufferSizeMin = 2;
160 static const size_t cBufferSizeMax = 0x3fff;
163 class EventSendToken :
public CloneElementBase::ResendableSendToken
171 virtual TokenType GetTokenType()
const = 0;
175 class EventInitialToken :
public EventSendToken
179 : EventSendToken(), m_pElement(pElement)
183 virtual Type GetElementType()
const 187 virtual u32 GetDestBitmap()
const 191 virtual TokenType GetTokenType()
const 193 return TOKEN_INITIAL;
195 virtual size_t GetChunkSize()
const;
196 virtual void WriteChunk(
void* pChunkBuffer)
const;
204 return m_pElement->GetId();
207 Index GetInitialIndex()
const 209 return m_pElement->m_pEventTokenBuffer->GetNextIndex();
211 void SetDestBitmap(u32 destBitmap)
213 m_DestBitmap = destBitmap;
222 class EventTokenBase :
public EventSendToken
231 m_pElement = pElement;
234 virtual Type GetElementType()
const 238 virtual u32 GetDestBitmap()
const 242 virtual TokenType GetTokenType()
const 246 virtual size_t GetChunkSize()
const;
247 virtual void WriteChunk(
void* pChunkBuffer)
const;
252 virtual bool IsUnicast()
const 257 Index GetIndex()
const 263 return m_SetterStationIndex;
267 return m_PreserverStationIndex;
273 u64 GetRegisterCountAll()
const 275 return m_RegisterCountAll;
278 void SetDestBitmap(u32 destBitmap)
280 m_DestBitmap = destBitmap;
282 void RemoveDestBmp(u32 bmp)
284 m_DestBitmap &= ~bmp;
290 void SetIndex(Index index)
296 m_SetterStationIndex = stationId;
300 m_PreserverStationIndex = stationId;
306 void SetRegisterCountAll(u64 count)
308 m_RegisterCountAll = count;
313 EVENT_TOKEN_STATE_EMPTY,
314 EVENT_TOKEN_STATE_SET,
315 EVENT_TOKEN_STATE_RECEIVED,
316 EVENT_TOKEN_STATE_HANDLED
319 State GetState()
const 323 void SetState(State state)
330 return m_pElement->GetId();
332 virtual size_t GetSize()
const 334 return m_pElement->GetSize();
336 virtual void Serialize(
void* pBuffer)
const = 0;
337 virtual void Deserialize(
const void* cpBuffer) = 0;
338 Index GetEraseIndex()
const 340 return m_pElement->m_pEventTokenBuffer->GetEraseIndex();
343 void CancelSendData()
345 m_pElement->CancelSendData(
this);
349 m_pElement->AddSendData(
this);
359 u64 m_RegisterCountAll;
364 class EventTokenBufferBase
367 explicit EventTokenBufferBase(u32 size);
371 void InitIndex(Index index);
372 EventTokenBase* Get(Index index);
373 EventTokenBase* AssignNext();
374 EventTokenBase* Assign(Index index);
377 Index GetHeadIndex()
const 379 return At(m_HeadIdx)->GetIndex();
385 Index GetEraseIndex()
const 389 Index GetNextIndex()
const;
392 void Complement(
StationIndex stationId, u32 destBitmap);
400 u32 GetBufferEventWaitingStationIndexBitmap(
int index)
const;
401 ClockValue GetBufferEventClock(
int index)
const;
404 virtual EventTokenBase* At(
int idx) = 0;
405 virtual const EventTokenBase* At(
int idx)
const = 0;
419 nn::Result SetValueCore(EventTokenBase** ppTokenBase,
bool isEnableSendDelay);
420 void HandleNextCore();
421 const EventTokenBase* GetHandlingEventToken()
const 423 return m_pHandlingEventToken;
430 EVENT_INDEX_STATE_INVALID,
431 EVENT_INDEX_STATE_INIT,
432 EVENT_INDEX_STATE_ADJUST,
433 EVENT_INDEX_STATE_VALID
436 IndexState m_IndexState;
438 Index m_HandledIndex;
439 EventTokenBase* m_pHandlingEventToken;
442 EventInitialToken m_InitialToken;
443 EventTokenBufferBase* m_pEventTokenBuffer;
447 static Definition<EventCloneElementBase> s_Definition;
450 template <
int TEST_ID,
typename Arg>
This is the base class for managing data that is sent and received. .
Definition: clone_CloneElementBase.h:40
This is the base class for managing the sending and receiving of events.
Definition: clone_EventCloneElementBase.h:37
u32 ClockValue
Defines a type that holds a clock value.
Definition: clone_definitions.h:44
StationIndex
Enumerates StationIndex values.
Definition: platformCtr.h:44
void Trace(u64 flag) const
Prints information that is useful for debugging.
virtual ~EventCloneElementBase()
Destroys the object.
size_t GetUsingBufferNum() const
Gets the current number of event buffers in use.
bool IsDropEvent() const
Gets whether a drop event error occurred.
Definition: clone_EventCloneElementBase.h:63
u16 Id
Specifies the type of the ID for identifying clone elements.
Definition: clone_CloneElementBase.h:59
Id GetId() const
Gets the ID.
Definition: clone_CloneElementBase.h:67