AppFrameWork: adjust IAppSystem interface

In this engine, GetTier() doesn't exist, GetDependencies() however does exist (confirmed by the vftable for CInputStackSystem) and therefore we should adjust all interfaces to make it use this instead.
This commit is contained in:
Kawe Mazidjatari 2024-11-15 14:58:57 +01:00
parent f45ca75474
commit 1e7bfcde2e
4 changed files with 17 additions and 33 deletions

View File

@ -10,7 +10,7 @@ public:
virtual void* QueryInterface(const char* const pInterfaceName) = 0; virtual void* QueryInterface(const char* const pInterfaceName) = 0;
virtual InitReturnVal_t Init() = 0; virtual InitReturnVal_t Init() = 0;
virtual void Shutdown() = 0; virtual void Shutdown() = 0;
virtual AppSystemTier_t GetTier() = 0; virtual AppSystemInfo_t* GetDependencies() = 0;
virtual void Reconnect(const CreateInterfaceFn factory, const char* const pInterfaceName) = 0; virtual void Reconnect(const CreateInterfaceFn factory, const char* const pInterfaceName) = 0;
// This function must be called before init // This function must be called before init

View File

@ -6,17 +6,6 @@
class CBaseFileSystem : public CTier1AppSystem<IFileSystem> class CBaseFileSystem : public CTier1AppSystem<IFileSystem>
{ {
public: public:
// Stub implementation of IAppSystem.
//virtual ~CBaseFileSystem() {};
virtual bool Connect(const CreateInterfaceFn factory) { return false; };
virtual void Disconnect() {};
virtual void* QueryInterface(const char* const pInterfaceName) { return nullptr; };
virtual InitReturnVal_t Init() { return InitReturnVal_t::INIT_FAILED; };
virtual void Shutdown() {};
virtual AppSystemTier_t GetTier() { return AppSystemTier_t::APP_SYSTEM_TIER_OTHER; };
virtual void Reconnect(const CreateInterfaceFn factory, const char* const pInterfaceName) {};
//-------------------------------------------------------- //--------------------------------------------------------
virtual bool IsSteam() const { return false; }; virtual bool IsSteam() const { return false; };
virtual FilesystemMountRetval_t MountSteamContent(int nExtraAppId = -1) { return FilesystemMountRetval_t::FILESYSTEM_MOUNT_FAILED; }; virtual FilesystemMountRetval_t MountSteamContent(int nExtraAppId = -1) { return FilesystemMountRetval_t::FILESYSTEM_MOUNT_FAILED; };

View File

@ -69,10 +69,7 @@ public:
virtual void Shutdown() = 0; virtual void Shutdown() = 0;
// Returns all dependent libraries // Returns all dependent libraries
//virtual const AppSystemInfo_t* GetDependencies() { return NULL; } virtual const AppSystemInfo_t* GetDependencies() { return NULL; }
// Returns the tier
virtual AppSystemTier_t GetTier() = 0;
// Reconnect to a particular interface // Reconnect to a particular interface
virtual void Reconnect(const CreateInterfaceFn factory, const char* const pInterfaceName) = 0; virtual void Reconnect(const CreateInterfaceFn factory, const char* const pInterfaceName) = 0;
@ -88,25 +85,22 @@ public:
virtual ~CBaseAppSystem() {}; // Prepended on each class derived class in assembly. virtual ~CBaseAppSystem() {}; // Prepended on each class derived class in assembly.
// Here's where the app systems get to learn about each other // Here's where the app systems get to learn about each other
virtual bool Connect(const CreateInterfaceFn factory) = 0; virtual bool Connect(const CreateInterfaceFn factory) { return true; };
virtual void Disconnect() = 0; virtual void Disconnect() {};
// Here's where systems can access other interfaces implemented by this object // Here's where systems can access other interfaces implemented by this object
// Returns NULL if it doesn't implement the requested interface // Returns NULL if it doesn't implement the requested interface
virtual void* QueryInterface(const char* const pInterfaceName) = 0; virtual void* QueryInterface(const char* const pInterfaceName) { return NULL; };
// Init, shutdown // Init, shutdown
virtual InitReturnVal_t Init() = 0; virtual InitReturnVal_t Init() { return INIT_OK; };
virtual void Shutdown() = 0; virtual void Shutdown() {};
// Returns all dependent libraries // Returns all dependent libraries
//virtual const AppSystemInfo_t* GetDependencies() { return NULL; } virtual const AppSystemInfo_t* GetDependencies() { return NULL; }
// Returns the tier
virtual AppSystemTier_t GetTier() = 0;
// Reconnect to a particular interface // Reconnect to a particular interface
virtual void Reconnect(const CreateInterfaceFn factory, const char* const pInterfaceName) = 0; virtual void Reconnect(const CreateInterfaceFn factory, const char* const pInterfaceName) {};
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -13,14 +13,15 @@
template< class IInterface, int ConVarFlag = 0 > template< class IInterface, int ConVarFlag = 0 >
class CTier1AppSystem : public CTier0AppSystem< IInterface > class CTier1AppSystem : public CTier0AppSystem< IInterface >
{ {
typedef CTier0AppSystem< IInterface > BaseClass;
public: public:
virtual bool Connect( const CreateInterfaceFn factory ) = 0; virtual bool Connect( const CreateInterfaceFn factory ) { return true; };
virtual void Disconnect( ) = 0; virtual void Disconnect() {};
virtual void* QueryInterface( const char* const pInterfaceName ) = 0; virtual void* QueryInterface(const char* const pInterfaceName) { return NULL; };
virtual InitReturnVal_t Init( ) = 0; virtual InitReturnVal_t Init() { return INIT_OK; };
virtual void Shutdown( ) = 0; virtual void Shutdown() {};
virtual AppSystemTier_t GetTier( ) = 0; virtual const AppSystemInfo_t* GetDependencies() { return NULL; }
virtual void Reconnect( const CreateInterfaceFn factory, const char* const pInterfaceName ) = 0;
}; };
#endif // TIER1_H #endif // TIER1_H