Fawkes API  Fawkes Development Version
SkillerInterface.cpp
1 
2 /***************************************************************************
3  * SkillerInterface.cpp - Fawkes BlackBoard Interface - SkillerInterface
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/SkillerInterface.h>
25 
26 #include <core/exceptions/software.h>
27 
28 #include <map>
29 #include <string>
30 #include <cstring>
31 #include <cstdlib>
32 
33 namespace fawkes {
34 
35 /** @class SkillerInterface <interfaces/SkillerInterface.h>
36  * SkillerInterface Fawkes BlackBoard Interface.
37  *
38  The interface provides access to the skill execution runtime plugin.
39  It provides basic status information about skiller and allows for
40  calling skills via messages. It can also be used to manually restart
41  the Lua interpreter if something is wedged.
42 
43  * @ingroup FawkesInterfaces
44  */
45 
46 
47 
48 /** Constructor */
49 SkillerInterface::SkillerInterface() : Interface()
50 {
51  data_size = sizeof(SkillerInterface_data_t);
52  data_ptr = malloc(data_size);
53  data = (SkillerInterface_data_t *)data_ptr;
54  data_ts = (interface_data_ts_t *)data_ptr;
55  memset(data_ptr, 0, data_size);
56  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
57  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
58  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
59  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
60  add_fieldinfo(IFT_STRING, "skill_string", 1024, data->skill_string);
61  add_fieldinfo(IFT_STRING, "error", 128, data->error);
62  add_fieldinfo(IFT_UINT32, "exclusive_controller", 1, &data->exclusive_controller);
63  add_fieldinfo(IFT_UINT32, "msgid", 1, &data->msgid);
64  add_fieldinfo(IFT_ENUM, "status", 1, &data->status, "SkillStatusEnum", &enum_map_SkillStatusEnum);
65  add_messageinfo("ExecSkillMessage");
66  add_messageinfo("RestartInterpreterMessage");
67  add_messageinfo("StopExecMessage");
68  add_messageinfo("AcquireControlMessage");
69  add_messageinfo("ReleaseControlMessage");
70  unsigned char tmp_hash[] = {0x99, 0x14, 0xe6, 0x2b, 0x7f, 0x3b, 0x80, 0xb, 0xbd, 0x35, 0x10, 0xc0, 0x7e, 0xb5, 0xdc, 0x55};
71  set_hash(tmp_hash);
72 }
73 
74 /** Destructor */
75 SkillerInterface::~SkillerInterface()
76 {
77  free(data_ptr);
78 }
79 /** Convert SkillStatusEnum constant to string.
80  * @param value value to convert to string
81  * @return constant value as string.
82  */
83 const char *
85 {
86  switch (value) {
87  case S_INACTIVE: return "S_INACTIVE";
88  case S_FINAL: return "S_FINAL";
89  case S_RUNNING: return "S_RUNNING";
90  case S_FAILED: return "S_FAILED";
91  default: return "UNKNOWN";
92  }
93 }
94 /* Methods */
95 /** Get skill_string value.
96  *
97  Currently executed skill string, at least the first 1023 bytes of it.
98  Must be properly null-terminated.
99 
100  * @return skill_string value
101  */
102 char *
104 {
105  return data->skill_string;
106 }
107 
108 /** Get maximum length of skill_string value.
109  * @return length of skill_string value, can be length of the array or number of
110  * maximum number of characters for a string
111  */
112 size_t
114 {
115  return 1024;
116 }
117 
118 /** Set skill_string value.
119  *
120  Currently executed skill string, at least the first 1023 bytes of it.
121  Must be properly null-terminated.
122 
123  * @param new_skill_string new skill_string value
124  */
125 void
126 SkillerInterface::set_skill_string(const char * new_skill_string)
127 {
128  data_changed |= change_field(data->skill_string, new_skill_string);
129 }
130 
131 /** Get error value.
132  *
133  String describing the error. Can be set by a skill when it fails.
134 
135  * @return error value
136  */
137 char *
139 {
140  return data->error;
141 }
142 
143 /** Get maximum length of error value.
144  * @return length of error value, can be length of the array or number of
145  * maximum number of characters for a string
146  */
147 size_t
149 {
150  return 128;
151 }
152 
153 /** Set error value.
154  *
155  String describing the error. Can be set by a skill when it fails.
156 
157  * @param new_error new error value
158  */
159 void
160 SkillerInterface::set_error(const char * new_error)
161 {
162  data_changed |= change_field(data->error, new_error);
163 }
164 
165 /** Get exclusive_controller value.
166  *
167  Instance serial of the exclusive controller of the skiller. If this does not
168  carry your instance serial your exec messages will be ignored. Aquire control with
169  the AquireControlMessage. Make sure you release control before exiting.
170 
171  * @return exclusive_controller value
172  */
173 uint32_t
175 {
176  return data->exclusive_controller;
177 }
178 
179 /** Get maximum length of exclusive_controller value.
180  * @return length of exclusive_controller value, can be length of the array or number of
181  * maximum number of characters for a string
182  */
183 size_t
185 {
186  return 1;
187 }
188 
189 /** Set exclusive_controller value.
190  *
191  Instance serial of the exclusive controller of the skiller. If this does not
192  carry your instance serial your exec messages will be ignored. Aquire control with
193  the AquireControlMessage. Make sure you release control before exiting.
194 
195  * @param new_exclusive_controller new exclusive_controller value
196  */
197 void
198 SkillerInterface::set_exclusive_controller(const uint32_t new_exclusive_controller)
199 {
200  data_changed |= change_field(data->exclusive_controller, new_exclusive_controller);
201 }
202 
203 /** Get msgid value.
204  *
205  The ID of the message that is currently being processed,
206  or 0 if no message is being processed.
207 
208  * @return msgid value
209  */
210 uint32_t
212 {
213  return data->msgid;
214 }
215 
216 /** Get maximum length of msgid value.
217  * @return length of msgid value, can be length of the array or number of
218  * maximum number of characters for a string
219  */
220 size_t
222 {
223  return 1;
224 }
225 
226 /** Set msgid value.
227  *
228  The ID of the message that is currently being processed,
229  or 0 if no message is being processed.
230 
231  * @param new_msgid new msgid value
232  */
233 void
234 SkillerInterface::set_msgid(const uint32_t new_msgid)
235 {
236  data_changed |= change_field(data->msgid, new_msgid);
237 }
238 
239 /** Get status value.
240  *
241  The status of the current skill execution.
242 
243  * @return status value
244  */
247 {
248  return (SkillerInterface::SkillStatusEnum)data->status;
249 }
250 
251 /** Get maximum length of status value.
252  * @return length of status value, can be length of the array or number of
253  * maximum number of characters for a string
254  */
255 size_t
257 {
258  return 1;
259 }
260 
261 /** Set status value.
262  *
263  The status of the current skill execution.
264 
265  * @param new_status new status value
266  */
267 void
269 {
270  data_changed |= change_field(data->status, new_status);
271 }
272 
273 /* =========== message create =========== */
274 Message *
276 {
277  if ( strncmp("ExecSkillMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
278  return new ExecSkillMessage();
279  } else if ( strncmp("RestartInterpreterMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
280  return new RestartInterpreterMessage();
281  } else if ( strncmp("StopExecMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
282  return new StopExecMessage();
283  } else if ( strncmp("AcquireControlMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
284  return new AcquireControlMessage();
285  } else if ( strncmp("ReleaseControlMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
286  return new ReleaseControlMessage();
287  } else {
288  throw UnknownTypeException("The given type '%s' does not match any known "
289  "message type for this interface type.", type);
290  }
291 }
292 
293 
294 /** Copy values from other interface.
295  * @param other other interface to copy values from
296  */
297 void
299 {
300  const SkillerInterface *oi = dynamic_cast<const SkillerInterface *>(other);
301  if (oi == NULL) {
302  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
303  type(), other->type());
304  }
305  memcpy(data, oi->data, sizeof(SkillerInterface_data_t));
306 }
307 
308 const char *
309 SkillerInterface::enum_tostring(const char *enumtype, int val) const
310 {
311  if (strcmp(enumtype, "SkillStatusEnum") == 0) {
312  return tostring_SkillStatusEnum((SkillStatusEnum)val);
313  }
314  throw UnknownTypeException("Unknown enum type %s", enumtype);
315 }
316 
317 /* =========== messages =========== */
318 /** @class SkillerInterface::ExecSkillMessage <interfaces/SkillerInterface.h>
319  * ExecSkillMessage Fawkes BlackBoard Interface Message.
320  *
321 
322  */
323 
324 
325 /** Constructor with initial values.
326  * @param ini_skill_string initial value for skill_string
327  */
328 SkillerInterface::ExecSkillMessage::ExecSkillMessage(const char * ini_skill_string) : Message("ExecSkillMessage")
329 {
330  data_size = sizeof(ExecSkillMessage_data_t);
331  data_ptr = malloc(data_size);
332  memset(data_ptr, 0, data_size);
333  data = (ExecSkillMessage_data_t *)data_ptr;
335  strncpy(data->skill_string, ini_skill_string, 1024-1);
336  data->skill_string[1024-1] = 0;
337  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
338  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
339  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
340  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
341  add_fieldinfo(IFT_STRING, "skill_string", 1024, data->skill_string);
342 }
343 /** Constructor */
345 {
346  data_size = sizeof(ExecSkillMessage_data_t);
347  data_ptr = malloc(data_size);
348  memset(data_ptr, 0, data_size);
349  data = (ExecSkillMessage_data_t *)data_ptr;
351  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
352  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
353  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
354  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
355  add_fieldinfo(IFT_STRING, "skill_string", 1024, data->skill_string);
356 }
357 
358 /** Destructor */
360 {
361  free(data_ptr);
362 }
363 
364 /** Copy constructor.
365  * @param m message to copy from
366  */
368 {
369  data_size = m->data_size;
370  data_ptr = malloc(data_size);
371  memcpy(data_ptr, m->data_ptr, data_size);
372  data = (ExecSkillMessage_data_t *)data_ptr;
374 }
375 
376 /* Methods */
377 /** Get skill_string value.
378  *
379  Currently executed skill string, at least the first 1023 bytes of it.
380  Must be properly null-terminated.
381 
382  * @return skill_string value
383  */
384 char *
386 {
387  return data->skill_string;
388 }
389 
390 /** Get maximum length of skill_string value.
391  * @return length of skill_string value, can be length of the array or number of
392  * maximum number of characters for a string
393  */
394 size_t
396 {
397  return 1024;
398 }
399 
400 /** Set skill_string value.
401  *
402  Currently executed skill string, at least the first 1023 bytes of it.
403  Must be properly null-terminated.
404 
405  * @param new_skill_string new skill_string value
406  */
407 void
409 {
410  change_field(data->skill_string, new_skill_string);
411 }
412 
413 /** Clone this message.
414  * Produces a message of the same type as this message and copies the
415  * data to the new message.
416  * @return clone of this message
417  */
418 Message *
420 {
421  return new SkillerInterface::ExecSkillMessage(this);
422 }
423 /** @class SkillerInterface::RestartInterpreterMessage <interfaces/SkillerInterface.h>
424  * RestartInterpreterMessage Fawkes BlackBoard Interface Message.
425  *
426 
427  */
428 
429 
430 /** Constructor */
432 {
433  data_size = sizeof(RestartInterpreterMessage_data_t);
434  data_ptr = malloc(data_size);
435  memset(data_ptr, 0, data_size);
436  data = (RestartInterpreterMessage_data_t *)data_ptr;
438  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
439  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
440  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
441  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
442 }
443 
444 /** Destructor */
446 {
447  free(data_ptr);
448 }
449 
450 /** Copy constructor.
451  * @param m message to copy from
452  */
454 {
455  data_size = m->data_size;
456  data_ptr = malloc(data_size);
457  memcpy(data_ptr, m->data_ptr, data_size);
458  data = (RestartInterpreterMessage_data_t *)data_ptr;
460 }
461 
462 /* Methods */
463 /** Clone this message.
464  * Produces a message of the same type as this message and copies the
465  * data to the new message.
466  * @return clone of this message
467  */
468 Message *
470 {
472 }
473 /** @class SkillerInterface::StopExecMessage <interfaces/SkillerInterface.h>
474  * StopExecMessage Fawkes BlackBoard Interface Message.
475  *
476 
477  */
478 
479 
480 /** Constructor */
482 {
483  data_size = sizeof(StopExecMessage_data_t);
484  data_ptr = malloc(data_size);
485  memset(data_ptr, 0, data_size);
486  data = (StopExecMessage_data_t *)data_ptr;
488  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
489  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
490  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
491  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
492 }
493 
494 /** Destructor */
496 {
497  free(data_ptr);
498 }
499 
500 /** Copy constructor.
501  * @param m message to copy from
502  */
504 {
505  data_size = m->data_size;
506  data_ptr = malloc(data_size);
507  memcpy(data_ptr, m->data_ptr, data_size);
508  data = (StopExecMessage_data_t *)data_ptr;
510 }
511 
512 /* Methods */
513 /** Clone this message.
514  * Produces a message of the same type as this message and copies the
515  * data to the new message.
516  * @return clone of this message
517  */
518 Message *
520 {
521  return new SkillerInterface::StopExecMessage(this);
522 }
523 /** @class SkillerInterface::AcquireControlMessage <interfaces/SkillerInterface.h>
524  * AcquireControlMessage Fawkes BlackBoard Interface Message.
525  *
526 
527  */
528 
529 
530 /** Constructor with initial values.
531  * @param ini_steal_control initial value for steal_control
532  */
533 SkillerInterface::AcquireControlMessage::AcquireControlMessage(const bool ini_steal_control) : Message("AcquireControlMessage")
534 {
535  data_size = sizeof(AcquireControlMessage_data_t);
536  data_ptr = malloc(data_size);
537  memset(data_ptr, 0, data_size);
538  data = (AcquireControlMessage_data_t *)data_ptr;
540  data->steal_control = ini_steal_control;
541  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
542  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
543  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
544  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
545  add_fieldinfo(IFT_BOOL, "steal_control", 1, &data->steal_control);
546 }
547 /** Constructor */
549 {
550  data_size = sizeof(AcquireControlMessage_data_t);
551  data_ptr = malloc(data_size);
552  memset(data_ptr, 0, data_size);
553  data = (AcquireControlMessage_data_t *)data_ptr;
555  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
556  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
557  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
558  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
559  add_fieldinfo(IFT_BOOL, "steal_control", 1, &data->steal_control);
560 }
561 
562 /** Destructor */
564 {
565  free(data_ptr);
566 }
567 
568 /** Copy constructor.
569  * @param m message to copy from
570  */
572 {
573  data_size = m->data_size;
574  data_ptr = malloc(data_size);
575  memcpy(data_ptr, m->data_ptr, data_size);
576  data = (AcquireControlMessage_data_t *)data_ptr;
578 }
579 
580 /* Methods */
581 /** Get steal_control value.
582  *
583  If set to true steal the control from someone else who has it
584  atm. Use this with caution. But sometimes it is necessary to
585  ensure a successful operation, e.g. if the agent tries to
586  acquire control.
587 
588  * @return steal_control value
589  */
590 bool
592 {
593  return data->steal_control;
594 }
595 
596 /** Get maximum length of steal_control value.
597  * @return length of steal_control value, can be length of the array or number of
598  * maximum number of characters for a string
599  */
600 size_t
602 {
603  return 1;
604 }
605 
606 /** Set steal_control value.
607  *
608  If set to true steal the control from someone else who has it
609  atm. Use this with caution. But sometimes it is necessary to
610  ensure a successful operation, e.g. if the agent tries to
611  acquire control.
612 
613  * @param new_steal_control new steal_control value
614  */
615 void
617 {
618  change_field(data->steal_control, new_steal_control);
619 }
620 
621 /** Clone this message.
622  * Produces a message of the same type as this message and copies the
623  * data to the new message.
624  * @return clone of this message
625  */
626 Message *
628 {
630 }
631 /** @class SkillerInterface::ReleaseControlMessage <interfaces/SkillerInterface.h>
632  * ReleaseControlMessage Fawkes BlackBoard Interface Message.
633  *
634 
635  */
636 
637 
638 /** Constructor */
640 {
641  data_size = sizeof(ReleaseControlMessage_data_t);
642  data_ptr = malloc(data_size);
643  memset(data_ptr, 0, data_size);
644  data = (ReleaseControlMessage_data_t *)data_ptr;
646  enum_map_SkillStatusEnum[(int)S_INACTIVE] = "S_INACTIVE";
647  enum_map_SkillStatusEnum[(int)S_FINAL] = "S_FINAL";
648  enum_map_SkillStatusEnum[(int)S_RUNNING] = "S_RUNNING";
649  enum_map_SkillStatusEnum[(int)S_FAILED] = "S_FAILED";
650 }
651 
652 /** Destructor */
654 {
655  free(data_ptr);
656 }
657 
658 /** Copy constructor.
659  * @param m message to copy from
660  */
662 {
663  data_size = m->data_size;
664  data_ptr = malloc(data_size);
665  memcpy(data_ptr, m->data_ptr, data_size);
666  data = (ReleaseControlMessage_data_t *)data_ptr;
668 }
669 
670 /* Methods */
671 /** Clone this message.
672  * Produces a message of the same type as this message and copies the
673  * data to the new message.
674  * @return clone of this message
675  */
676 Message *
678 {
680 }
681 /** Check if message is valid and can be enqueued.
682  * @param message Message to check
683  * @return true if the message is valid, false otherwise.
684  */
685 bool
687 {
688  const ExecSkillMessage *m0 = dynamic_cast<const ExecSkillMessage *>(message);
689  if ( m0 != NULL ) {
690  return true;
691  }
692  const RestartInterpreterMessage *m1 = dynamic_cast<const RestartInterpreterMessage *>(message);
693  if ( m1 != NULL ) {
694  return true;
695  }
696  const StopExecMessage *m2 = dynamic_cast<const StopExecMessage *>(message);
697  if ( m2 != NULL ) {
698  return true;
699  }
700  const AcquireControlMessage *m3 = dynamic_cast<const AcquireControlMessage *>(message);
701  if ( m3 != NULL ) {
702  return true;
703  }
704  const ReleaseControlMessage *m4 = dynamic_cast<const ReleaseControlMessage *>(message);
705  if ( m4 != NULL ) {
706  return true;
707  }
708  return false;
709 }
710 
711 /// @cond INTERNALS
712 EXPORT_INTERFACE(SkillerInterface)
713 /// @endcond
714 
715 
716 } // end namespace fawkes
fawkes::Interface::data_ptr
void * data_ptr
Pointer to local memory storage.
Definition: interface.h:224
fawkes::SkillerInterface::copy_values
virtual void copy_values(const Interface *other)
Copy values from other interface.
Definition: SkillerInterface.cpp:298
fawkes::SkillerInterface::set_exclusive_controller
void set_exclusive_controller(const uint32_t new_exclusive_controller)
Set exclusive_controller value.
Definition: SkillerInterface.cpp:198
fawkes::SkillerInterface::ReleaseControlMessage::~ReleaseControlMessage
~ReleaseControlMessage()
Destructor.
Definition: SkillerInterface.cpp:653
fawkes::SkillerInterface::RestartInterpreterMessage
RestartInterpreterMessage Fawkes BlackBoard Interface Message.
Definition: SkillerInterface.h:113
fawkes::SkillerInterface::StopExecMessage::clone
virtual Message * clone() const
Clone this message.
Definition: SkillerInterface.cpp:519
fawkes::SkillerInterface::AcquireControlMessage::set_steal_control
void set_steal_control(const bool new_steal_control)
Set steal_control value.
Definition: SkillerInterface.cpp:616
fawkes::SkillerInterface::tostring_SkillStatusEnum
const char * tostring_SkillStatusEnum(SkillStatusEnum value) const
Convert SkillStatusEnum constant to string.
Definition: SkillerInterface.cpp:84
fawkes::SkillerInterface::AcquireControlMessage::is_steal_control
bool is_steal_control() const
Get steal_control value.
Definition: SkillerInterface.cpp:591
fawkes::SkillerInterface::RestartInterpreterMessage::RestartInterpreterMessage
RestartInterpreterMessage()
Constructor.
Definition: SkillerInterface.cpp:431
fawkes::SkillerInterface::S_RUNNING
@ S_RUNNING
The execution is still running.
Definition: SkillerInterface.h:47
fawkes::Message
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:45
fawkes::SkillerInterface::ExecSkillMessage::maxlenof_skill_string
size_t maxlenof_skill_string() const
Get maximum length of skill_string value.
Definition: SkillerInterface.cpp:395
fawkes::SkillerInterface::ReleaseControlMessage
ReleaseControlMessage Fawkes BlackBoard Interface Message.
Definition: SkillerInterface.h:186
fawkes::Message::data_ptr
void * data_ptr
Pointer to memory that contains local data.
Definition: message.h:128
fawkes::IFT_BOOL
@ IFT_BOOL
boolean field
Definition: types.h:37
fawkes::SkillerInterface::set_msgid
void set_msgid(const uint32_t new_msgid)
Set msgid value.
Definition: SkillerInterface.cpp:234
fawkes::IFT_ENUM
@ IFT_ENUM
field with interface specific enum type
Definition: types.h:50
fawkes::Message::data_ts
message_data_ts_t * data_ts
data timestamp aliasing pointer
Definition: message.h:138
fawkes::IFT_UINT32
@ IFT_UINT32
32 bit unsigned integer field
Definition: types.h:43
fawkes::SkillerInterface::ExecSkillMessage::ExecSkillMessage
ExecSkillMessage()
Constructor.
Definition: SkillerInterface.cpp:344
fawkes::SkillerInterface::maxlenof_skill_string
size_t maxlenof_skill_string() const
Get maximum length of skill_string value.
Definition: SkillerInterface.cpp:113
fawkes::Interface::type
const char * type() const
Get type of interface.
Definition: interface.cpp:643
fawkes::SkillerInterface::ReleaseControlMessage::clone
virtual Message * clone() const
Clone this message.
Definition: SkillerInterface.cpp:677
fawkes::SkillerInterface::maxlenof_error
size_t maxlenof_error() const
Get maximum length of error value.
Definition: SkillerInterface.cpp:148
fawkes::SkillerInterface::SkillStatusEnum
SkillStatusEnum
This determines the current status of skill execution.
Definition: SkillerInterface.h:44
fawkes::SkillerInterface::maxlenof_exclusive_controller
size_t maxlenof_exclusive_controller() const
Get maximum length of exclusive_controller value.
Definition: SkillerInterface.cpp:184
fawkes::SkillerInterface::S_FINAL
@ S_FINAL
The skill string has been successfully processed.
Definition: SkillerInterface.h:46
fawkes::Message::message_data_ts_t
Timestamp data, must be present and first entries for each interface data structs!...
Definition: message.h:134
fawkes::SkillerInterface::RestartInterpreterMessage::~RestartInterpreterMessage
~RestartInterpreterMessage()
Destructor.
Definition: SkillerInterface.cpp:445
fawkes::TypeMismatchException
Type mismatch.
Definition: software.h:44
fawkes::Interface::data_changed
bool data_changed
Indicator if data has changed.
Definition: interface.h:226
fawkes::SkillerInterface::AcquireControlMessage
AcquireControlMessage Fawkes BlackBoard Interface Message.
Definition: SkillerInterface.h:155
fawkes::SkillerInterface::set_error
void set_error(const char *new_error)
Set error value.
Definition: SkillerInterface.cpp:160
fawkes::SkillerInterface::ExecSkillMessage
ExecSkillMessage Fawkes BlackBoard Interface Message.
Definition: SkillerInterface.h:84
fawkes::SkillerInterface::StopExecMessage
StopExecMessage Fawkes BlackBoard Interface Message.
Definition: SkillerInterface.h:134
fawkes::UnknownTypeException
Unknown type.
Definition: software.h:50
fawkes::SkillerInterface::set_status
void set_status(const SkillStatusEnum new_status)
Set status value.
Definition: SkillerInterface.cpp:268
fawkes::SkillerInterface::S_FAILED
@ S_FAILED
The execution failed and cannot succeed anymore.
Definition: SkillerInterface.h:48
fawkes
Fawkes library namespace.
fawkes::SkillerInterface::status
SkillStatusEnum status() const
Get status value.
Definition: SkillerInterface.cpp:246
fawkes::Interface::set_hash
void set_hash(unsigned char *ihash)
Set hash.
Definition: interface.cpp:316
fawkes::Message::data_size
unsigned int data_size
Size of memory needed to hold all data.
Definition: message.h:129
fawkes::SkillerInterface::ExecSkillMessage::clone
virtual Message * clone() const
Clone this message.
Definition: SkillerInterface.cpp:419
fawkes::SkillerInterface::AcquireControlMessage::clone
virtual Message * clone() const
Clone this message.
Definition: SkillerInterface.cpp:627
fawkes::Interface
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:79
fawkes::SkillerInterface::msgid
uint32_t msgid() const
Get msgid value.
Definition: SkillerInterface.cpp:211
fawkes::SkillerInterface::create_message
virtual Message * create_message(const char *type) const
Create message based on type name.
Definition: SkillerInterface.cpp:275
fawkes::SkillerInterface::ExecSkillMessage::~ExecSkillMessage
~ExecSkillMessage()
Destructor.
Definition: SkillerInterface.cpp:359
fawkes::SkillerInterface::AcquireControlMessage::AcquireControlMessage
AcquireControlMessage()
Constructor.
Definition: SkillerInterface.cpp:548
fawkes::SkillerInterface
SkillerInterface Fawkes BlackBoard Interface.
Definition: SkillerInterface.h:34
fawkes::SkillerInterface::skill_string
char * skill_string() const
Get skill_string value.
Definition: SkillerInterface.cpp:103
fawkes::SkillerInterface::ExecSkillMessage::skill_string
char * skill_string() const
Get skill_string value.
Definition: SkillerInterface.cpp:385
fawkes::SkillerInterface::error
char * error() const
Get error value.
Definition: SkillerInterface.cpp:138
fawkes::Message::add_fieldinfo
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:400
fawkes::SkillerInterface::maxlenof_status
size_t maxlenof_status() const
Get maximum length of status value.
Definition: SkillerInterface.cpp:256
fawkes::SkillerInterface::set_skill_string
void set_skill_string(const char *new_skill_string)
Set skill_string value.
Definition: SkillerInterface.cpp:126
fawkes::SkillerInterface::ReleaseControlMessage::ReleaseControlMessage
ReleaseControlMessage()
Constructor.
Definition: SkillerInterface.cpp:639
fawkes::SkillerInterface::ExecSkillMessage::set_skill_string
void set_skill_string(const char *new_skill_string)
Set skill_string value.
Definition: SkillerInterface.cpp:408
fawkes::SkillerInterface::AcquireControlMessage::~AcquireControlMessage
~AcquireControlMessage()
Destructor.
Definition: SkillerInterface.cpp:563
fawkes::IFT_STRING
@ IFT_STRING
string field
Definition: types.h:48
fawkes::SkillerInterface::exclusive_controller
uint32_t exclusive_controller() const
Get exclusive_controller value.
Definition: SkillerInterface.cpp:174
fawkes::SkillerInterface::AcquireControlMessage::maxlenof_steal_control
size_t maxlenof_steal_control() const
Get maximum length of steal_control value.
Definition: SkillerInterface.cpp:601
fawkes::SkillerInterface::enum_tostring
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
Definition: SkillerInterface.cpp:309
fawkes::Interface::add_messageinfo
void add_messageinfo(const char *name)
Add an entry to the message info list.
Definition: interface.cpp:375
fawkes::SkillerInterface::StopExecMessage::~StopExecMessage
~StopExecMessage()
Destructor.
Definition: SkillerInterface.cpp:495
fawkes::SkillerInterface::RestartInterpreterMessage::clone
virtual Message * clone() const
Clone this message.
Definition: SkillerInterface.cpp:469
fawkes::SkillerInterface::message_valid
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
Definition: SkillerInterface.cpp:686
fawkes::SkillerInterface::maxlenof_msgid
size_t maxlenof_msgid() const
Get maximum length of msgid value.
Definition: SkillerInterface.cpp:221
fawkes::change_field
bool change_field(FieldT &field, const DataT &value)
Set a field and return whether it changed.
Definition: message.h:167
fawkes::SkillerInterface::StopExecMessage::StopExecMessage
StopExecMessage()
Constructor.
Definition: SkillerInterface.cpp:481
fawkes::SkillerInterface::S_INACTIVE
@ S_INACTIVE
No skill is running.
Definition: SkillerInterface.h:45