Edinburgh Speech Tools  2.1-release
EST_features_aux.h
Go to the documentation of this file.
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  */
61 {
62  /// All OK, value returned.
63  efs_ok=0,
64 
65  /// No value for feature, default returned
67 
68  /// An error occurred and was caught.
70 };
71 
72 
73 /// Return the value as an EST_Val.
75  const EST_String name,
76  const EST_Val &def,
77  EST_feat_status &status);
78 
79 /// Return the value as a string.
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 
An error occurred and was caught.
float getFloat(const EST_Features &f, const EST_String name, float def, EST_feat_status &status)
Return the values as a float.
EST_String getString(const EST_Features &f, const EST_String name, const EST_String &def, EST_feat_status &status)
Return the value as a string.
int getInteger(const EST_Features &f, const EST_String name, int def, EST_feat_status &status)
Return the values as a float.
No value for feature, default returned.
All OK, value returned.
f
Definition: EST_item_aux.cc:48
#define VAL_REGISTER_FUNCPTR_DCLS(NAME, TYPE)
Definition: EST_Val_defs.h:55
EST_Val getVal(const EST_Features &f, const EST_String name, const EST_Val &def, EST_feat_status &status)
Return the value as an EST_Val.
EST_feat_status