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.

106 lines
2.5 KiB

  1. //========= Copyright � 1996-2008, Valve Corporation, All rights reserved. ====
  2. //
  3. //=============================================================================
  4. #ifndef INPUTOUTPUT_H
  5. #define INPUTOUTPUT_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. #include <utlvector.h>
  10. #include "entitydefs.h"
  11. enum InputOutputType_t
  12. {
  13. iotInvalid = -1,
  14. iotVoid,
  15. iotInt,
  16. iotBool,
  17. iotString,
  18. iotFloat,
  19. iotVector,
  20. iotEHandle,
  21. iotColor,
  22. iotScript,
  23. };
  24. //-----------------------------------------------------------------------------
  25. // Purpose:
  26. //-----------------------------------------------------------------------------
  27. class CClassInputOutputBase
  28. {
  29. public:
  30. CClassInputOutputBase(void);
  31. CClassInputOutputBase(const char *pszName, InputOutputType_t eType);
  32. virtual ~CClassInputOutputBase(void);
  33. inline const char *GetName(void) { return(m_szName); }
  34. InputOutputType_t GetType(void) { return(m_eType); }
  35. const char *GetTypeText(void);
  36. inline const char *GetDescription(void);
  37. inline void SetName(const char *szName) { strcpy(m_szName, szName); }
  38. inline void SetType(InputOutputType_t eType) { m_eType = eType; }
  39. InputOutputType_t SetType(const char *szType);
  40. inline void SetDescription(char *pszDescription) { m_pszDescription = pszDescription; }
  41. CClassInputOutputBase &operator =(CClassInputOutputBase &);
  42. protected:
  43. static char *g_pszEmpty;
  44. char m_szName[MAX_IO_NAME_LEN];
  45. InputOutputType_t m_eType;
  46. char *m_pszDescription;
  47. };
  48. //-----------------------------------------------------------------------------
  49. // Purpose: Returns this I/O's long description.
  50. //-----------------------------------------------------------------------------
  51. const char *CClassInputOutputBase::GetDescription(void)
  52. {
  53. if (m_pszDescription != NULL)
  54. {
  55. return(m_pszDescription);
  56. }
  57. return(g_pszEmpty);
  58. }
  59. //-----------------------------------------------------------------------------
  60. // Purpose:
  61. //-----------------------------------------------------------------------------
  62. class CClassInput : public CClassInputOutputBase
  63. {
  64. public:
  65. CClassInput(void);
  66. CClassInput(const char *pszName, InputOutputType_t eType);
  67. };
  68. //-----------------------------------------------------------------------------
  69. // Purpose:
  70. //-----------------------------------------------------------------------------
  71. class CClassOutput : public CClassInputOutputBase
  72. {
  73. public:
  74. CClassOutput(void);
  75. CClassOutput(const char *pszName, InputOutputType_t eType);
  76. };
  77. typedef CUtlVector<CClassInput *> CClassInputList;
  78. typedef CUtlVector<CClassOutput *> CClassOutputList;
  79. #endif // INPUTOUTPUT_H