[*] Shared user data between ICompletionGroupWorkHandle and IAsyncTransaction

This commit is contained in:
Reece Wilson 2024-02-24 22:15:20 +00:00
parent 493f449d1d
commit 2a555626bb
7 changed files with 39 additions and 16 deletions

View File

@ -14,5 +14,7 @@ namespace Aurora::IO::CompletionGroup
// pls gimme a vtable of a single purecall stub
inline virtual ~ICompletionGroupWorkHandle()
{ };
AURT_ADD_USR_DATA;
};
}

View File

@ -21,5 +21,7 @@ namespace Aurora::IO::FS
virtual bool BlockingTruncate(AuUInt64 length) = 0;
virtual bool BlockingRead(AuUInt64 offset, const Memory::MemoryViewStreamWrite &parameters) = 0;
virtual bool BlockingWrite(AuUInt64 offset, const Memory::MemoryViewStreamRead &parameters) = 0;
AURT_ADD_USR_DATA;
};
}

View File

@ -102,5 +102,7 @@ namespace Aurora::IO::FS
* @brief
*/
virtual IO::IStreamWriter *ToStreamWriter() = 0;
AURT_ADD_USR_DATA;
};
}

View File

@ -85,23 +85,12 @@ namespace Aurora::IO
virtual void SetBaseOffset(AuUInt64 uBaseOffset) = 0;
// TODO: remove me (new api stub)
inline virtual bool TryAttachToCompletionGroup(const AuSPtr<CompletionGroup::ICompletionGroup> &pCompletionGroup)
{
return false;
}
virtual bool TryAttachToCompletionGroup(const AuSPtr<CompletionGroup::ICompletionGroup> &pCompletionGroup) = 0;
// TODO: remove me (new api stub)
inline virtual CompletionGroup::ICompletionGroupWorkHandle *ToCompletionGroupHandle()
{
return nullptr;
}
virtual CompletionGroup::ICompletionGroupWorkHandle *ToCompletionGroupHandle() = 0;
virtual AuSPtr<CompletionGroup::ICompletionGroup> GetCompletionGroup() = 0;
inline virtual AuSPtr<CompletionGroup::ICompletionGroup> GetCompletionGroup()
{
return nullptr;
}
AURT_ADD_USR_DATA;
AURT_ADD_USR_DATA_EXP(this->ToCompletionGroupHandle());
};
}

View File

@ -135,5 +135,7 @@ namespace Aurora::Processes
virtual bool TryAttachProcessExitToCompletionGroup(const AuSPtr<IO::CompletionGroup::ICompletionGroup> &pCompletionGroup) = 0;
virtual IO::CompletionGroup::ICompletionGroupWorkHandle *ToCompletionGroupHandle() = 0;
AURT_ADD_USR_DATA_EXP(this->ToCompletionGroupHandle());
};
}

View File

@ -35,6 +35,8 @@ namespace Aurora::Processes
virtual IProcess *GetProcess() = 0;
virtual bool TryAttachProcessExitToCompletionGroup(const AuSPtr<IO::CompletionGroup::ICompletionGroup> &pCompletionGroup) = 0;
virtual IO::CompletionGroup::ICompletionGroupWorkHandle *ToCompletionGroupHandle() = 0;
AURT_ADD_USR_DATA_EXP(this->ToCompletionGroupHandle());
};
AUKN_SYM OutputOfResult OutputOf(StartupParameters &&parameters,

View File

@ -96,6 +96,30 @@ namespace Aurora::Utility
AuResetMember(this->_auReservedUserData.pData);\
}
#define AURT_ADD_USR_DATA_EXP(exp) \
inline virtual AURT_PRIVATE_DATA_PTR PrivateUserDataGet()\
{\
return exp->PrivateUserDataGet();\
}\
inline virtual bool PrivateUserDataExchange(AURT_PRIVATE_DATA_PTR pExpect, AURT_PRIVATE_DATA_PTR pReplace)\
{\
return exp->PrivateUserDataExchange(pExpect, pReplace);\
}\
template<typename T>\
inline AuSPtr<T> PrivateUserDataNewData()\
{\
return exp->PrivateUserDataNewData<T>();\
}\
template<typename T>\
inline AuSPtr<T> PrivateUserDataGetSharedData()\
{\
return exp->PrivateUserDataGetSharedData<T>();\
}\
inline Aurora::Threading::Primitives::IHyperWaitable *PrivateUserDataToUtilityMutex()\
{\
return exp->PrivateUserDataToUtilityMutex();\
}
#if defined(AURORA_USR_DATA_DISABLED)
#undef AURT_ADD_USR_DATA
#define AURT_ADD_USR_DATA