diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/public/tier2/tier2dm.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/public/tier2/tier2dm.h')
| -rw-r--r-- | mp/src/public/tier2/tier2dm.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/mp/src/public/tier2/tier2dm.h b/mp/src/public/tier2/tier2dm.h new file mode 100644 index 00000000..6c3ccf39 --- /dev/null +++ b/mp/src/public/tier2/tier2dm.h @@ -0,0 +1,76 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: A higher level link library for general use in the game and tools.
+//
+//===========================================================================//
+
+
+#ifndef TIER2DM_H
+#define TIER2DM_H
+
+#if defined( _WIN32 )
+#pragma once
+#endif
+
+#include "tier2/tier2.h"
+
+//-----------------------------------------------------------------------------
+// Set up methods related to datamodel interfaces
+//-----------------------------------------------------------------------------
+bool ConnectDataModel( CreateInterfaceFn factory );
+InitReturnVal_t InitDataModel();
+void ShutdownDataModel();
+void DisconnectDataModel();
+
+//-----------------------------------------------------------------------------
+// Helper empty implementation of an IAppSystem for tier2 libraries
+//-----------------------------------------------------------------------------
+template< class IInterface, int ConVarFlag = 0 >
+class CTier2DmAppSystem : public CTier2AppSystem< IInterface, ConVarFlag >
+{
+ typedef CTier2AppSystem< IInterface, ConVarFlag > BaseClass;
+
+public:
+ CTier2DmAppSystem( bool bIsPrimaryAppSystem = true ) : BaseClass( bIsPrimaryAppSystem )
+ {
+ }
+
+ virtual bool Connect( CreateInterfaceFn factory )
+ {
+ if ( !BaseClass::Connect( factory ) )
+ return false;
+
+ ConnectDataModel( factory );
+
+ return true;
+ }
+
+ virtual InitReturnVal_t Init()
+ {
+ InitReturnVal_t nRetVal = BaseClass::Init();
+ if ( nRetVal != INIT_OK )
+ return nRetVal;
+
+ nRetVal = InitDataModel();
+ if ( nRetVal != INIT_OK )
+ return nRetVal;
+
+ return INIT_OK;
+ }
+
+ virtual void Shutdown()
+ {
+ ShutdownDataModel();
+ BaseClass::Shutdown();
+ }
+
+ virtual void Disconnect()
+ {
+ DisconnectDataModel();
+ BaseClass::Disconnect();
+ }
+};
+
+
+#endif // TIER2DM_H
+
|