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 50 using namespace std; 51 52 #include "instantiate/EST_TIteratorI.h" 53 54 #define Instantiate_TList_T_MIN(TYPE, TAG) \ 55 template class EST_TList< TLIST_ ## TAG ## _VAL >; \ 56 template class EST_TItem< TLIST_ ## TAG ## _VAL >; \ 57 template const char *error_name(EST_TList< TYPE > val); \ 58 Instantiate_TIterator_T( EST_TList<TYPE>, EST_TList<TYPE>::IPointer, TYPE, TList_ ## TAG ## _itt); 59 60 #define Instantiate_TList_T(TYPE, TAG) \ 61 Instantiate_TList_T_MIN(TYPE, TAG) 62 63 #define Instantiate_TList(TYPE) Instantiate_TList_T(TYPE, TYPE) 64 65 #define Declare_TList_TN(TYPE,MaxFree,TAG) \ 66 typedef TYPE TLIST_ ## TAG ## _VAL; \ 67 template <> EST_TItem< TYPE > * EST_TItem< TYPE >::s_free=NULL; \ 68 template <> unsigned int EST_TItem< TYPE >::s_maxFree=MaxFree; \ 69 template <> unsigned int EST_TItem< TYPE >::s_nfree=0; 70 #define Declare_TList_T(TYPE,TAG) \ 71 Declare_TList_TN(TYPE,0,TAG) 72 73 #define Declare_TList_Base_TN(TYPE,MaxFree,TAG) \ 74 Declare_TList_TN(TYPE,MaxFree,TAG) 75 #define Declare_TList_Base_T(TYPE,TAG) \ 76 Declare_TList_Base_TN(TYPE,0,TAG) \ 77 78 #define Declare_TList_Class_TN(TYPE,MaxFree,TAG) \ 79 Declare_TList_TN(TYPE,MaxFree,TAG) 80 #define Declare_TList_Class_T(TYPE,TAG) \ 81 Declare_TList_Class_TN(TYPE,0,TAG) \ 82 83 #define Declare_TList_N(TYPE,MaxFree) Declare_TList_TN(TYPE,MaxFree,TYPE) 84 #define Declare_TList_Base_N(TYPE,MaxFree) Declare_TList_Base_TN(TYPE,MaxFree,TYPE) 85 #define Declare_TList_Class_N(TYPE,MaxFree) Declare_TList_Class_TN(TYPE,MaxFree,TYPE) 86 87 #define Declare_TList(TYPE) Declare_TList_N(TYPE,0) 88 #define Declare_TList_Base(TYPE) Declare_TList_Base_N(TYPE,0) 89 #define Declare_TList_Class(TYPE) Declare_TList_Class_N(TYPE,0) 90 91 #endif 92 93