Counter Strike : Global Offensive Source Code
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.

58 lines
1.5 KiB

  1. //===== Copyright � 2005-2005, 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 TIER3_H
  7. #define TIER3_H
  8. #if defined( _WIN32 )
  9. #pragma once
  10. #endif
  11. #include "tier2/tier2.h"
  12. //-----------------------------------------------------------------------------
  13. // Call this to connect to/disconnect from all tier 3 libraries.
  14. // It's up to the caller to check the globals it cares about to see if ones are missing
  15. //-----------------------------------------------------------------------------
  16. void ConnectTier3Libraries( CreateInterfaceFn *pFactoryList, int nFactoryCount );
  17. void DisconnectTier3Libraries();
  18. //-----------------------------------------------------------------------------
  19. // Helper empty implementation of an IAppSystem for tier3 libraries
  20. //-----------------------------------------------------------------------------
  21. template< class IInterface, int ConVarFlag = 0 >
  22. class CTier3AppSystem : public CTier2AppSystem< IInterface, ConVarFlag >
  23. {
  24. typedef CTier2AppSystem< IInterface, ConVarFlag > BaseClass;
  25. public:
  26. virtual bool Connect( CreateInterfaceFn factory )
  27. {
  28. if ( !BaseClass::Connect( factory ) )
  29. return false;
  30. ConnectTier3Libraries( &factory, 1 );
  31. return true;
  32. }
  33. virtual void Disconnect()
  34. {
  35. DisconnectTier3Libraries();
  36. BaseClass::Disconnect();
  37. }
  38. virtual AppSystemTier_t GetTier()
  39. {
  40. return APP_SYSTEM_TIER3;
  41. }
  42. };
  43. #endif // TIER3_H