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.

52 lines
1.6 KiB

  1. /// Defines an interface which may be called from the MANAGED code's
  2. /// main function to start up (connect) and shut down (disconnect)
  3. /// the app system interface.
  4. /// This class is a singleton. It gets manufactured explicitly
  5. /// from the Manufacture() call, which is a factory function that
  6. /// your app must implement in a non-/CLR file it will presumably
  7. /// return your custom type of CCLI_AppSystem_Adapter_Unmanaged).
  8. /// Calling Startup() will connect the app system and
  9. /// Shutdown() will disconnect it.
  10. ///
  11. /// This shim is necessary to hide the CAppSystemGroup header from the
  12. /// CLI compiler, because it'll freak out if it has to include it.
  13. ///
  14. ///
  15. /// Placed here so that can be instanced from the app's main loop
  16. /// after the dll loads; this workaround obviates having to write a
  17. /// DLLMain() which might cause a loader-lock.
  18. /// see: http://msdn.microsoft.com/en-us/library/ms173266(vs.80).aspx
  19. #ifndef CLI_APPSYSTEM_THUNK_H
  20. #define CLI_APPSYSTEM_THUNK_H
  21. #pragma once
  22. class AppSystemWrapper_Unmanaged;
  23. namespace ManagedAppSystem
  24. {
  25. public ref class AppSystemWrapper
  26. {
  27. public:
  28. // Allocate the native object on the C++ Heap via a constructor
  29. AppSystemWrapper() ; // : m_Impl( new UnmanagedClass ) {}
  30. // Deallocate the native object on a destructor
  31. ~AppSystemWrapper();
  32. /// Set the "LOCAL" search path for the file system.
  33. void SetFileSystemSearchRoot( String ^path );
  34. protected:
  35. // Deallocate the native object on the finalizer just in case no destructor is called
  36. !AppSystemWrapper();
  37. private:
  38. AppSystemWrapper_Unmanaged * m_Impl;
  39. };
  40. }
  41. #endif