Edinburgh Speech Tools  2.1-release
EST_TListI.h
Go to the documentation of this file.
1 
2  /************************************************************************/
3  /* */
4  /* Centre for Speech Technology Research */
5  /* University of Edinburgh, UK */
6  /* Copyright (c) 1996,1997 */
7  /* All Rights Reserved. */
8  /* */
9  /* Permission is hereby granted, free of charge, to use and distribute */
10  /* this software and its documentation without restriction, including */
11  /* without limitation the rights to use, copy, modify, merge, publish, */
12  /* distribute, sublicense, and/or sell copies of this work, and to */
13  /* permit persons to whom this work is furnished to do so, subject to */
14  /* the following conditions: */
15  /* 1. The code must retain the above copyright notice, this list of */
16  /* conditions and the following disclaimer. */
17  /* 2. Any modifications must be clearly marked as such. */
18  /* 3. Original authors' names are not deleted. */
19  /* 4. The authors' names are not used to endorse or promote products */
20  /* derived from this software without specific prior written */
21  /* permission. */
22  /* */
23  /* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */
24  /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
25  /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
26  /* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */
27  /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
28  /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
29  /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
30  /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
31  /* THIS SOFTWARE. */
32  /* */
33  /*************************************************************************/
34 
35 
36 #ifndef __EST_TLIST_I_H__
37 #define __EST_TLIST_I_H__
38 
39 /** Instantiate rules for list template.
40  *
41  * @author Richard Caley <rjc@cstr.ed.ac.uk>
42  * @version $Id: EST_TListI.h,v 1.5 2006/07/19 21:52:12 awb Exp $
43  */
44 
45 
46 // Instantiation Macros
47 
48 #include <iostream>
49 
51 
52 #define Instantiate_TList_T_MIN(TYPE, TAG) \
53  template class EST_TList< TLIST_ ## TAG ## _VAL >; \
54  template class EST_TItem< TLIST_ ## TAG ## _VAL >; \
55  template const char *error_name(EST_TList< TYPE > val); \
56  Instantiate_TIterator_T( EST_TList<TYPE>, EST_TList<TYPE>::IPointer, TYPE, TList_ ## TAG ## _itt)
57 
58 #define Instantiate_TList_T(TYPE, TAG) \
59  Instantiate_TList_T_MIN(TYPE, TAG)
60 
61 #define Instantiate_TList(TYPE) Instantiate_TList_T(TYPE, TYPE)
62 
63 #define Declare_TList_TN(TYPE,MaxFree,TAG) \
64  typedef TYPE TLIST_ ## TAG ## _VAL; \
65  template <> EST_TItem< TYPE > * EST_TItem< TYPE >::s_free=NULL; \
66  template <> unsigned int EST_TItem< TYPE >::s_maxFree=MaxFree; \
67  template <> unsigned int EST_TItem< TYPE >::s_nfree=0;
68 #define Declare_TList_T(TYPE,TAG) \
69  Declare_TList_TN(TYPE,0,TAG)
70 
71 #define Declare_TList_Base_TN(TYPE,MaxFree,TAG) \
72  Declare_TList_TN(TYPE,MaxFree,TAG)
73 #define Declare_TList_Base_T(TYPE,TAG) \
74  Declare_TList_Base_TN(TYPE,0,TAG) \
75 
76 #define Declare_TList_Class_TN(TYPE,MaxFree,TAG) \
77  Declare_TList_TN(TYPE,MaxFree,TAG)
78 #define Declare_TList_Class_T(TYPE,TAG) \
79  Declare_TList_Class_TN(TYPE,0,TAG) \
80 
81 #define Declare_TList_N(TYPE,MaxFree) Declare_TList_TN(TYPE,MaxFree,TYPE)
82 #define Declare_TList_Base_N(TYPE,MaxFree) Declare_TList_Base_TN(TYPE,MaxFree,TYPE)
83 #define Declare_TList_Class_N(TYPE,MaxFree) Declare_TList_Class_TN(TYPE,MaxFree,TYPE)
84 
85 #define Declare_TList(TYPE) Declare_TList_N(TYPE,0)
86 #define Declare_TList_Base(TYPE) Declare_TList_Base_N(TYPE,0)
87 #define Declare_TList_Class(TYPE) Declare_TList_Class_N(TYPE,0)
88 
89 #endif
90