array_vs.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. ////////////////////////////////////////////////////////////////////////////////////////
  2. // RAVEN STANDARD TEMPLATE LIBRARY
  3. // (c) 2002 Activision
  4. //
  5. //
  6. // Array
  7. // -----
  8. // This array class is little more than an assert loaded wrapper around a standard
  9. // array.
  10. //
  11. //
  12. //
  13. // NOTES:
  14. //
  15. //
  16. //
  17. ////////////////////////////////////////////////////////////////////////////////////////
  18. #if !defined(RATL_ARRAY_VS)
  19. #define RATL_ARRAY_VS
  20. ////////////////////////////////////////////////////////////////////////////////////////
  21. // Includes
  22. ////////////////////////////////////////////////////////////////////////////////////////
  23. #if !defined(RATL_COMMON_INC)
  24. #include "ratl_common.h"
  25. #endif
  26. namespace ratl
  27. {
  28. template<class T, int ARG_CAPACITY>
  29. class array_vs : public array_base<storage::value_semantics<T,ARG_CAPACITY> >
  30. {
  31. public:
  32. typedef typename storage::value_semantics<T,ARG_CAPACITY> TStorageTraits;
  33. typedef typename TStorageTraits::TValue TTValue;
  34. enum
  35. {
  36. CAPACITY = ARG_CAPACITY
  37. };
  38. array_vs() {}
  39. };
  40. template<class T, int ARG_CAPACITY>
  41. class array_os : public array_base<storage::object_semantics<T,ARG_CAPACITY> >
  42. {
  43. public:
  44. typedef typename storage::object_semantics<T,ARG_CAPACITY> TStorageTraits;
  45. typedef typename TStorageTraits::TValue TTValue;
  46. enum
  47. {
  48. CAPACITY = ARG_CAPACITY
  49. };
  50. array_os() {}
  51. };
  52. template<class T, int ARG_CAPACITY, int ARG_MAX_CLASS_SIZE>
  53. class array_is : public array_base<storage::virtual_semantics<T,ARG_CAPACITY,ARG_MAX_CLASS_SIZE> >
  54. {
  55. public:
  56. typedef typename storage::virtual_semantics<T,ARG_CAPACITY,ARG_MAX_CLASS_SIZE> TStorageTraits;
  57. typedef typename TStorageTraits::TValue TTValue;
  58. enum
  59. {
  60. CAPACITY = ARG_CAPACITY,
  61. MAX_CLASS_SIZE = ARG_MAX_CLASS_SIZE
  62. };
  63. array_is() {}
  64. };
  65. }
  66. #endif