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.

65 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. #include <tier3/tier3.h>
  7. #include "datamodel/idatamodel.h"
  8. #include "dmserializers/idmserializers.h"
  9. // NOTE: This has to be the last file included!
  10. #include "tier0/memdbgon.h"
  11. //-----------------------------------------------------------------------------
  12. // Set up methods related to datamodel interfaces
  13. //-----------------------------------------------------------------------------
  14. bool ConnectDataModel( CreateInterfaceFn factory )
  15. {
  16. if ( !g_pDataModel->Connect( factory ) )
  17. return false;
  18. if ( !g_pDmElementFramework->Connect( factory ) )
  19. return false;
  20. if ( !g_pDmSerializers->Connect( factory ) )
  21. return false;
  22. return true;
  23. }
  24. InitReturnVal_t InitDataModel()
  25. {
  26. InitReturnVal_t nRetVal;
  27. nRetVal = g_pDataModel->Init( );
  28. if ( nRetVal != INIT_OK )
  29. return nRetVal;
  30. nRetVal = g_pDmElementFramework->Init();
  31. if ( nRetVal != INIT_OK )
  32. return nRetVal;
  33. nRetVal = g_pDmSerializers->Init();
  34. if ( nRetVal != INIT_OK )
  35. return nRetVal;
  36. return INIT_OK;
  37. }
  38. void ShutdownDataModel()
  39. {
  40. g_pDmSerializers->Shutdown();
  41. g_pDmElementFramework->Shutdown();
  42. g_pDataModel->Shutdown( );
  43. }
  44. void DisconnectDataModel()
  45. {
  46. g_pDmSerializers->Disconnect();
  47. g_pDmElementFramework->Disconnect();
  48. g_pDataModel->Disconnect();
  49. }