Fawkes API  Fawkes Development Version
OpenRaveInterface.cpp
00001 
00002 /***************************************************************************
00003  *  OpenRaveInterface.cpp - Fawkes BlackBoard Interface - OpenRaveInterface
00004  *
00005  *  Templated created:   Thu Oct 12 10:49:19 2006
00006  *  Copyright  2011  Bahram Maleki-Fard
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #include <interfaces/OpenRaveInterface.h>
00025 
00026 #include <core/exceptions/software.h>
00027 
00028 #include <cstring>
00029 #include <cstdlib>
00030 
00031 namespace fawkes {
00032 
00033 /** @class OpenRaveInterface <interfaces/OpenRaveInterface.h>
00034  * OpenRaveInterface Fawkes BlackBoard Interface.
00035  * 
00036       Interface providing access to OpenRAVE functionality
00037     
00038  * @ingroup FawkesInterfaces
00039  */
00040 
00041 
00042 
00043 /** Constructor */
00044 OpenRaveInterface::OpenRaveInterface() : Interface()
00045 {
00046   data_size = sizeof(OpenRaveInterface_data_t);
00047   data_ptr  = malloc(data_size);
00048   data      = (OpenRaveInterface_data_t *)data_ptr;
00049   data_ts   = (interface_data_ts_t *)data_ptr;
00050   memset(data_ptr, 0, data_size);
00051   add_fieldinfo(IFT_UINT32, "msgid", 1, &data->msgid);
00052   add_fieldinfo(IFT_BOOL, "final", 1, &data->final);
00053   add_fieldinfo(IFT_UINT32, "error_code", 1, &data->error_code);
00054   add_fieldinfo(IFT_BOOL, "success", 1, &data->success);
00055   add_messageinfo("AddObjectMessage");
00056   add_messageinfo("DeleteObjectMessage");
00057   add_messageinfo("AttachObjectMessage");
00058   add_messageinfo("ReleaseObjectMessage");
00059   add_messageinfo("ReleaseAllObjectsMessage");
00060   add_messageinfo("MoveObjectMessage");
00061   add_messageinfo("RotateObjectQuatMessage");
00062   add_messageinfo("RotateObjectMessage");
00063   add_messageinfo("RenameObjectMessage");
00064   unsigned char tmp_hash[] = {0x7f, 0x87, 0xdf, 0x38, 0x2b, 0x2d, 0xbe, 0x36, 0x88, 0x5a, 0xf7, 0x95, 0x15, 0xb4, 0x1b, 0xaa};
00065   set_hash(tmp_hash);
00066 }
00067 
00068 /** Destructor */
00069 OpenRaveInterface::~OpenRaveInterface()
00070 {
00071   free(data_ptr);
00072 }
00073 /* Methods */
00074 /** Get msgid value.
00075  * The ID of the message that is currently being
00076       processed, or 0 if no message is being processed.
00077  * @return msgid value
00078  */
00079 uint32_t
00080 OpenRaveInterface::msgid() const
00081 {
00082   return data->msgid;
00083 }
00084 
00085 /** Get maximum length of msgid value.
00086  * @return length of msgid value, can be length of the array or number of 
00087  * maximum number of characters for a string
00088  */
00089 size_t
00090 OpenRaveInterface::maxlenof_msgid() const
00091 {
00092   return 1;
00093 }
00094 
00095 /** Set msgid value.
00096  * The ID of the message that is currently being
00097       processed, or 0 if no message is being processed.
00098  * @param new_msgid new msgid value
00099  */
00100 void
00101 OpenRaveInterface::set_msgid(const uint32_t new_msgid)
00102 {
00103   data->msgid = new_msgid;
00104   data_changed = true;
00105 }
00106 
00107 /** Get final value.
00108  * True, if the last goto command has been finished,
00109       false if it is still running
00110  * @return final value
00111  */
00112 bool
00113 OpenRaveInterface::is_final() const
00114 {
00115   return data->final;
00116 }
00117 
00118 /** Get maximum length of final value.
00119  * @return length of final value, can be length of the array or number of 
00120  * maximum number of characters for a string
00121  */
00122 size_t
00123 OpenRaveInterface::maxlenof_final() const
00124 {
00125   return 1;
00126 }
00127 
00128 /** Set final value.
00129  * True, if the last goto command has been finished,
00130       false if it is still running
00131  * @param new_final new final value
00132  */
00133 void
00134 OpenRaveInterface::set_final(const bool new_final)
00135 {
00136   data->final = new_final;
00137   data_changed = true;
00138 }
00139 
00140 /** Get error_code value.
00141  * Failure code set if
00142       final is true. 0 if no error occured, an error code from ERROR_*
00143       constants otherwise (or a bit-wise combination).
00144  * @return error_code value
00145  */
00146 uint32_t
00147 OpenRaveInterface::error_code() const
00148 {
00149   return data->error_code;
00150 }
00151 
00152 /** Get maximum length of error_code value.
00153  * @return length of error_code value, can be length of the array or number of 
00154  * maximum number of characters for a string
00155  */
00156 size_t
00157 OpenRaveInterface::maxlenof_error_code() const
00158 {
00159   return 1;
00160 }
00161 
00162 /** Set error_code value.
00163  * Failure code set if
00164       final is true. 0 if no error occured, an error code from ERROR_*
00165       constants otherwise (or a bit-wise combination).
00166  * @param new_error_code new error_code value
00167  */
00168 void
00169 OpenRaveInterface::set_error_code(const uint32_t new_error_code)
00170 {
00171   data->error_code = new_error_code;
00172   data_changed = true;
00173 }
00174 
00175 /** Get success value.
00176  * True, if last command was successful. False otherwise
00177  * @return success value
00178  */
00179 bool
00180 OpenRaveInterface::is_success() const
00181 {
00182   return data->success;
00183 }
00184 
00185 /** Get maximum length of success value.
00186  * @return length of success value, can be length of the array or number of 
00187  * maximum number of characters for a string
00188  */
00189 size_t
00190 OpenRaveInterface::maxlenof_success() const
00191 {
00192   return 1;
00193 }
00194 
00195 /** Set success value.
00196  * True, if last command was successful. False otherwise
00197  * @param new_success new success value
00198  */
00199 void
00200 OpenRaveInterface::set_success(const bool new_success)
00201 {
00202   data->success = new_success;
00203   data_changed = true;
00204 }
00205 
00206 /* =========== message create =========== */
00207 Message *
00208 OpenRaveInterface::create_message(const char *type) const
00209 {
00210   if ( strncmp("AddObjectMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
00211     return new AddObjectMessage();
00212   } else if ( strncmp("DeleteObjectMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
00213     return new DeleteObjectMessage();
00214   } else if ( strncmp("AttachObjectMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
00215     return new AttachObjectMessage();
00216   } else if ( strncmp("ReleaseObjectMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
00217     return new ReleaseObjectMessage();
00218   } else if ( strncmp("ReleaseAllObjectsMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
00219     return new ReleaseAllObjectsMessage();
00220   } else if ( strncmp("MoveObjectMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
00221     return new MoveObjectMessage();
00222   } else if ( strncmp("RotateObjectQuatMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
00223     return new RotateObjectQuatMessage();
00224   } else if ( strncmp("RotateObjectMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
00225     return new RotateObjectMessage();
00226   } else if ( strncmp("RenameObjectMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
00227     return new RenameObjectMessage();
00228   } else {
00229     throw UnknownTypeException("The given type '%s' does not match any known "
00230                                "message type for this interface type.", type);
00231   }
00232 }
00233 
00234 
00235 /** Copy values from other interface.
00236  * @param other other interface to copy values from
00237  */
00238 void
00239 OpenRaveInterface::copy_values(const Interface *other)
00240 {
00241   const OpenRaveInterface *oi = dynamic_cast<const OpenRaveInterface *>(other);
00242   if (oi == NULL) {
00243     throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
00244                                 type(), other->type());
00245   }
00246   memcpy(data, oi->data, sizeof(OpenRaveInterface_data_t));
00247 }
00248 
00249 const char *
00250 OpenRaveInterface::enum_tostring(const char *enumtype, int val) const
00251 {
00252   throw UnknownTypeException("Unknown enum type %s", enumtype);
00253 }
00254 
00255 /* =========== messages =========== */
00256 /** @class OpenRaveInterface::AddObjectMessage <interfaces/OpenRaveInterface.h>
00257  * AddObjectMessage Fawkes BlackBoard Interface Message.
00258  * 
00259     
00260  */
00261 
00262 
00263 /** Constructor with initial values.
00264  * @param ini_name initial value for name
00265  * @param ini_path initial value for path
00266  */
00267 OpenRaveInterface::AddObjectMessage::AddObjectMessage(const char * ini_name, const char * ini_path) : Message("AddObjectMessage")
00268 {
00269   data_size = sizeof(AddObjectMessage_data_t);
00270   data_ptr  = malloc(data_size);
00271   memset(data_ptr, 0, data_size);
00272   data      = (AddObjectMessage_data_t *)data_ptr;
00273   data_ts   = (message_data_ts_t *)data_ptr;
00274   strncpy(data->name, ini_name, 30);
00275   strncpy(data->path, ini_path, 1024);
00276   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00277   add_fieldinfo(IFT_STRING, "path", 1024, data->path);
00278 }
00279 /** Constructor */
00280 OpenRaveInterface::AddObjectMessage::AddObjectMessage() : Message("AddObjectMessage")
00281 {
00282   data_size = sizeof(AddObjectMessage_data_t);
00283   data_ptr  = malloc(data_size);
00284   memset(data_ptr, 0, data_size);
00285   data      = (AddObjectMessage_data_t *)data_ptr;
00286   data_ts   = (message_data_ts_t *)data_ptr;
00287   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00288   add_fieldinfo(IFT_STRING, "path", 1024, data->path);
00289 }
00290 
00291 /** Destructor */
00292 OpenRaveInterface::AddObjectMessage::~AddObjectMessage()
00293 {
00294   free(data_ptr);
00295 }
00296 
00297 /** Copy constructor.
00298  * @param m message to copy from
00299  */
00300 OpenRaveInterface::AddObjectMessage::AddObjectMessage(const AddObjectMessage *m) : Message("AddObjectMessage")
00301 {
00302   data_size = m->data_size;
00303   data_ptr  = malloc(data_size);
00304   memcpy(data_ptr, m->data_ptr, data_size);
00305   data      = (AddObjectMessage_data_t *)data_ptr;
00306   data_ts   = (message_data_ts_t *)data_ptr;
00307 }
00308 
00309 /* Methods */
00310 /** Get name value.
00311  * Name of object
00312  * @return name value
00313  */
00314 char *
00315 OpenRaveInterface::AddObjectMessage::name() const
00316 {
00317   return data->name;
00318 }
00319 
00320 /** Get maximum length of name value.
00321  * @return length of name value, can be length of the array or number of 
00322  * maximum number of characters for a string
00323  */
00324 size_t
00325 OpenRaveInterface::AddObjectMessage::maxlenof_name() const
00326 {
00327   return 30;
00328 }
00329 
00330 /** Set name value.
00331  * Name of object
00332  * @param new_name new name value
00333  */
00334 void
00335 OpenRaveInterface::AddObjectMessage::set_name(const char * new_name)
00336 {
00337   strncpy(data->name, new_name, sizeof(data->name));
00338 }
00339 
00340 /** Get path value.
00341  * Path to object xml file
00342  * @return path value
00343  */
00344 char *
00345 OpenRaveInterface::AddObjectMessage::path() const
00346 {
00347   return data->path;
00348 }
00349 
00350 /** Get maximum length of path value.
00351  * @return length of path value, can be length of the array or number of 
00352  * maximum number of characters for a string
00353  */
00354 size_t
00355 OpenRaveInterface::AddObjectMessage::maxlenof_path() const
00356 {
00357   return 1024;
00358 }
00359 
00360 /** Set path value.
00361  * Path to object xml file
00362  * @param new_path new path value
00363  */
00364 void
00365 OpenRaveInterface::AddObjectMessage::set_path(const char * new_path)
00366 {
00367   strncpy(data->path, new_path, sizeof(data->path));
00368 }
00369 
00370 /** Clone this message.
00371  * Produces a message of the same type as this message and copies the
00372  * data to the new message.
00373  * @return clone of this message
00374  */
00375 Message *
00376 OpenRaveInterface::AddObjectMessage::clone() const
00377 {
00378   return new OpenRaveInterface::AddObjectMessage(this);
00379 }
00380 /** @class OpenRaveInterface::DeleteObjectMessage <interfaces/OpenRaveInterface.h>
00381  * DeleteObjectMessage Fawkes BlackBoard Interface Message.
00382  * 
00383     
00384  */
00385 
00386 
00387 /** Constructor with initial values.
00388  * @param ini_name initial value for name
00389  */
00390 OpenRaveInterface::DeleteObjectMessage::DeleteObjectMessage(const char * ini_name) : Message("DeleteObjectMessage")
00391 {
00392   data_size = sizeof(DeleteObjectMessage_data_t);
00393   data_ptr  = malloc(data_size);
00394   memset(data_ptr, 0, data_size);
00395   data      = (DeleteObjectMessage_data_t *)data_ptr;
00396   data_ts   = (message_data_ts_t *)data_ptr;
00397   strncpy(data->name, ini_name, 30);
00398   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00399 }
00400 /** Constructor */
00401 OpenRaveInterface::DeleteObjectMessage::DeleteObjectMessage() : Message("DeleteObjectMessage")
00402 {
00403   data_size = sizeof(DeleteObjectMessage_data_t);
00404   data_ptr  = malloc(data_size);
00405   memset(data_ptr, 0, data_size);
00406   data      = (DeleteObjectMessage_data_t *)data_ptr;
00407   data_ts   = (message_data_ts_t *)data_ptr;
00408   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00409 }
00410 
00411 /** Destructor */
00412 OpenRaveInterface::DeleteObjectMessage::~DeleteObjectMessage()
00413 {
00414   free(data_ptr);
00415 }
00416 
00417 /** Copy constructor.
00418  * @param m message to copy from
00419  */
00420 OpenRaveInterface::DeleteObjectMessage::DeleteObjectMessage(const DeleteObjectMessage *m) : Message("DeleteObjectMessage")
00421 {
00422   data_size = m->data_size;
00423   data_ptr  = malloc(data_size);
00424   memcpy(data_ptr, m->data_ptr, data_size);
00425   data      = (DeleteObjectMessage_data_t *)data_ptr;
00426   data_ts   = (message_data_ts_t *)data_ptr;
00427 }
00428 
00429 /* Methods */
00430 /** Get name value.
00431  * Name of object
00432  * @return name value
00433  */
00434 char *
00435 OpenRaveInterface::DeleteObjectMessage::name() const
00436 {
00437   return data->name;
00438 }
00439 
00440 /** Get maximum length of name value.
00441  * @return length of name value, can be length of the array or number of 
00442  * maximum number of characters for a string
00443  */
00444 size_t
00445 OpenRaveInterface::DeleteObjectMessage::maxlenof_name() const
00446 {
00447   return 30;
00448 }
00449 
00450 /** Set name value.
00451  * Name of object
00452  * @param new_name new name value
00453  */
00454 void
00455 OpenRaveInterface::DeleteObjectMessage::set_name(const char * new_name)
00456 {
00457   strncpy(data->name, new_name, sizeof(data->name));
00458 }
00459 
00460 /** Clone this message.
00461  * Produces a message of the same type as this message and copies the
00462  * data to the new message.
00463  * @return clone of this message
00464  */
00465 Message *
00466 OpenRaveInterface::DeleteObjectMessage::clone() const
00467 {
00468   return new OpenRaveInterface::DeleteObjectMessage(this);
00469 }
00470 /** @class OpenRaveInterface::AttachObjectMessage <interfaces/OpenRaveInterface.h>
00471  * AttachObjectMessage Fawkes BlackBoard Interface Message.
00472  * 
00473     
00474  */
00475 
00476 
00477 /** Constructor with initial values.
00478  * @param ini_name initial value for name
00479  */
00480 OpenRaveInterface::AttachObjectMessage::AttachObjectMessage(const char * ini_name) : Message("AttachObjectMessage")
00481 {
00482   data_size = sizeof(AttachObjectMessage_data_t);
00483   data_ptr  = malloc(data_size);
00484   memset(data_ptr, 0, data_size);
00485   data      = (AttachObjectMessage_data_t *)data_ptr;
00486   data_ts   = (message_data_ts_t *)data_ptr;
00487   strncpy(data->name, ini_name, 30);
00488   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00489 }
00490 /** Constructor */
00491 OpenRaveInterface::AttachObjectMessage::AttachObjectMessage() : Message("AttachObjectMessage")
00492 {
00493   data_size = sizeof(AttachObjectMessage_data_t);
00494   data_ptr  = malloc(data_size);
00495   memset(data_ptr, 0, data_size);
00496   data      = (AttachObjectMessage_data_t *)data_ptr;
00497   data_ts   = (message_data_ts_t *)data_ptr;
00498   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00499 }
00500 
00501 /** Destructor */
00502 OpenRaveInterface::AttachObjectMessage::~AttachObjectMessage()
00503 {
00504   free(data_ptr);
00505 }
00506 
00507 /** Copy constructor.
00508  * @param m message to copy from
00509  */
00510 OpenRaveInterface::AttachObjectMessage::AttachObjectMessage(const AttachObjectMessage *m) : Message("AttachObjectMessage")
00511 {
00512   data_size = m->data_size;
00513   data_ptr  = malloc(data_size);
00514   memcpy(data_ptr, m->data_ptr, data_size);
00515   data      = (AttachObjectMessage_data_t *)data_ptr;
00516   data_ts   = (message_data_ts_t *)data_ptr;
00517 }
00518 
00519 /* Methods */
00520 /** Get name value.
00521  * Name of object
00522  * @return name value
00523  */
00524 char *
00525 OpenRaveInterface::AttachObjectMessage::name() const
00526 {
00527   return data->name;
00528 }
00529 
00530 /** Get maximum length of name value.
00531  * @return length of name value, can be length of the array or number of 
00532  * maximum number of characters for a string
00533  */
00534 size_t
00535 OpenRaveInterface::AttachObjectMessage::maxlenof_name() const
00536 {
00537   return 30;
00538 }
00539 
00540 /** Set name value.
00541  * Name of object
00542  * @param new_name new name value
00543  */
00544 void
00545 OpenRaveInterface::AttachObjectMessage::set_name(const char * new_name)
00546 {
00547   strncpy(data->name, new_name, sizeof(data->name));
00548 }
00549 
00550 /** Clone this message.
00551  * Produces a message of the same type as this message and copies the
00552  * data to the new message.
00553  * @return clone of this message
00554  */
00555 Message *
00556 OpenRaveInterface::AttachObjectMessage::clone() const
00557 {
00558   return new OpenRaveInterface::AttachObjectMessage(this);
00559 }
00560 /** @class OpenRaveInterface::ReleaseObjectMessage <interfaces/OpenRaveInterface.h>
00561  * ReleaseObjectMessage Fawkes BlackBoard Interface Message.
00562  * 
00563     
00564  */
00565 
00566 
00567 /** Constructor with initial values.
00568  * @param ini_name initial value for name
00569  */
00570 OpenRaveInterface::ReleaseObjectMessage::ReleaseObjectMessage(const char * ini_name) : Message("ReleaseObjectMessage")
00571 {
00572   data_size = sizeof(ReleaseObjectMessage_data_t);
00573   data_ptr  = malloc(data_size);
00574   memset(data_ptr, 0, data_size);
00575   data      = (ReleaseObjectMessage_data_t *)data_ptr;
00576   data_ts   = (message_data_ts_t *)data_ptr;
00577   strncpy(data->name, ini_name, 30);
00578   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00579 }
00580 /** Constructor */
00581 OpenRaveInterface::ReleaseObjectMessage::ReleaseObjectMessage() : Message("ReleaseObjectMessage")
00582 {
00583   data_size = sizeof(ReleaseObjectMessage_data_t);
00584   data_ptr  = malloc(data_size);
00585   memset(data_ptr, 0, data_size);
00586   data      = (ReleaseObjectMessage_data_t *)data_ptr;
00587   data_ts   = (message_data_ts_t *)data_ptr;
00588   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00589 }
00590 
00591 /** Destructor */
00592 OpenRaveInterface::ReleaseObjectMessage::~ReleaseObjectMessage()
00593 {
00594   free(data_ptr);
00595 }
00596 
00597 /** Copy constructor.
00598  * @param m message to copy from
00599  */
00600 OpenRaveInterface::ReleaseObjectMessage::ReleaseObjectMessage(const ReleaseObjectMessage *m) : Message("ReleaseObjectMessage")
00601 {
00602   data_size = m->data_size;
00603   data_ptr  = malloc(data_size);
00604   memcpy(data_ptr, m->data_ptr, data_size);
00605   data      = (ReleaseObjectMessage_data_t *)data_ptr;
00606   data_ts   = (message_data_ts_t *)data_ptr;
00607 }
00608 
00609 /* Methods */
00610 /** Get name value.
00611  * Name of object
00612  * @return name value
00613  */
00614 char *
00615 OpenRaveInterface::ReleaseObjectMessage::name() const
00616 {
00617   return data->name;
00618 }
00619 
00620 /** Get maximum length of name value.
00621  * @return length of name value, can be length of the array or number of 
00622  * maximum number of characters for a string
00623  */
00624 size_t
00625 OpenRaveInterface::ReleaseObjectMessage::maxlenof_name() const
00626 {
00627   return 30;
00628 }
00629 
00630 /** Set name value.
00631  * Name of object
00632  * @param new_name new name value
00633  */
00634 void
00635 OpenRaveInterface::ReleaseObjectMessage::set_name(const char * new_name)
00636 {
00637   strncpy(data->name, new_name, sizeof(data->name));
00638 }
00639 
00640 /** Clone this message.
00641  * Produces a message of the same type as this message and copies the
00642  * data to the new message.
00643  * @return clone of this message
00644  */
00645 Message *
00646 OpenRaveInterface::ReleaseObjectMessage::clone() const
00647 {
00648   return new OpenRaveInterface::ReleaseObjectMessage(this);
00649 }
00650 /** @class OpenRaveInterface::ReleaseAllObjectsMessage <interfaces/OpenRaveInterface.h>
00651  * ReleaseAllObjectsMessage Fawkes BlackBoard Interface Message.
00652  * 
00653     
00654  */
00655 
00656 
00657 /** Constructor */
00658 OpenRaveInterface::ReleaseAllObjectsMessage::ReleaseAllObjectsMessage() : Message("ReleaseAllObjectsMessage")
00659 {
00660   data_size = sizeof(ReleaseAllObjectsMessage_data_t);
00661   data_ptr  = malloc(data_size);
00662   memset(data_ptr, 0, data_size);
00663   data      = (ReleaseAllObjectsMessage_data_t *)data_ptr;
00664   data_ts   = (message_data_ts_t *)data_ptr;
00665 }
00666 
00667 /** Destructor */
00668 OpenRaveInterface::ReleaseAllObjectsMessage::~ReleaseAllObjectsMessage()
00669 {
00670   free(data_ptr);
00671 }
00672 
00673 /** Copy constructor.
00674  * @param m message to copy from
00675  */
00676 OpenRaveInterface::ReleaseAllObjectsMessage::ReleaseAllObjectsMessage(const ReleaseAllObjectsMessage *m) : Message("ReleaseAllObjectsMessage")
00677 {
00678   data_size = m->data_size;
00679   data_ptr  = malloc(data_size);
00680   memcpy(data_ptr, m->data_ptr, data_size);
00681   data      = (ReleaseAllObjectsMessage_data_t *)data_ptr;
00682   data_ts   = (message_data_ts_t *)data_ptr;
00683 }
00684 
00685 /* Methods */
00686 /** Clone this message.
00687  * Produces a message of the same type as this message and copies the
00688  * data to the new message.
00689  * @return clone of this message
00690  */
00691 Message *
00692 OpenRaveInterface::ReleaseAllObjectsMessage::clone() const
00693 {
00694   return new OpenRaveInterface::ReleaseAllObjectsMessage(this);
00695 }
00696 /** @class OpenRaveInterface::MoveObjectMessage <interfaces/OpenRaveInterface.h>
00697  * MoveObjectMessage Fawkes BlackBoard Interface Message.
00698  * 
00699     
00700  */
00701 
00702 
00703 /** Constructor with initial values.
00704  * @param ini_name initial value for name
00705  * @param ini_x initial value for x
00706  * @param ini_y initial value for y
00707  * @param ini_z initial value for z
00708  */
00709 OpenRaveInterface::MoveObjectMessage::MoveObjectMessage(const char * ini_name, const float ini_x, const float ini_y, const float ini_z) : Message("MoveObjectMessage")
00710 {
00711   data_size = sizeof(MoveObjectMessage_data_t);
00712   data_ptr  = malloc(data_size);
00713   memset(data_ptr, 0, data_size);
00714   data      = (MoveObjectMessage_data_t *)data_ptr;
00715   data_ts   = (message_data_ts_t *)data_ptr;
00716   strncpy(data->name, ini_name, 30);
00717   data->x = ini_x;
00718   data->y = ini_y;
00719   data->z = ini_z;
00720   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00721   add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
00722   add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
00723   add_fieldinfo(IFT_FLOAT, "z", 1, &data->z);
00724 }
00725 /** Constructor */
00726 OpenRaveInterface::MoveObjectMessage::MoveObjectMessage() : Message("MoveObjectMessage")
00727 {
00728   data_size = sizeof(MoveObjectMessage_data_t);
00729   data_ptr  = malloc(data_size);
00730   memset(data_ptr, 0, data_size);
00731   data      = (MoveObjectMessage_data_t *)data_ptr;
00732   data_ts   = (message_data_ts_t *)data_ptr;
00733   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00734   add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
00735   add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
00736   add_fieldinfo(IFT_FLOAT, "z", 1, &data->z);
00737 }
00738 
00739 /** Destructor */
00740 OpenRaveInterface::MoveObjectMessage::~MoveObjectMessage()
00741 {
00742   free(data_ptr);
00743 }
00744 
00745 /** Copy constructor.
00746  * @param m message to copy from
00747  */
00748 OpenRaveInterface::MoveObjectMessage::MoveObjectMessage(const MoveObjectMessage *m) : Message("MoveObjectMessage")
00749 {
00750   data_size = m->data_size;
00751   data_ptr  = malloc(data_size);
00752   memcpy(data_ptr, m->data_ptr, data_size);
00753   data      = (MoveObjectMessage_data_t *)data_ptr;
00754   data_ts   = (message_data_ts_t *)data_ptr;
00755 }
00756 
00757 /* Methods */
00758 /** Get name value.
00759  * Name of object
00760  * @return name value
00761  */
00762 char *
00763 OpenRaveInterface::MoveObjectMessage::name() const
00764 {
00765   return data->name;
00766 }
00767 
00768 /** Get maximum length of name value.
00769  * @return length of name value, can be length of the array or number of 
00770  * maximum number of characters for a string
00771  */
00772 size_t
00773 OpenRaveInterface::MoveObjectMessage::maxlenof_name() const
00774 {
00775   return 30;
00776 }
00777 
00778 /** Set name value.
00779  * Name of object
00780  * @param new_name new name value
00781  */
00782 void
00783 OpenRaveInterface::MoveObjectMessage::set_name(const char * new_name)
00784 {
00785   strncpy(data->name, new_name, sizeof(data->name));
00786 }
00787 
00788 /** Get x value.
00789  * x position of object (meters)
00790  * @return x value
00791  */
00792 float
00793 OpenRaveInterface::MoveObjectMessage::x() const
00794 {
00795   return data->x;
00796 }
00797 
00798 /** Get maximum length of x value.
00799  * @return length of x value, can be length of the array or number of 
00800  * maximum number of characters for a string
00801  */
00802 size_t
00803 OpenRaveInterface::MoveObjectMessage::maxlenof_x() const
00804 {
00805   return 1;
00806 }
00807 
00808 /** Set x value.
00809  * x position of object (meters)
00810  * @param new_x new x value
00811  */
00812 void
00813 OpenRaveInterface::MoveObjectMessage::set_x(const float new_x)
00814 {
00815   data->x = new_x;
00816 }
00817 
00818 /** Get y value.
00819  * y position of object (meters)
00820  * @return y value
00821  */
00822 float
00823 OpenRaveInterface::MoveObjectMessage::y() const
00824 {
00825   return data->y;
00826 }
00827 
00828 /** Get maximum length of y value.
00829  * @return length of y value, can be length of the array or number of 
00830  * maximum number of characters for a string
00831  */
00832 size_t
00833 OpenRaveInterface::MoveObjectMessage::maxlenof_y() const
00834 {
00835   return 1;
00836 }
00837 
00838 /** Set y value.
00839  * y position of object (meters)
00840  * @param new_y new y value
00841  */
00842 void
00843 OpenRaveInterface::MoveObjectMessage::set_y(const float new_y)
00844 {
00845   data->y = new_y;
00846 }
00847 
00848 /** Get z value.
00849  * z position of object (meters)
00850  * @return z value
00851  */
00852 float
00853 OpenRaveInterface::MoveObjectMessage::z() const
00854 {
00855   return data->z;
00856 }
00857 
00858 /** Get maximum length of z value.
00859  * @return length of z value, can be length of the array or number of 
00860  * maximum number of characters for a string
00861  */
00862 size_t
00863 OpenRaveInterface::MoveObjectMessage::maxlenof_z() const
00864 {
00865   return 1;
00866 }
00867 
00868 /** Set z value.
00869  * z position of object (meters)
00870  * @param new_z new z value
00871  */
00872 void
00873 OpenRaveInterface::MoveObjectMessage::set_z(const float new_z)
00874 {
00875   data->z = new_z;
00876 }
00877 
00878 /** Clone this message.
00879  * Produces a message of the same type as this message and copies the
00880  * data to the new message.
00881  * @return clone of this message
00882  */
00883 Message *
00884 OpenRaveInterface::MoveObjectMessage::clone() const
00885 {
00886   return new OpenRaveInterface::MoveObjectMessage(this);
00887 }
00888 /** @class OpenRaveInterface::RotateObjectQuatMessage <interfaces/OpenRaveInterface.h>
00889  * RotateObjectQuatMessage Fawkes BlackBoard Interface Message.
00890  * 
00891     
00892  */
00893 
00894 
00895 /** Constructor with initial values.
00896  * @param ini_name initial value for name
00897  * @param ini_x initial value for x
00898  * @param ini_y initial value for y
00899  * @param ini_z initial value for z
00900  * @param ini_w initial value for w
00901  */
00902 OpenRaveInterface::RotateObjectQuatMessage::RotateObjectQuatMessage(const char * ini_name, const float ini_x, const float ini_y, const float ini_z, const float ini_w) : Message("RotateObjectQuatMessage")
00903 {
00904   data_size = sizeof(RotateObjectQuatMessage_data_t);
00905   data_ptr  = malloc(data_size);
00906   memset(data_ptr, 0, data_size);
00907   data      = (RotateObjectQuatMessage_data_t *)data_ptr;
00908   data_ts   = (message_data_ts_t *)data_ptr;
00909   strncpy(data->name, ini_name, 30);
00910   data->x = ini_x;
00911   data->y = ini_y;
00912   data->z = ini_z;
00913   data->w = ini_w;
00914   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00915   add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
00916   add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
00917   add_fieldinfo(IFT_FLOAT, "z", 1, &data->z);
00918   add_fieldinfo(IFT_FLOAT, "w", 1, &data->w);
00919 }
00920 /** Constructor */
00921 OpenRaveInterface::RotateObjectQuatMessage::RotateObjectQuatMessage() : Message("RotateObjectQuatMessage")
00922 {
00923   data_size = sizeof(RotateObjectQuatMessage_data_t);
00924   data_ptr  = malloc(data_size);
00925   memset(data_ptr, 0, data_size);
00926   data      = (RotateObjectQuatMessage_data_t *)data_ptr;
00927   data_ts   = (message_data_ts_t *)data_ptr;
00928   add_fieldinfo(IFT_STRING, "name", 30, data->name);
00929   add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
00930   add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
00931   add_fieldinfo(IFT_FLOAT, "z", 1, &data->z);
00932   add_fieldinfo(IFT_FLOAT, "w", 1, &data->w);
00933 }
00934 
00935 /** Destructor */
00936 OpenRaveInterface::RotateObjectQuatMessage::~RotateObjectQuatMessage()
00937 {
00938   free(data_ptr);
00939 }
00940 
00941 /** Copy constructor.
00942  * @param m message to copy from
00943  */
00944 OpenRaveInterface::RotateObjectQuatMessage::RotateObjectQuatMessage(const RotateObjectQuatMessage *m) : Message("RotateObjectQuatMessage")
00945 {
00946   data_size = m->data_size;
00947   data_ptr  = malloc(data_size);
00948   memcpy(data_ptr, m->data_ptr, data_size);
00949   data      = (RotateObjectQuatMessage_data_t *)data_ptr;
00950   data_ts   = (message_data_ts_t *)data_ptr;
00951 }
00952 
00953 /* Methods */
00954 /** Get name value.
00955  * Name of object
00956  * @return name value
00957  */
00958 char *
00959 OpenRaveInterface::RotateObjectQuatMessage::name() const
00960 {
00961   return data->name;
00962 }
00963 
00964 /** Get maximum length of name value.
00965  * @return length of name value, can be length of the array or number of 
00966  * maximum number of characters for a string
00967  */
00968 size_t
00969 OpenRaveInterface::RotateObjectQuatMessage::maxlenof_name() const
00970 {
00971   return 30;
00972 }
00973 
00974 /** Set name value.
00975  * Name of object
00976  * @param new_name new name value
00977  */
00978 void
00979 OpenRaveInterface::RotateObjectQuatMessage::set_name(const char * new_name)
00980 {
00981   strncpy(data->name, new_name, sizeof(data->name));
00982 }
00983 
00984 /** Get x value.
00985  * x value of quaternion
00986  * @return x value
00987  */
00988 float
00989 OpenRaveInterface::RotateObjectQuatMessage::x() const
00990 {
00991   return data->x;
00992 }
00993 
00994 /** Get maximum length of x value.
00995  * @return length of x value, can be length of the array or number of 
00996  * maximum number of characters for a string
00997  */
00998 size_t
00999 OpenRaveInterface::RotateObjectQuatMessage::maxlenof_x() const
01000 {
01001   return 1;
01002 }
01003 
01004 /** Set x value.
01005  * x value of quaternion
01006  * @param new_x new x value
01007  */
01008 void
01009 OpenRaveInterface::RotateObjectQuatMessage::set_x(const float new_x)
01010 {
01011   data->x = new_x;
01012 }
01013 
01014 /** Get y value.
01015  * y value of quaternion
01016  * @return y value
01017  */
01018 float
01019 OpenRaveInterface::RotateObjectQuatMessage::y() const
01020 {
01021   return data->y;
01022 }
01023 
01024 /** Get maximum length of y value.
01025  * @return length of y value, can be length of the array or number of 
01026  * maximum number of characters for a string
01027  */
01028 size_t
01029 OpenRaveInterface::RotateObjectQuatMessage::maxlenof_y() const
01030 {
01031   return 1;
01032 }
01033 
01034 /** Set y value.
01035  * y value of quaternion
01036  * @param new_y new y value
01037  */
01038 void
01039 OpenRaveInterface::RotateObjectQuatMessage::set_y(const float new_y)
01040 {
01041   data->y = new_y;
01042 }
01043 
01044 /** Get z value.
01045  * z value of quaternion
01046  * @return z value
01047  */
01048 float
01049 OpenRaveInterface::RotateObjectQuatMessage::z() const
01050 {
01051   return data->z;
01052 }
01053 
01054 /** Get maximum length of z value.
01055  * @return length of z value, can be length of the array or number of 
01056  * maximum number of characters for a string
01057  */
01058 size_t
01059 OpenRaveInterface::RotateObjectQuatMessage::maxlenof_z() const
01060 {
01061   return 1;
01062 }
01063 
01064 /** Set z value.
01065  * z value of quaternion
01066  * @param new_z new z value
01067  */
01068 void
01069 OpenRaveInterface::RotateObjectQuatMessage::set_z(const float new_z)
01070 {
01071   data->z = new_z;
01072 }
01073 
01074 /** Get w value.
01075  * w value of quaternion
01076  * @return w value
01077  */
01078 float
01079 OpenRaveInterface::RotateObjectQuatMessage::w() const
01080 {
01081   return data->w;
01082 }
01083 
01084 /** Get maximum length of w value.
01085  * @return length of w value, can be length of the array or number of 
01086  * maximum number of characters for a string
01087  */
01088 size_t
01089 OpenRaveInterface::RotateObjectQuatMessage::maxlenof_w() const
01090 {
01091   return 1;
01092 }
01093 
01094 /** Set w value.
01095  * w value of quaternion
01096  * @param new_w new w value
01097  */
01098 void
01099 OpenRaveInterface::RotateObjectQuatMessage::set_w(const float new_w)
01100 {
01101   data->w = new_w;
01102 }
01103 
01104 /** Clone this message.
01105  * Produces a message of the same type as this message and copies the
01106  * data to the new message.
01107  * @return clone of this message
01108  */
01109 Message *
01110 OpenRaveInterface::RotateObjectQuatMessage::clone() const
01111 {
01112   return new OpenRaveInterface::RotateObjectQuatMessage(this);
01113 }
01114 /** @class OpenRaveInterface::RotateObjectMessage <interfaces/OpenRaveInterface.h>
01115  * RotateObjectMessage Fawkes BlackBoard Interface Message.
01116  * 
01117     
01118  */
01119 
01120 
01121 /** Constructor with initial values.
01122  * @param ini_name initial value for name
01123  * @param ini_x initial value for x
01124  * @param ini_y initial value for y
01125  * @param ini_z initial value for z
01126  */
01127 OpenRaveInterface::RotateObjectMessage::RotateObjectMessage(const char * ini_name, const float ini_x, const float ini_y, const float ini_z) : Message("RotateObjectMessage")
01128 {
01129   data_size = sizeof(RotateObjectMessage_data_t);
01130   data_ptr  = malloc(data_size);
01131   memset(data_ptr, 0, data_size);
01132   data      = (RotateObjectMessage_data_t *)data_ptr;
01133   data_ts   = (message_data_ts_t *)data_ptr;
01134   strncpy(data->name, ini_name, 30);
01135   data->x = ini_x;
01136   data->y = ini_y;
01137   data->z = ini_z;
01138   add_fieldinfo(IFT_STRING, "name", 30, data->name);
01139   add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
01140   add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
01141   add_fieldinfo(IFT_FLOAT, "z", 1, &data->z);
01142 }
01143 /** Constructor */
01144 OpenRaveInterface::RotateObjectMessage::RotateObjectMessage() : Message("RotateObjectMessage")
01145 {
01146   data_size = sizeof(RotateObjectMessage_data_t);
01147   data_ptr  = malloc(data_size);
01148   memset(data_ptr, 0, data_size);
01149   data      = (RotateObjectMessage_data_t *)data_ptr;
01150   data_ts   = (message_data_ts_t *)data_ptr;
01151   add_fieldinfo(IFT_STRING, "name", 30, data->name);
01152   add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
01153   add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
01154   add_fieldinfo(IFT_FLOAT, "z", 1, &data->z);
01155 }
01156 
01157 /** Destructor */
01158 OpenRaveInterface::RotateObjectMessage::~RotateObjectMessage()
01159 {
01160   free(data_ptr);
01161 }
01162 
01163 /** Copy constructor.
01164  * @param m message to copy from
01165  */
01166 OpenRaveInterface::RotateObjectMessage::RotateObjectMessage(const RotateObjectMessage *m) : Message("RotateObjectMessage")
01167 {
01168   data_size = m->data_size;
01169   data_ptr  = malloc(data_size);
01170   memcpy(data_ptr, m->data_ptr, data_size);
01171   data      = (RotateObjectMessage_data_t *)data_ptr;
01172   data_ts   = (message_data_ts_t *)data_ptr;
01173 }
01174 
01175 /* Methods */
01176 /** Get name value.
01177  * Name of object
01178  * @return name value
01179  */
01180 char *
01181 OpenRaveInterface::RotateObjectMessage::name() const
01182 {
01183   return data->name;
01184 }
01185 
01186 /** Get maximum length of name value.
01187  * @return length of name value, can be length of the array or number of 
01188  * maximum number of characters for a string
01189  */
01190 size_t
01191 OpenRaveInterface::RotateObjectMessage::maxlenof_name() const
01192 {
01193   return 30;
01194 }
01195 
01196 /** Set name value.
01197  * Name of object
01198  * @param new_name new name value
01199  */
01200 void
01201 OpenRaveInterface::RotateObjectMessage::set_name(const char * new_name)
01202 {
01203   strncpy(data->name, new_name, sizeof(data->name));
01204 }
01205 
01206 /** Get x value.
01207  * x-axis rotation of object (rad)
01208  * @return x value
01209  */
01210 float
01211 OpenRaveInterface::RotateObjectMessage::x() const
01212 {
01213   return data->x;
01214 }
01215 
01216 /** Get maximum length of x value.
01217  * @return length of x value, can be length of the array or number of 
01218  * maximum number of characters for a string
01219  */
01220 size_t
01221 OpenRaveInterface::RotateObjectMessage::maxlenof_x() const
01222 {
01223   return 1;
01224 }
01225 
01226 /** Set x value.
01227  * x-axis rotation of object (rad)
01228  * @param new_x new x value
01229  */
01230 void
01231 OpenRaveInterface::RotateObjectMessage::set_x(const float new_x)
01232 {
01233   data->x = new_x;
01234 }
01235 
01236 /** Get y value.
01237  * y-axis rotation of object (rad)
01238  * @return y value
01239  */
01240 float
01241 OpenRaveInterface::RotateObjectMessage::y() const
01242 {
01243   return data->y;
01244 }
01245 
01246 /** Get maximum length of y value.
01247  * @return length of y value, can be length of the array or number of 
01248  * maximum number of characters for a string
01249  */
01250 size_t
01251 OpenRaveInterface::RotateObjectMessage::maxlenof_y() const
01252 {
01253   return 1;
01254 }
01255 
01256 /** Set y value.
01257  * y-axis rotation of object (rad)
01258  * @param new_y new y value
01259  */
01260 void
01261 OpenRaveInterface::RotateObjectMessage::set_y(const float new_y)
01262 {
01263   data->y = new_y;
01264 }
01265 
01266 /** Get z value.
01267  * z-axis rotation of object (rad)
01268  * @return z value
01269  */
01270 float
01271 OpenRaveInterface::RotateObjectMessage::z() const
01272 {
01273   return data->z;
01274 }
01275 
01276 /** Get maximum length of z value.
01277  * @return length of z value, can be length of the array or number of 
01278  * maximum number of characters for a string
01279  */
01280 size_t
01281 OpenRaveInterface::RotateObjectMessage::maxlenof_z() const
01282 {
01283   return 1;
01284 }
01285 
01286 /** Set z value.
01287  * z-axis rotation of object (rad)
01288  * @param new_z new z value
01289  */
01290 void
01291 OpenRaveInterface::RotateObjectMessage::set_z(const float new_z)
01292 {
01293   data->z = new_z;
01294 }
01295 
01296 /** Clone this message.
01297  * Produces a message of the same type as this message and copies the
01298  * data to the new message.
01299  * @return clone of this message
01300  */
01301 Message *
01302 OpenRaveInterface::RotateObjectMessage::clone() const
01303 {
01304   return new OpenRaveInterface::RotateObjectMessage(this);
01305 }
01306 /** @class OpenRaveInterface::RenameObjectMessage <interfaces/OpenRaveInterface.h>
01307  * RenameObjectMessage Fawkes BlackBoard Interface Message.
01308  * 
01309     
01310  */
01311 
01312 
01313 /** Constructor with initial values.
01314  * @param ini_name initial value for name
01315  * @param ini_newName initial value for newName
01316  */
01317 OpenRaveInterface::RenameObjectMessage::RenameObjectMessage(const char * ini_name, const char * ini_newName) : Message("RenameObjectMessage")
01318 {
01319   data_size = sizeof(RenameObjectMessage_data_t);
01320   data_ptr  = malloc(data_size);
01321   memset(data_ptr, 0, data_size);
01322   data      = (RenameObjectMessage_data_t *)data_ptr;
01323   data_ts   = (message_data_ts_t *)data_ptr;
01324   strncpy(data->name, ini_name, 30);
01325   strncpy(data->newName, ini_newName, 30);
01326   add_fieldinfo(IFT_STRING, "name", 30, data->name);
01327   add_fieldinfo(IFT_STRING, "newName", 30, data->newName);
01328 }
01329 /** Constructor */
01330 OpenRaveInterface::RenameObjectMessage::RenameObjectMessage() : Message("RenameObjectMessage")
01331 {
01332   data_size = sizeof(RenameObjectMessage_data_t);
01333   data_ptr  = malloc(data_size);
01334   memset(data_ptr, 0, data_size);
01335   data      = (RenameObjectMessage_data_t *)data_ptr;
01336   data_ts   = (message_data_ts_t *)data_ptr;
01337   add_fieldinfo(IFT_STRING, "name", 30, data->name);
01338   add_fieldinfo(IFT_STRING, "newName", 30, data->newName);
01339 }
01340 
01341 /** Destructor */
01342 OpenRaveInterface::RenameObjectMessage::~RenameObjectMessage()
01343 {
01344   free(data_ptr);
01345 }
01346 
01347 /** Copy constructor.
01348  * @param m message to copy from
01349  */
01350 OpenRaveInterface::RenameObjectMessage::RenameObjectMessage(const RenameObjectMessage *m) : Message("RenameObjectMessage")
01351 {
01352   data_size = m->data_size;
01353   data_ptr  = malloc(data_size);
01354   memcpy(data_ptr, m->data_ptr, data_size);
01355   data      = (RenameObjectMessage_data_t *)data_ptr;
01356   data_ts   = (message_data_ts_t *)data_ptr;
01357 }
01358 
01359 /* Methods */
01360 /** Get name value.
01361  * Name of object
01362  * @return name value
01363  */
01364 char *
01365 OpenRaveInterface::RenameObjectMessage::name() const
01366 {
01367   return data->name;
01368 }
01369 
01370 /** Get maximum length of name value.
01371  * @return length of name value, can be length of the array or number of 
01372  * maximum number of characters for a string
01373  */
01374 size_t
01375 OpenRaveInterface::RenameObjectMessage::maxlenof_name() const
01376 {
01377   return 30;
01378 }
01379 
01380 /** Set name value.
01381  * Name of object
01382  * @param new_name new name value
01383  */
01384 void
01385 OpenRaveInterface::RenameObjectMessage::set_name(const char * new_name)
01386 {
01387   strncpy(data->name, new_name, sizeof(data->name));
01388 }
01389 
01390 /** Get newName value.
01391  * New name of object
01392  * @return newName value
01393  */
01394 char *
01395 OpenRaveInterface::RenameObjectMessage::newName() const
01396 {
01397   return data->newName;
01398 }
01399 
01400 /** Get maximum length of newName value.
01401  * @return length of newName value, can be length of the array or number of 
01402  * maximum number of characters for a string
01403  */
01404 size_t
01405 OpenRaveInterface::RenameObjectMessage::maxlenof_newName() const
01406 {
01407   return 30;
01408 }
01409 
01410 /** Set newName value.
01411  * New name of object
01412  * @param new_newName new newName value
01413  */
01414 void
01415 OpenRaveInterface::RenameObjectMessage::set_newName(const char * new_newName)
01416 {
01417   strncpy(data->newName, new_newName, sizeof(data->newName));
01418 }
01419 
01420 /** Clone this message.
01421  * Produces a message of the same type as this message and copies the
01422  * data to the new message.
01423  * @return clone of this message
01424  */
01425 Message *
01426 OpenRaveInterface::RenameObjectMessage::clone() const
01427 {
01428   return new OpenRaveInterface::RenameObjectMessage(this);
01429 }
01430 /** Check if message is valid and can be enqueued.
01431  * @param message Message to check
01432  * @return true if the message is valid, false otherwise.
01433  */
01434 bool
01435 OpenRaveInterface::message_valid(const Message *message) const
01436 {
01437   const AddObjectMessage *m0 = dynamic_cast<const AddObjectMessage *>(message);
01438   if ( m0 != NULL ) {
01439     return true;
01440   }
01441   const DeleteObjectMessage *m1 = dynamic_cast<const DeleteObjectMessage *>(message);
01442   if ( m1 != NULL ) {
01443     return true;
01444   }
01445   const AttachObjectMessage *m2 = dynamic_cast<const AttachObjectMessage *>(message);
01446   if ( m2 != NULL ) {
01447     return true;
01448   }
01449   const ReleaseObjectMessage *m3 = dynamic_cast<const ReleaseObjectMessage *>(message);
01450   if ( m3 != NULL ) {
01451     return true;
01452   }
01453   const ReleaseAllObjectsMessage *m4 = dynamic_cast<const ReleaseAllObjectsMessage *>(message);
01454   if ( m4 != NULL ) {
01455     return true;
01456   }
01457   const MoveObjectMessage *m5 = dynamic_cast<const MoveObjectMessage *>(message);
01458   if ( m5 != NULL ) {
01459     return true;
01460   }
01461   const RotateObjectQuatMessage *m6 = dynamic_cast<const RotateObjectQuatMessage *>(message);
01462   if ( m6 != NULL ) {
01463     return true;
01464   }
01465   const RotateObjectMessage *m7 = dynamic_cast<const RotateObjectMessage *>(message);
01466   if ( m7 != NULL ) {
01467     return true;
01468   }
01469   const RenameObjectMessage *m8 = dynamic_cast<const RenameObjectMessage *>(message);
01470   if ( m8 != NULL ) {
01471     return true;
01472   }
01473   return false;
01474 }
01475 
01476 /// @cond INTERNALS
01477 EXPORT_INTERFACE(OpenRaveInterface)
01478 /// @endcond
01479 
01480 
01481 } // end namespace fawkes