1 /*
2 ===========================================================================
3 Copyright (C) 2000 - 2013, Raven Software, Inc.
4 Copyright (C) 2001 - 2013, Activision, Inc.
5 Copyright (C) 2013 - 2015, OpenJK contributors
6 
7 This file is part of the OpenJK source code.
8 
9 OpenJK is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License version 2 as
11 published by the Free Software Foundation.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, see <http://www.gnu.org/licenses/>.
20 ===========================================================================
21 */
22 
23 ////////////////////////////////////////////////////////////////////////////////////////
24 // RAVEN STANDARD TEMPLATE LIBRARY
25 //  (c) 2002 Activision
26 //
27 //
28 // Array
29 // -----
30 // This array class is little more than an assert loaded wrapper around a standard
31 // array.
32 //
33 //
34 //
35 // NOTES:
36 //
37 //
38 //
39 ////////////////////////////////////////////////////////////////////////////////////////
40 #if !defined(RATL_ARRAY_VS)
41 #define RATL_ARRAY_VS
42 
43 
44 ////////////////////////////////////////////////////////////////////////////////////////
45 // Includes
46 ////////////////////////////////////////////////////////////////////////////////////////
47 #if !defined(RATL_COMMON_INC)
48 	#include "ratl_common.h"
49 #endif
50 
51 namespace ratl
52 {
53 
54 template<class T, int ARG_CAPACITY>
55 class array_vs : public array_base<storage::value_semantics<T,ARG_CAPACITY> >
56 {
57 public:
58 	typedef typename storage::value_semantics<T,ARG_CAPACITY> TStorageTraits;
59 	typedef typename TStorageTraits::TValue TTValue;
60 	static const int CAPACITY		= ARG_CAPACITY;
array_vs()61 	array_vs() {}
62 };
63 
64 template<class T, int ARG_CAPACITY>
65 class array_os : public array_base<storage::object_semantics<T,ARG_CAPACITY> >
66 {
67 public:
68 	typedef typename storage::object_semantics<T,ARG_CAPACITY> TStorageTraits;
69 	typedef typename TStorageTraits::TValue TTValue;
70 	static const int CAPACITY		= ARG_CAPACITY;
array_os()71 	array_os() {}
72 };
73 
74 template<class T, int ARG_CAPACITY, int ARG_MAX_CLASS_SIZE>
75 class array_is : public array_base<storage::virtual_semantics<T,ARG_CAPACITY,ARG_MAX_CLASS_SIZE> >
76 {
77 public:
78 	typedef typename storage::virtual_semantics<T,ARG_CAPACITY,ARG_MAX_CLASS_SIZE> TStorageTraits;
79 	typedef typename TStorageTraits::TValue TTValue;
80 	static const int CAPACITY		= ARG_CAPACITY;
81 	static const int MAX_CLASS_SIZE	= ARG_MAX_CLASS_SIZE;
array_is()82 	array_is() {}
83 };
84 
85 }
86 #endif
87