Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: A higher level link library for general use in the game and tools.
  4. //
  5. //===========================================================================//
  6. #ifndef TIER3DM_H
  7. #define TIER3DM_H
  8. #if defined( _WIN32 )
  9. #pragma once
  10. #endif
  11. #include "tier3/tier3.h"
  12. #include "tier2/tier2dm.h"
  13. //-----------------------------------------------------------------------------
  14. // Helper empty implementation of an IAppSystem for tier2 libraries
  15. //-----------------------------------------------------------------------------
  16. template< class IInterface, int ConVarFlag = 0 >
  17. class CTier3DmAppSystem : public CTier2DmAppSystem< IInterface, ConVarFlag >
  18. {
  19. typedef CTier2DmAppSystem< IInterface, ConVarFlag > BaseClass;
  20. public:
  21. CTier3DmAppSystem( bool bIsPrimaryAppSystem = true ) : BaseClass( bIsPrimaryAppSystem )
  22. {
  23. }
  24. virtual bool Connect( CreateInterfaceFn factory )
  25. {
  26. if ( !BaseClass::Connect( factory ) )
  27. return false;
  28. if ( IsPrimaryAppSystem() )
  29. {
  30. ConnectTier3Libraries( &factory, 1 );
  31. }
  32. return true;
  33. }
  34. virtual void Disconnect()
  35. {
  36. if ( IsPrimaryAppSystem() )
  37. {
  38. DisconnectTier3Libraries();
  39. }
  40. BaseClass::Disconnect();
  41. }
  42. };
  43. #endif // TIER3DM_H