Edinburgh Speech Tools  2.4-release
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Pages
EST_features_aux.h
1  /************************************************************************/
2  /* */
3  /* Centre for Speech Technology Research */
4  /* University of Edinburgh, UK */
5  /* Copyright (c) 1996,1997 */
6  /* All Rights Reserved. */
7  /* */
8  /* Permission is hereby granted, free of charge, to use and distribute */
9  /* this software and its documentation without restriction, including */
10  /* without limitation the rights to use, copy, modify, merge, publish, */
11  /* distribute, sublicense, and/or sell copies of this work, and to */
12  /* permit persons to whom this work is furnished to do so, subject to */
13  /* the following conditions: */
14  /* 1. The code must retain the above copyright notice, this list of */
15  /* conditions and the following disclaimer. */
16  /* 2. Any modifications must be clearly marked as such. */
17  /* 3. Original authors' names are not deleted. */
18  /* 4. The authors' names are not used to endorse or promote products */
19  /* derived from this software without specific prior written */
20  /* permission. */
21  /* */
22  /* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */
23  /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
24  /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
25  /* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */
26  /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
27  /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
28  /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
29  /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
30  /* THIS SOFTWARE. */
31  /* */
32  /*************************************************************************/
33 
34 
35 #ifndef __EST_FEATURES_AUX_H__
36 #define __EST_FEATURES_AUX_H__
37 
38 /** Non core feature functionality.
39  *
40  * @author Richard Caley <rjc@cstr.ed.ac.uk>
41  * @version $Id: EST_features_aux.h,v 1.3 2004/05/04 00:00:17 awb Exp $
42  */
43 
44 //@{
45 
46 #include "EST_Features.h"
47 
48 class EST_String;
49 class EST_Val;
50 
51 /** Safe feature access functions.
52  *
53  * These functions are guaranteed to return a value even if
54  * there is an otherwise fatal error.
55  */
56 //@{
57 
58 /** What happened when we tried to look up a value.
59  */
60 enum EST_feat_status
61 {
62  /// All OK, value returned.
63  efs_ok=0,
64 
65  /// No value for feature, default returned
66  efs_not_set=1,
67 
68  /// An error occurred and was caught.
69  efs_error=2
70 };
71 
72 
73 /// Return the value as an EST_Val.
74 EST_Val getVal(const EST_Features &f,
75  const EST_String name,
76  const EST_Val &def,
77  EST_feat_status &status);
78 
79 /// Return the value as a string.
80 EST_String getString(const EST_Features &f,
81  const EST_String name,
82  const EST_String &def,
83  EST_feat_status &status);
84 
85 /// Return the values as a float.
86 float getFloat(const EST_Features &f,
87  const EST_String name,
88  float def,
89  EST_feat_status &status);
90 
91 /// Return the values as a float.
92 int getInteger(const EST_Features &f,
93  const EST_String name,
94  int def,
95  EST_feat_status &status);
96 //@}
97 
98 
99 VAL_REGISTER_FUNCPTR_DCLS(pointer, void *)
100 
101  //@}
102 
103 #endif
104