next up previous contents
Next: NATURAL LANGUAGE PROCESSING Up: SPEECH INTERFACE Previous: SPEECH INTERFACE   Contents

Issues

The major difference between the specification of this module and its implementation is that all member functions and internal data of the class were required to be declared static, class-wide variables rather than an instance per object.

The reason for this change is that although the way in which C and C++ internally represent function pointers for plain functions is essentially the same, C++ represents a pointer to a member function radically differently.

ViaVoice and its SDK are implemented in C and expect callbacks to be registered using the C style of function pointers. However, the specification called for member functions of a C++ class to be registered as handlers for the speech engine's signals.

In order to satisfy both ViaVoice and the design specification, the class member functions (and necessarily any data members they access) were declared as static. This reverted the function pointer representation to the C style, allowing ViaVoice to accept the desired member functions as valid handlers and for the specification to be met.



Andrew P Coates (UG) 2002-07-17