aboutsummaryrefslogtreecommitdiff
path: root/sp/src/game/shared/saverestore_utlclass.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /sp/src/game/shared/saverestore_utlclass.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/game/shared/saverestore_utlclass.h')
-rw-r--r--sp/src/game/shared/saverestore_utlclass.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/sp/src/game/shared/saverestore_utlclass.h b/sp/src/game/shared/saverestore_utlclass.h
new file mode 100644
index 00000000..588a86d1
--- /dev/null
+++ b/sp/src/game/shared/saverestore_utlclass.h
@@ -0,0 +1,66 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#ifndef SAVERESTORE_UTLCLASS_H
+#define SAVERESTORE_UTLCLASS_H
+
+#if defined( _WIN32 )
+#pragma once
+#endif
+
+//-------------------------------------
+
+template <int FIELD_TYPE>
+class CTypedescDeducer
+{
+public:
+ template <class UTLCLASS>
+ static datamap_t *Deduce( UTLCLASS *p )
+ {
+ return NULL;
+ }
+
+};
+
+template<>
+class CTypedescDeducer<FIELD_EMBEDDED>
+{
+public:
+ template <class UTLCLASS>
+ static datamap_t *Deduce( UTLCLASS *p )
+ {
+ return &UTLCLASS::ElemType_t::m_DataMap;
+ }
+
+};
+
+#define UTLCLASS_SAVERESTORE_VALIDATE_TYPE( type ) \
+ COMPILE_TIME_ASSERT( \
+ type == FIELD_FLOAT ||\
+ type == FIELD_STRING ||\
+ type == FIELD_CLASSPTR ||\
+ type == FIELD_EHANDLE ||\
+ type == FIELD_EDICT ||\
+ type == FIELD_VECTOR ||\
+ type == FIELD_QUATERNION ||\
+ type == FIELD_POSITION_VECTOR ||\
+ type == FIELD_INTEGER ||\
+ type == FIELD_BOOLEAN ||\
+ type == FIELD_SHORT ||\
+ type == FIELD_CHARACTER ||\
+ type == FIELD_TIME ||\
+ type == FIELD_TICK ||\
+ type == FIELD_MODELNAME ||\
+ type == FIELD_SOUNDNAME ||\
+ type == FIELD_COLOR32 ||\
+ type == FIELD_EMBEDDED ||\
+ type == FIELD_MODELINDEX ||\
+ type == FIELD_MATERIALINDEX\
+ )
+
+//-------------------------------------
+
+#endif // SAVERESTORE_UTLCLASS_H