Fawkes API Fawkes Development Version
FacerInterface.cpp
1
2/***************************************************************************
3 * FacerInterface.cpp - Fawkes BlackBoard Interface - FacerInterface
4 *
5 * Templated created: Thu Oct 12 10:49:19 2006
6 * Copyright 2008 Tim Niemueller
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24#include <interfaces/FacerInterface.h>
25
26#include <core/exceptions/software.h>
27
28#include <map>
29#include <string>
30#include <cstring>
31#include <cstdlib>
32
33namespace fawkes {
34
35/** @class FacerInterface <interfaces/FacerInterface.h>
36 * FacerInterface Fawkes BlackBoard Interface.
37 *
38 The interface provides access to the face recognition plugin
39 (facer). It provides basic status information about facer and
40 allows for setting a specific mode and access the resolut.
41 calling skills via messages. It can also be used to manually
42 restart the Lua interpreter if something is wedged.
43
44 * @ingroup FawkesInterfaces
45 */
46
47
48
49/** Constructor */
50FacerInterface::FacerInterface() : Interface()
51{
52 data_size = sizeof(FacerInterface_data_t);
53 data_ptr = malloc(data_size);
54 data = (FacerInterface_data_t *)data_ptr;
55 data_ts = (interface_data_ts_t *)data_ptr;
56 memset(data_ptr, 0, data_size);
57 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
58 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
59 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
60 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
61 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
62 add_fieldinfo(IFT_ENUM, "opmode", 1, &data->opmode, "if_facer_opmode_t", &enum_map_if_facer_opmode_t);
63 add_fieldinfo(IFT_UINT32, "num_identities", 1, &data->num_identities);
64 add_fieldinfo(IFT_UINT32, "recognized_identity", 1, &data->recognized_identity);
65 add_fieldinfo(IFT_STRING, "recognized_name", 64, data->recognized_name);
66 add_fieldinfo(IFT_UINT32, "num_detections", 1, &data->num_detections);
67 add_fieldinfo(IFT_UINT32, "num_recognitions", 1, &data->num_recognitions);
68 add_fieldinfo(IFT_UINT32, "most_likely_identity", 1, &data->most_likely_identity);
69 add_fieldinfo(IFT_STRING, "most_likely_gender", 64, data->most_likely_gender);
70 add_fieldinfo(IFT_FLOAT, "history_ratio", 1, &data->history_ratio);
71 add_fieldinfo(IFT_FLOAT, "sec_since_detection", 1, &data->sec_since_detection);
72 add_fieldinfo(IFT_INT32, "visibility_history", 1, &data->visibility_history);
73 add_fieldinfo(IFT_BOOL, "learning_in_progress", 1, &data->learning_in_progress);
74 add_fieldinfo(IFT_BOOL, "searching_person", 1, &data->searching_person);
75 add_fieldinfo(IFT_FLOAT, "recording_progress", 1, &data->recording_progress);
76 add_fieldinfo(IFT_FLOAT, "bearing", 1, &data->bearing);
77 add_fieldinfo(IFT_FLOAT, "slope", 1, &data->slope);
78 add_fieldinfo(IFT_UINT32, "requested_index", 1, &data->requested_index);
79 add_fieldinfo(IFT_STRING, "requested_name", 64, data->requested_name);
80 add_fieldinfo(IFT_UINT32, "index_last_learned", 1, &data->index_last_learned);
81 add_messageinfo("LearnFaceMessage");
82 add_messageinfo("SetOpmodeMessage");
83 add_messageinfo("EnableIdentityMessage");
84 add_messageinfo("SetNameMessage");
85 add_messageinfo("GetNameMessage");
86 add_messageinfo("StartSearchPersonMessage");
87 add_messageinfo("StopSearchPersonMessage");
88 unsigned char tmp_hash[] = {0x5d, 0xd, 0xac, 0xa1, 0xe1, 0x23, 0x82, 0xc4, 0x22, 0xed, 0x8b, 0xa7, 0x3e, 0x1f, 0x2d, 0x7c};
89 set_hash(tmp_hash);
90}
91
92/** Destructor */
93FacerInterface::~FacerInterface()
94{
95 free(data_ptr);
96}
97/** Convert if_facer_opmode_t constant to string.
98 * @param value value to convert to string
99 * @return constant value as string.
100 */
101const char *
102FacerInterface::tostring_if_facer_opmode_t(if_facer_opmode_t value) const
103{
104 switch (value) {
105 case OPMODE_DISABLED: return "OPMODE_DISABLED";
106 case OPMODE_DETECTION: return "OPMODE_DETECTION";
107 case OPMODE_RECOGNITION: return "OPMODE_RECOGNITION";
108 case OPMODE_LEARNING: return "OPMODE_LEARNING";
109 case OPMODE_GENDER: return "OPMODE_GENDER";
110 default: return "UNKNOWN";
111 }
112}
113/* Methods */
114/** Get opmode value.
115 *
116 Current opmode.
117
118 * @return opmode value
119 */
121FacerInterface::opmode() const
122{
123 return (FacerInterface::if_facer_opmode_t)data->opmode;
124}
125
126/** Get maximum length of opmode value.
127 * @return length of opmode value, can be length of the array or number of
128 * maximum number of characters for a string
129 */
130size_t
131FacerInterface::maxlenof_opmode() const
132{
133 return 1;
134}
135
136/** Set opmode value.
137 *
138 Current opmode.
139
140 * @param new_opmode new opmode value
141 */
142void
143FacerInterface::set_opmode(const if_facer_opmode_t new_opmode)
144{
145 set_field(data->opmode, new_opmode);
146}
147
148/** Get num_identities value.
149 *
150 The number of identities in the database.
151
152 * @return num_identities value
153 */
154uint32_t
155FacerInterface::num_identities() const
156{
157 return data->num_identities;
158}
159
160/** Get maximum length of num_identities value.
161 * @return length of num_identities value, can be length of the array or number of
162 * maximum number of characters for a string
163 */
164size_t
165FacerInterface::maxlenof_num_identities() const
166{
167 return 1;
168}
169
170/** Set num_identities value.
171 *
172 The number of identities in the database.
173
174 * @param new_num_identities new num_identities value
175 */
176void
177FacerInterface::set_num_identities(const uint32_t new_num_identities)
178{
179 set_field(data->num_identities, new_num_identities);
180}
181
182/** Get recognized_identity value.
183 *
184 The index of the recognized identity.
185
186 * @return recognized_identity value
187 */
188uint32_t
189FacerInterface::recognized_identity() const
190{
191 return data->recognized_identity;
192}
193
194/** Get maximum length of recognized_identity value.
195 * @return length of recognized_identity value, can be length of the array or number of
196 * maximum number of characters for a string
197 */
198size_t
199FacerInterface::maxlenof_recognized_identity() const
200{
201 return 1;
202}
203
204/** Set recognized_identity value.
205 *
206 The index of the recognized identity.
207
208 * @param new_recognized_identity new recognized_identity value
209 */
210void
211FacerInterface::set_recognized_identity(const uint32_t new_recognized_identity)
212{
213 set_field(data->recognized_identity, new_recognized_identity);
214}
215
216/** Get recognized_name value.
217 *
218 The name of the recognized identity.
219
220 * @return recognized_name value
221 */
222char *
223FacerInterface::recognized_name() const
224{
225 return data->recognized_name;
226}
227
228/** Get maximum length of recognized_name value.
229 * @return length of recognized_name value, can be length of the array or number of
230 * maximum number of characters for a string
231 */
232size_t
233FacerInterface::maxlenof_recognized_name() const
234{
235 return 64;
236}
237
238/** Set recognized_name value.
239 *
240 The name of the recognized identity.
241
242 * @param new_recognized_name new recognized_name value
243 */
244void
245FacerInterface::set_recognized_name(const char * new_recognized_name)
246{
247 set_field(data->recognized_name, new_recognized_name);
248}
249
250/** Get num_detections value.
251 *
252 Number of currently detected faces.
253
254 * @return num_detections value
255 */
256uint32_t
257FacerInterface::num_detections() const
258{
259 return data->num_detections;
260}
261
262/** Get maximum length of num_detections value.
263 * @return length of num_detections value, can be length of the array or number of
264 * maximum number of characters for a string
265 */
266size_t
267FacerInterface::maxlenof_num_detections() const
268{
269 return 1;
270}
271
272/** Set num_detections value.
273 *
274 Number of currently detected faces.
275
276 * @param new_num_detections new num_detections value
277 */
278void
279FacerInterface::set_num_detections(const uint32_t new_num_detections)
280{
281 set_field(data->num_detections, new_num_detections);
282}
283
284/** Get num_recognitions value.
285 *
286 Number of recognized faces.
287
288 * @return num_recognitions value
289 */
290uint32_t
291FacerInterface::num_recognitions() const
292{
293 return data->num_recognitions;
294}
295
296/** Get maximum length of num_recognitions value.
297 * @return length of num_recognitions value, can be length of the array or number of
298 * maximum number of characters for a string
299 */
300size_t
301FacerInterface::maxlenof_num_recognitions() const
302{
303 return 1;
304}
305
306/** Set num_recognitions value.
307 *
308 Number of recognized faces.
309
310 * @param new_num_recognitions new num_recognitions value
311 */
312void
313FacerInterface::set_num_recognitions(const uint32_t new_num_recognitions)
314{
315 set_field(data->num_recognitions, new_num_recognitions);
316}
317
318/** Get most_likely_identity value.
319 *
320 The identity that was recognized most prevalently.
321
322 * @return most_likely_identity value
323 */
324uint32_t
325FacerInterface::most_likely_identity() const
326{
327 return data->most_likely_identity;
328}
329
330/** Get maximum length of most_likely_identity value.
331 * @return length of most_likely_identity value, can be length of the array or number of
332 * maximum number of characters for a string
333 */
334size_t
335FacerInterface::maxlenof_most_likely_identity() const
336{
337 return 1;
338}
339
340/** Set most_likely_identity value.
341 *
342 The identity that was recognized most prevalently.
343
344 * @param new_most_likely_identity new most_likely_identity value
345 */
346void
347FacerInterface::set_most_likely_identity(const uint32_t new_most_likely_identity)
348{
349 set_field(data->most_likely_identity, new_most_likely_identity);
350}
351
352/** Get most_likely_gender value.
353 *
354 The gender that was recogniced.
355
356 * @return most_likely_gender value
357 */
358char *
359FacerInterface::most_likely_gender() const
360{
361 return data->most_likely_gender;
362}
363
364/** Get maximum length of most_likely_gender value.
365 * @return length of most_likely_gender value, can be length of the array or number of
366 * maximum number of characters for a string
367 */
368size_t
369FacerInterface::maxlenof_most_likely_gender() const
370{
371 return 64;
372}
373
374/** Set most_likely_gender value.
375 *
376 The gender that was recogniced.
377
378 * @param new_most_likely_gender new most_likely_gender value
379 */
380void
381FacerInterface::set_most_likely_gender(const char * new_most_likely_gender)
382{
383 set_field(data->most_likely_gender, new_most_likely_gender);
384}
385
386/** Get history_ratio value.
387 *
388 The ratio of the most likely identity showing up in the history
389 and the length of the history.
390
391 * @return history_ratio value
392 */
393float
394FacerInterface::history_ratio() const
395{
396 return data->history_ratio;
397}
398
399/** Get maximum length of history_ratio value.
400 * @return length of history_ratio value, can be length of the array or number of
401 * maximum number of characters for a string
402 */
403size_t
404FacerInterface::maxlenof_history_ratio() const
405{
406 return 1;
407}
408
409/** Set history_ratio value.
410 *
411 The ratio of the most likely identity showing up in the history
412 and the length of the history.
413
414 * @param new_history_ratio new history_ratio value
415 */
416void
417FacerInterface::set_history_ratio(const float new_history_ratio)
418{
419 set_field(data->history_ratio, new_history_ratio);
420}
421
422/** Get sec_since_detection value.
423 *
424 Time in seconds since the last successful detection.
425
426 * @return sec_since_detection value
427 */
428float
429FacerInterface::sec_since_detection() const
430{
431 return data->sec_since_detection;
432}
433
434/** Get maximum length of sec_since_detection value.
435 * @return length of sec_since_detection value, can be length of the array or number of
436 * maximum number of characters for a string
437 */
438size_t
439FacerInterface::maxlenof_sec_since_detection() const
440{
441 return 1;
442}
443
444/** Set sec_since_detection value.
445 *
446 Time in seconds since the last successful detection.
447
448 * @param new_sec_since_detection new sec_since_detection value
449 */
450void
451FacerInterface::set_sec_since_detection(const float new_sec_since_detection)
452{
453 set_field(data->sec_since_detection, new_sec_since_detection);
454}
455
456/** Get visibility_history value.
457 *
458 The number of consecutive sighting ( <= 1 ) and non-sightings
459 ( >= -1 ), respectively.
460
461 * @return visibility_history value
462 */
463int32_t
464FacerInterface::visibility_history() const
465{
466 return data->visibility_history;
467}
468
469/** Get maximum length of visibility_history value.
470 * @return length of visibility_history value, can be length of the array or number of
471 * maximum number of characters for a string
472 */
473size_t
474FacerInterface::maxlenof_visibility_history() const
475{
476 return 1;
477}
478
479/** Set visibility_history value.
480 *
481 The number of consecutive sighting ( <= 1 ) and non-sightings
482 ( >= -1 ), respectively.
483
484 * @param new_visibility_history new visibility_history value
485 */
486void
487FacerInterface::set_visibility_history(const int32_t new_visibility_history)
488{
489 set_field(data->visibility_history, new_visibility_history);
490}
491
492/** Get learning_in_progress value.
493 *
494 Indicates whether a new identity is currently learnt. If
495 learning is in progress only "old" faces can be recognized.
496
497 * @return learning_in_progress value
498 */
499bool
500FacerInterface::is_learning_in_progress() const
501{
502 return data->learning_in_progress;
503}
504
505/** Get maximum length of learning_in_progress value.
506 * @return length of learning_in_progress value, can be length of the array or number of
507 * maximum number of characters for a string
508 */
509size_t
510FacerInterface::maxlenof_learning_in_progress() const
511{
512 return 1;
513}
514
515/** Set learning_in_progress value.
516 *
517 Indicates whether a new identity is currently learnt. If
518 learning is in progress only "old" faces can be recognized.
519
520 * @param new_learning_in_progress new learning_in_progress value
521 */
522void
523FacerInterface::set_learning_in_progress(const bool new_learning_in_progress)
524{
525 set_field(data->learning_in_progress, new_learning_in_progress);
526}
527
528/** Get searching_person value.
529 *
530 Indicates whether the plugin is searching for a specified person.
531 If set to true, the index and name will be listed in the fields
532 "requested_index" and "requested_name".
533
534 * @return searching_person value
535 */
536bool
537FacerInterface::is_searching_person() const
538{
539 return data->searching_person;
540}
541
542/** Get maximum length of searching_person value.
543 * @return length of searching_person value, can be length of the array or number of
544 * maximum number of characters for a string
545 */
546size_t
547FacerInterface::maxlenof_searching_person() const
548{
549 return 1;
550}
551
552/** Set searching_person value.
553 *
554 Indicates whether the plugin is searching for a specified person.
555 If set to true, the index and name will be listed in the fields
556 "requested_index" and "requested_name".
557
558 * @param new_searching_person new searching_person value
559 */
560void
561FacerInterface::set_searching_person(const bool new_searching_person)
562{
563 set_field(data->searching_person, new_searching_person);
564}
565
566/** Get recording_progress value.
567 *
568 Indicates the progress of recording images of a new face.
569
570 * @return recording_progress value
571 */
572float
573FacerInterface::recording_progress() const
574{
575 return data->recording_progress;
576}
577
578/** Get maximum length of recording_progress value.
579 * @return length of recording_progress value, can be length of the array or number of
580 * maximum number of characters for a string
581 */
582size_t
583FacerInterface::maxlenof_recording_progress() const
584{
585 return 1;
586}
587
588/** Set recording_progress value.
589 *
590 Indicates the progress of recording images of a new face.
591
592 * @param new_recording_progress new recording_progress value
593 */
594void
595FacerInterface::set_recording_progress(const float new_recording_progress)
596{
597 set_field(data->recording_progress, new_recording_progress);
598}
599
600/** Get bearing value.
601 *
602 The relative bearing to the recognized face in radians.
603
604 * @return bearing value
605 */
606float
607FacerInterface::bearing() const
608{
609 return data->bearing;
610}
611
612/** Get maximum length of bearing value.
613 * @return length of bearing value, can be length of the array or number of
614 * maximum number of characters for a string
615 */
616size_t
617FacerInterface::maxlenof_bearing() const
618{
619 return 1;
620}
621
622/** Set bearing value.
623 *
624 The relative bearing to the recognized face in radians.
625
626 * @param new_bearing new bearing value
627 */
628void
629FacerInterface::set_bearing(const float new_bearing)
630{
631 set_field(data->bearing, new_bearing);
632}
633
634/** Get slope value.
635 *
636 The relative slope to the recognized face in radians.
637
638 * @return slope value
639 */
640float
641FacerInterface::slope() const
642{
643 return data->slope;
644}
645
646/** Get maximum length of slope value.
647 * @return length of slope value, can be length of the array or number of
648 * maximum number of characters for a string
649 */
650size_t
651FacerInterface::maxlenof_slope() const
652{
653 return 1;
654}
655
656/** Set slope value.
657 *
658 The relative slope to the recognized face in radians.
659
660 * @param new_slope new slope value
661 */
662void
663FacerInterface::set_slope(const float new_slope)
664{
665 set_field(data->slope, new_slope);
666}
667
668/** Get requested_index value.
669 *
670 Index of the identity for which the name was requested.
671
672 * @return requested_index value
673 */
674uint32_t
675FacerInterface::requested_index() const
676{
677 return data->requested_index;
678}
679
680/** Get maximum length of requested_index value.
681 * @return length of requested_index value, can be length of the array or number of
682 * maximum number of characters for a string
683 */
684size_t
685FacerInterface::maxlenof_requested_index() const
686{
687 return 1;
688}
689
690/** Set requested_index value.
691 *
692 Index of the identity for which the name was requested.
693
694 * @param new_requested_index new requested_index value
695 */
696void
697FacerInterface::set_requested_index(const uint32_t new_requested_index)
698{
699 set_field(data->requested_index, new_requested_index);
700}
701
702/** Get requested_name value.
703 *
704 Requested name.
705
706 * @return requested_name value
707 */
708char *
709FacerInterface::requested_name() const
710{
711 return data->requested_name;
712}
713
714/** Get maximum length of requested_name value.
715 * @return length of requested_name value, can be length of the array or number of
716 * maximum number of characters for a string
717 */
718size_t
719FacerInterface::maxlenof_requested_name() const
720{
721 return 64;
722}
723
724/** Set requested_name value.
725 *
726 Requested name.
727
728 * @param new_requested_name new requested_name value
729 */
730void
731FacerInterface::set_requested_name(const char * new_requested_name)
732{
733 set_field(data->requested_name, new_requested_name);
734}
735
736/** Get index_last_learned value.
737 *
738 Index of the identity which was learned last.
739
740 * @return index_last_learned value
741 */
742uint32_t
743FacerInterface::index_last_learned() const
744{
745 return data->index_last_learned;
746}
747
748/** Get maximum length of index_last_learned value.
749 * @return length of index_last_learned value, can be length of the array or number of
750 * maximum number of characters for a string
751 */
752size_t
753FacerInterface::maxlenof_index_last_learned() const
754{
755 return 1;
756}
757
758/** Set index_last_learned value.
759 *
760 Index of the identity which was learned last.
761
762 * @param new_index_last_learned new index_last_learned value
763 */
764void
765FacerInterface::set_index_last_learned(const uint32_t new_index_last_learned)
766{
767 set_field(data->index_last_learned, new_index_last_learned);
768}
769
770/* =========== message create =========== */
771Message *
772FacerInterface::create_message(const char *type) const
773{
774 if ( strncmp("LearnFaceMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
775 return new LearnFaceMessage();
776 } else if ( strncmp("SetOpmodeMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
777 return new SetOpmodeMessage();
778 } else if ( strncmp("EnableIdentityMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
779 return new EnableIdentityMessage();
780 } else if ( strncmp("SetNameMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
781 return new SetNameMessage();
782 } else if ( strncmp("GetNameMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
783 return new GetNameMessage();
784 } else if ( strncmp("StartSearchPersonMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
785 return new StartSearchPersonMessage();
786 } else if ( strncmp("StopSearchPersonMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
787 return new StopSearchPersonMessage();
788 } else {
789 throw UnknownTypeException("The given type '%s' does not match any known "
790 "message type for this interface type.", type);
791 }
792}
793
794
795/** Copy values from other interface.
796 * @param other other interface to copy values from
797 */
798void
799FacerInterface::copy_values(const Interface *other)
800{
801 const FacerInterface *oi = dynamic_cast<const FacerInterface *>(other);
802 if (oi == NULL) {
803 throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
804 type(), other->type());
805 }
806 memcpy(data, oi->data, sizeof(FacerInterface_data_t));
807}
808
809const char *
810FacerInterface::enum_tostring(const char *enumtype, int val) const
811{
812 if (strcmp(enumtype, "if_facer_opmode_t") == 0) {
813 return tostring_if_facer_opmode_t((if_facer_opmode_t)val);
814 }
815 throw UnknownTypeException("Unknown enum type %s", enumtype);
816}
817
818/* =========== messages =========== */
819/** @class FacerInterface::LearnFaceMessage <interfaces/FacerInterface.h>
820 * LearnFaceMessage Fawkes BlackBoard Interface Message.
821 *
822
823 */
824
825
826/** Constructor with initial values.
827 * @param ini_name initial value for name
828 */
829FacerInterface::LearnFaceMessage::LearnFaceMessage(const char * ini_name) : Message("LearnFaceMessage")
830{
831 data_size = sizeof(LearnFaceMessage_data_t);
832 data_ptr = malloc(data_size);
833 memset(data_ptr, 0, data_size);
834 data = (LearnFaceMessage_data_t *)data_ptr;
836 strncpy(data->name, ini_name, 64-1);
837 data->name[64-1] = 0;
838 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
839 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
840 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
841 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
842 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
843 add_fieldinfo(IFT_STRING, "name", 64, data->name);
844}
845/** Constructor */
847{
848 data_size = sizeof(LearnFaceMessage_data_t);
849 data_ptr = malloc(data_size);
850 memset(data_ptr, 0, data_size);
851 data = (LearnFaceMessage_data_t *)data_ptr;
853 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
854 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
855 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
856 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
857 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
858 add_fieldinfo(IFT_STRING, "name", 64, data->name);
859}
860
861/** Destructor */
863{
864 free(data_ptr);
865}
866
867/** Copy constructor.
868 * @param m message to copy from
869 */
871{
872 data_size = m->data_size;
873 data_ptr = malloc(data_size);
874 memcpy(data_ptr, m->data_ptr, data_size);
875 data = (LearnFaceMessage_data_t *)data_ptr;
877}
878
879/* Methods */
880/** Get name value.
881 * The name assigned to the new identity.
882 * @return name value
883 */
884char *
886{
887 return data->name;
888}
889
890/** Get maximum length of name value.
891 * @return length of name value, can be length of the array or number of
892 * maximum number of characters for a string
893 */
894size_t
896{
897 return 64;
898}
899
900/** Set name value.
901 * The name assigned to the new identity.
902 * @param new_name new name value
903 */
904void
906{
907 set_field(data->name, new_name);
908}
909
910/** Clone this message.
911 * Produces a message of the same type as this message and copies the
912 * data to the new message.
913 * @return clone of this message
914 */
915Message *
917{
918 return new FacerInterface::LearnFaceMessage(this);
919}
920/** @class FacerInterface::SetOpmodeMessage <interfaces/FacerInterface.h>
921 * SetOpmodeMessage Fawkes BlackBoard Interface Message.
922 *
923
924 */
925
926
927/** Constructor with initial values.
928 * @param ini_opmode initial value for opmode
929 */
931{
932 data_size = sizeof(SetOpmodeMessage_data_t);
933 data_ptr = malloc(data_size);
934 memset(data_ptr, 0, data_size);
935 data = (SetOpmodeMessage_data_t *)data_ptr;
937 data->opmode = ini_opmode;
938 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
939 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
940 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
941 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
942 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
943 add_fieldinfo(IFT_ENUM, "opmode", 1, &data->opmode, "if_facer_opmode_t", &enum_map_if_facer_opmode_t);
944}
945/** Constructor */
947{
948 data_size = sizeof(SetOpmodeMessage_data_t);
949 data_ptr = malloc(data_size);
950 memset(data_ptr, 0, data_size);
951 data = (SetOpmodeMessage_data_t *)data_ptr;
953 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
954 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
955 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
956 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
957 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
958 add_fieldinfo(IFT_ENUM, "opmode", 1, &data->opmode, "if_facer_opmode_t", &enum_map_if_facer_opmode_t);
959}
960
961/** Destructor */
963{
964 free(data_ptr);
965}
966
967/** Copy constructor.
968 * @param m message to copy from
969 */
971{
972 data_size = m->data_size;
973 data_ptr = malloc(data_size);
974 memcpy(data_ptr, m->data_ptr, data_size);
975 data = (SetOpmodeMessage_data_t *)data_ptr;
977}
978
979/* Methods */
980/** Get opmode value.
981 *
982 Current opmode.
983
984 * @return opmode value
985 */
988{
989 return (FacerInterface::if_facer_opmode_t)data->opmode;
990}
991
992/** Get maximum length of opmode value.
993 * @return length of opmode value, can be length of the array or number of
994 * maximum number of characters for a string
995 */
996size_t
998{
999 return 1;
1000}
1001
1002/** Set opmode value.
1003 *
1004 Current opmode.
1005
1006 * @param new_opmode new opmode value
1007 */
1008void
1010{
1011 set_field(data->opmode, new_opmode);
1012}
1013
1014/** Clone this message.
1015 * Produces a message of the same type as this message and copies the
1016 * data to the new message.
1017 * @return clone of this message
1018 */
1019Message *
1021{
1022 return new FacerInterface::SetOpmodeMessage(this);
1023}
1024/** @class FacerInterface::EnableIdentityMessage <interfaces/FacerInterface.h>
1025 * EnableIdentityMessage Fawkes BlackBoard Interface Message.
1026 *
1027
1028 */
1029
1030
1031/** Constructor with initial values.
1032 * @param ini_index initial value for index
1033 * @param ini_enable initial value for enable
1034 */
1035FacerInterface::EnableIdentityMessage::EnableIdentityMessage(const uint32_t ini_index, const bool ini_enable) : Message("EnableIdentityMessage")
1036{
1037 data_size = sizeof(EnableIdentityMessage_data_t);
1038 data_ptr = malloc(data_size);
1039 memset(data_ptr, 0, data_size);
1040 data = (EnableIdentityMessage_data_t *)data_ptr;
1042 data->index = ini_index;
1043 data->enable = ini_enable;
1044 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1045 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1046 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1047 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1048 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1049 add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1050 add_fieldinfo(IFT_BOOL, "enable", 1, &data->enable);
1051}
1052/** Constructor */
1054{
1055 data_size = sizeof(EnableIdentityMessage_data_t);
1056 data_ptr = malloc(data_size);
1057 memset(data_ptr, 0, data_size);
1058 data = (EnableIdentityMessage_data_t *)data_ptr;
1060 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1061 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1062 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1063 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1064 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1065 add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1066 add_fieldinfo(IFT_BOOL, "enable", 1, &data->enable);
1067}
1068
1069/** Destructor */
1071{
1072 free(data_ptr);
1073}
1074
1075/** Copy constructor.
1076 * @param m message to copy from
1077 */
1079{
1080 data_size = m->data_size;
1081 data_ptr = malloc(data_size);
1082 memcpy(data_ptr, m->data_ptr, data_size);
1083 data = (EnableIdentityMessage_data_t *)data_ptr;
1085}
1086
1087/* Methods */
1088/** Get index value.
1089 * Index of the identity.
1090 * @return index value
1091 */
1092uint32_t
1094{
1095 return data->index;
1096}
1097
1098/** Get maximum length of index value.
1099 * @return length of index value, can be length of the array or number of
1100 * maximum number of characters for a string
1101 */
1102size_t
1104{
1105 return 1;
1106}
1107
1108/** Set index value.
1109 * Index of the identity.
1110 * @param new_index new index value
1111 */
1112void
1114{
1115 set_field(data->index, new_index);
1116}
1117
1118/** Get enable value.
1119 * En-/disable flag.
1120 * @return enable value
1121 */
1122bool
1124{
1125 return data->enable;
1126}
1127
1128/** Get maximum length of enable value.
1129 * @return length of enable value, can be length of the array or number of
1130 * maximum number of characters for a string
1131 */
1132size_t
1134{
1135 return 1;
1136}
1137
1138/** Set enable value.
1139 * En-/disable flag.
1140 * @param new_enable new enable value
1141 */
1142void
1144{
1145 set_field(data->enable, new_enable);
1146}
1147
1148/** Clone this message.
1149 * Produces a message of the same type as this message and copies the
1150 * data to the new message.
1151 * @return clone of this message
1152 */
1153Message *
1155{
1157}
1158/** @class FacerInterface::SetNameMessage <interfaces/FacerInterface.h>
1159 * SetNameMessage Fawkes BlackBoard Interface Message.
1160 *
1161
1162 */
1163
1164
1165/** Constructor with initial values.
1166 * @param ini_index initial value for index
1167 * @param ini_name initial value for name
1168 */
1169FacerInterface::SetNameMessage::SetNameMessage(const uint32_t ini_index, const char * ini_name) : Message("SetNameMessage")
1170{
1171 data_size = sizeof(SetNameMessage_data_t);
1172 data_ptr = malloc(data_size);
1173 memset(data_ptr, 0, data_size);
1174 data = (SetNameMessage_data_t *)data_ptr;
1176 data->index = ini_index;
1177 strncpy(data->name, ini_name, 64-1);
1178 data->name[64-1] = 0;
1179 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1180 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1181 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1182 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1183 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1184 add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1185 add_fieldinfo(IFT_STRING, "name", 64, data->name);
1186}
1187/** Constructor */
1189{
1190 data_size = sizeof(SetNameMessage_data_t);
1191 data_ptr = malloc(data_size);
1192 memset(data_ptr, 0, data_size);
1193 data = (SetNameMessage_data_t *)data_ptr;
1195 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1196 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1197 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1198 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1199 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1200 add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1201 add_fieldinfo(IFT_STRING, "name", 64, data->name);
1202}
1203
1204/** Destructor */
1206{
1207 free(data_ptr);
1208}
1209
1210/** Copy constructor.
1211 * @param m message to copy from
1212 */
1214{
1215 data_size = m->data_size;
1216 data_ptr = malloc(data_size);
1217 memcpy(data_ptr, m->data_ptr, data_size);
1218 data = (SetNameMessage_data_t *)data_ptr;
1220}
1221
1222/* Methods */
1223/** Get index value.
1224 * Index of the identity.
1225 * @return index value
1226 */
1227uint32_t
1229{
1230 return data->index;
1231}
1232
1233/** Get maximum length of index value.
1234 * @return length of index value, can be length of the array or number of
1235 * maximum number of characters for a string
1236 */
1237size_t
1239{
1240 return 1;
1241}
1242
1243/** Set index value.
1244 * Index of the identity.
1245 * @param new_index new index value
1246 */
1247void
1249{
1250 set_field(data->index, new_index);
1251}
1252
1253/** Get name value.
1254 * Name of the identity.
1255 * @return name value
1256 */
1257char *
1259{
1260 return data->name;
1261}
1262
1263/** Get maximum length of name value.
1264 * @return length of name value, can be length of the array or number of
1265 * maximum number of characters for a string
1266 */
1267size_t
1269{
1270 return 64;
1271}
1272
1273/** Set name value.
1274 * Name of the identity.
1275 * @param new_name new name value
1276 */
1277void
1279{
1280 set_field(data->name, new_name);
1281}
1282
1283/** Clone this message.
1284 * Produces a message of the same type as this message and copies the
1285 * data to the new message.
1286 * @return clone of this message
1287 */
1288Message *
1290{
1291 return new FacerInterface::SetNameMessage(this);
1292}
1293/** @class FacerInterface::GetNameMessage <interfaces/FacerInterface.h>
1294 * GetNameMessage Fawkes BlackBoard Interface Message.
1295 *
1296
1297 */
1298
1299
1300/** Constructor with initial values.
1301 * @param ini_index initial value for index
1302 */
1303FacerInterface::GetNameMessage::GetNameMessage(const uint32_t ini_index) : Message("GetNameMessage")
1304{
1305 data_size = sizeof(GetNameMessage_data_t);
1306 data_ptr = malloc(data_size);
1307 memset(data_ptr, 0, data_size);
1308 data = (GetNameMessage_data_t *)data_ptr;
1310 data->index = ini_index;
1311 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1312 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1313 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1314 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1315 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1316 add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1317}
1318/** Constructor */
1320{
1321 data_size = sizeof(GetNameMessage_data_t);
1322 data_ptr = malloc(data_size);
1323 memset(data_ptr, 0, data_size);
1324 data = (GetNameMessage_data_t *)data_ptr;
1326 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1327 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1328 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1329 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1330 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1331 add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1332}
1333
1334/** Destructor */
1336{
1337 free(data_ptr);
1338}
1339
1340/** Copy constructor.
1341 * @param m message to copy from
1342 */
1344{
1345 data_size = m->data_size;
1346 data_ptr = malloc(data_size);
1347 memcpy(data_ptr, m->data_ptr, data_size);
1348 data = (GetNameMessage_data_t *)data_ptr;
1350}
1351
1352/* Methods */
1353/** Get index value.
1354 * Index of the identity.
1355 * @return index value
1356 */
1357uint32_t
1359{
1360 return data->index;
1361}
1362
1363/** Get maximum length of index value.
1364 * @return length of index value, can be length of the array or number of
1365 * maximum number of characters for a string
1366 */
1367size_t
1369{
1370 return 1;
1371}
1372
1373/** Set index value.
1374 * Index of the identity.
1375 * @param new_index new index value
1376 */
1377void
1379{
1380 set_field(data->index, new_index);
1381}
1382
1383/** Clone this message.
1384 * Produces a message of the same type as this message and copies the
1385 * data to the new message.
1386 * @return clone of this message
1387 */
1388Message *
1390{
1391 return new FacerInterface::GetNameMessage(this);
1392}
1393/** @class FacerInterface::StartSearchPersonMessage <interfaces/FacerInterface.h>
1394 * StartSearchPersonMessage Fawkes BlackBoard Interface Message.
1395 *
1396
1397 */
1398
1399
1400/** Constructor with initial values.
1401 * @param ini_index initial value for index
1402 */
1403FacerInterface::StartSearchPersonMessage::StartSearchPersonMessage(const uint32_t ini_index) : Message("StartSearchPersonMessage")
1404{
1405 data_size = sizeof(StartSearchPersonMessage_data_t);
1406 data_ptr = malloc(data_size);
1407 memset(data_ptr, 0, data_size);
1408 data = (StartSearchPersonMessage_data_t *)data_ptr;
1410 data->index = ini_index;
1411 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1412 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1413 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1414 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1415 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1416 add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1417}
1418/** Constructor */
1420{
1421 data_size = sizeof(StartSearchPersonMessage_data_t);
1422 data_ptr = malloc(data_size);
1423 memset(data_ptr, 0, data_size);
1424 data = (StartSearchPersonMessage_data_t *)data_ptr;
1426 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1427 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1428 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1429 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1430 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1431 add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1432}
1433
1434/** Destructor */
1436{
1437 free(data_ptr);
1438}
1439
1440/** Copy constructor.
1441 * @param m message to copy from
1442 */
1444{
1445 data_size = m->data_size;
1446 data_ptr = malloc(data_size);
1447 memcpy(data_ptr, m->data_ptr, data_size);
1448 data = (StartSearchPersonMessage_data_t *)data_ptr;
1450}
1451
1452/* Methods */
1453/** Get index value.
1454 * Index of the identity.
1455 * @return index value
1456 */
1457uint32_t
1459{
1460 return data->index;
1461}
1462
1463/** Get maximum length of index value.
1464 * @return length of index value, can be length of the array or number of
1465 * maximum number of characters for a string
1466 */
1467size_t
1469{
1470 return 1;
1471}
1472
1473/** Set index value.
1474 * Index of the identity.
1475 * @param new_index new index value
1476 */
1477void
1479{
1480 set_field(data->index, new_index);
1481}
1482
1483/** Clone this message.
1484 * Produces a message of the same type as this message and copies the
1485 * data to the new message.
1486 * @return clone of this message
1487 */
1488Message *
1490{
1492}
1493/** @class FacerInterface::StopSearchPersonMessage <interfaces/FacerInterface.h>
1494 * StopSearchPersonMessage Fawkes BlackBoard Interface Message.
1495 *
1496
1497 */
1498
1499
1500/** Constructor */
1502{
1503 data_size = sizeof(StopSearchPersonMessage_data_t);
1504 data_ptr = malloc(data_size);
1505 memset(data_ptr, 0, data_size);
1506 data = (StopSearchPersonMessage_data_t *)data_ptr;
1508 enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1509 enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1510 enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1511 enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1512 enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1513}
1514
1515/** Destructor */
1517{
1518 free(data_ptr);
1519}
1520
1521/** Copy constructor.
1522 * @param m message to copy from
1523 */
1525{
1526 data_size = m->data_size;
1527 data_ptr = malloc(data_size);
1528 memcpy(data_ptr, m->data_ptr, data_size);
1529 data = (StopSearchPersonMessage_data_t *)data_ptr;
1531}
1532
1533/* Methods */
1534/** Clone this message.
1535 * Produces a message of the same type as this message and copies the
1536 * data to the new message.
1537 * @return clone of this message
1538 */
1539Message *
1541{
1543}
1544/** Check if message is valid and can be enqueued.
1545 * @param message Message to check
1546 * @return true if the message is valid, false otherwise.
1547 */
1548bool
1550{
1551 const LearnFaceMessage *m0 = dynamic_cast<const LearnFaceMessage *>(message);
1552 if ( m0 != NULL ) {
1553 return true;
1554 }
1555 const SetOpmodeMessage *m1 = dynamic_cast<const SetOpmodeMessage *>(message);
1556 if ( m1 != NULL ) {
1557 return true;
1558 }
1559 const EnableIdentityMessage *m2 = dynamic_cast<const EnableIdentityMessage *>(message);
1560 if ( m2 != NULL ) {
1561 return true;
1562 }
1563 const SetNameMessage *m3 = dynamic_cast<const SetNameMessage *>(message);
1564 if ( m3 != NULL ) {
1565 return true;
1566 }
1567 const GetNameMessage *m4 = dynamic_cast<const GetNameMessage *>(message);
1568 if ( m4 != NULL ) {
1569 return true;
1570 }
1571 const StartSearchPersonMessage *m5 = dynamic_cast<const StartSearchPersonMessage *>(message);
1572 if ( m5 != NULL ) {
1573 return true;
1574 }
1575 const StopSearchPersonMessage *m6 = dynamic_cast<const StopSearchPersonMessage *>(message);
1576 if ( m6 != NULL ) {
1577 return true;
1578 }
1579 return false;
1580}
1581
1582/// @cond INTERNALS
1583EXPORT_INTERFACE(FacerInterface)
1584/// @endcond
1585
1586
1587} // end namespace fawkes
EnableIdentityMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
size_t maxlenof_index() const
Get maximum length of index value.
void set_index(const uint32_t new_index)
Set index value.
void set_enable(const bool new_enable)
Set enable value.
uint32_t index() const
Get index value.
size_t maxlenof_enable() const
Get maximum length of enable value.
GetNameMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
void set_index(const uint32_t new_index)
Set index value.
size_t maxlenof_index() const
Get maximum length of index value.
uint32_t index() const
Get index value.
LearnFaceMessage Fawkes BlackBoard Interface Message.
void set_name(const char *new_name)
Set name value.
virtual Message * clone() const
Clone this message.
char * name() const
Get name value.
size_t maxlenof_name() const
Get maximum length of name value.
SetNameMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
uint32_t index() const
Get index value.
size_t maxlenof_index() const
Get maximum length of index value.
char * name() const
Get name value.
size_t maxlenof_name() const
Get maximum length of name value.
void set_name(const char *new_name)
Set name value.
void set_index(const uint32_t new_index)
Set index value.
SetOpmodeMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_opmode() const
Get maximum length of opmode value.
void set_opmode(const if_facer_opmode_t new_opmode)
Set opmode value.
if_facer_opmode_t opmode() const
Get opmode value.
virtual Message * clone() const
Clone this message.
StartSearchPersonMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
void set_index(const uint32_t new_index)
Set index value.
size_t maxlenof_index() const
Get maximum length of index value.
StopSearchPersonMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
FacerInterface Fawkes BlackBoard Interface.
if_facer_opmode_t
This determines the current status of skill execution.
@ OPMODE_GENDER
Facer will detect faces and try to identify the gender of the faces.
@ OPMODE_DETECTION
Facer will detect faces, but not try to recognize them.
@ OPMODE_RECOGNITION
Facer will detect faces, and then try to recognize the most dominant face.
@ OPMODE_DISABLED
Facer will not process any images.
@ OPMODE_LEARNING
Facer will gather images and learn an identity.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
const char * type() const
Get type of interface.
Definition: interface.cpp:652
void * data_ptr
Pointer to local memory storage.
Definition: interface.h:244
void set_field(FieldT &field, DataT &data)
Set a field, set data_changed to true and update data_changed accordingly.
Definition: interface.h:304
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the info list.
Definition: message.cpp:435
void * data_ptr
Pointer to memory that contains local data.
Definition: message.h:146
message_data_ts_t * data_ts
data timestamp aliasing pointer
Definition: message.h:156
unsigned int data_size
Size of memory needed to hold all data.
Definition: message.h:147
Fawkes library namespace.
@ IFT_UINT32
32 bit unsigned integer field
Definition: types.h:43
@ IFT_STRING
string field
Definition: types.h:48
@ IFT_BOOL
boolean field
Definition: types.h:37
@ IFT_ENUM
field with interface specific enum type
Definition: types.h:50
Timestamp data, must be present and first entries for each interface data structs!...
Definition: message.h:152