forked from SamuraiSigma/speech-to-text
-
Notifications
You must be signed in to change notification settings - Fork 2
/
stt_queue.h
57 lines (41 loc) · 932 Bytes
/
stt_queue.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef STT_QUEUE_H
#define STT_QUEUE_H
#include "core/reference.h"
#include "core/vector.h"
class STTQueue : public Reference {
GDCLASS(STTQueue, Reference);
private:
// Queue for storing recognized keywords; operations are thread-safe
Vector<String> keywords;
int capacity;
protected:
static void _bind_methods();
public:
enum {
DEFAULT_KWS_CAPACITY = 100
};
String next();
/*
* Adds the specified keyword to the end of the queue, returning true if
* successful (i.e., didn't exceed the queue capacity).
*
* @kw keyword to be added to the queue.
*
* @return true if the word was added to the queue, or false otherwise.
*/
bool add(String kw);
int size();
bool empty();
void clear();
void set_capacity(const int &capacity);
int get_capacity();
/*
* Initializes queue capacity.
*/
STTQueue();
/*
* Doesn't actually do anything. :P
*/
~STTQueue();
};
#endif // STT_QUEUE_H