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.

37 lines
1.1 KiB

  1. /// The unmanaged side of wrapping the app system for CLR
  2. #ifndef CLI_APPSYSTEM_UNMANAGED_WRAPPER_H
  3. #define CLI_APPSYSTEM_UNMANAGED_WRAPPER_H
  4. class CCLIAppSystemAdapter;
  5. /// This is actually a manually implemented refcounter on
  6. /// a singleton instance, so that construction causes it to
  7. /// be initialized if necessary and destruction refcounts
  8. /// before NULLing the static global.
  9. class AppSystemWrapper_Unmanaged
  10. {
  11. public:
  12. AppSystemWrapper_Unmanaged( const char *pCommandLine );
  13. virtual ~AppSystemWrapper_Unmanaged();
  14. inline int CountRefs( void ) const { return sm_nSingletonReferences; };
  15. inline CCLIAppSystemAdapter *operator *() const { return sm_pAppSystemSingleton; }
  16. inline operator CCLIAppSystemAdapter *() const { return sm_pAppSystemSingleton; }
  17. inline static CCLIAppSystemAdapter *Get() { return sm_pAppSystemSingleton; }
  18. protected:
  19. void InitializeAppSystem( CCLIAppSystemAdapter * pAppSys, const char *pCommandLine ) ;
  20. void TerminateAppSystem( CCLIAppSystemAdapter * pAppSys ) ;
  21. private:
  22. static CCLIAppSystemAdapter *sm_pAppSystemSingleton;
  23. static int sm_nSingletonReferences;
  24. };
  25. #endif