Changes have been pushed for the project "Fawkes Robotics Software Framework".

Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, common/eclipse-clp-fixes has been updated
        to  5d9d2ad24b708098677c0f1229dcd3d2c2ad4542 (commit)
       via  ec5a248571b7e684692b4b2925c7969844100cef (commit)
      from  aaac7f34e7349fbb4978cc4bf46e70cc8fb4d344 (commit)

http://git.fawkesrobotics.org/fawkes.git/common/eclipse-clp-fixes

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- *Log* ---------------------------------------------------------------
commit ec5a248571b7e684692b4b2925c7969844100cef
Author:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
AuthorDate: Thu Jan 22 18:36:48 2015 +0100
Commit:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
CommitDate: Thu Jan 22 18:38:41 2015 +0100

    eclipse_externals: implement p_bb_get for fields of type byte

http://git.fawkesrobotics.org/fawkes.git/commit/ec5a248
http://trac.fawkesrobotics.org/changeset/ec5a248

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 5d9d2ad24b708098677c0f1229dcd3d2c2ad4542
Author:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
AuthorDate: Thu Jan 22 18:44:03 2015 +0100
Commit:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
CommitDate: Thu Jan 22 18:44:03 2015 +0100

    eclipse_externals: properly handle reference counting for sent messages
    
    Enqueueing a message gives ownership of the message to the other side
    which may dereference the message. We still need the message to return
    its id, thus ref() it first.
    
    Also, properly handle exceptions during the process.

http://git.fawkesrobotics.org/fawkes.git/commit/5d9d2ad
http://trac.fawkesrobotics.org/changeset/5d9d2ad

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 src/libs/eclipse_externals/blackboard.cpp |   37 +++++++++++++++++++++++++----
 1 files changed, 32 insertions(+), 5 deletions(-)


- *Diffs* -------------------------------------------------------------

- *commit* ec5a248571b7e684692b4b2925c7969844100cef - - - - - - - - - -
Author:  Till Hofmann <hofm...@kbsg.rwth-aachen.de>
Date:    Thu Jan 22 18:36:48 2015 +0100
Subject: eclipse_externals: implement p_bb_get for fields of type byte

 src/libs/eclipse_externals/blackboard.cpp |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/eclipse_externals/blackboard.cpp 
b/src/libs/eclipse_externals/blackboard.cpp
index 8e28d16..a012e0d 100644
--- a/src/libs/eclipse_externals/blackboard.cpp
+++ b/src/libs/eclipse_externals/blackboard.cpp
@@ -603,8 +603,26 @@ p_bb_get()
          break;
            
        case IFT_BYTE:
-         fprintf(stderr, "p_bb_get(): NOT YET IMPLEMENTED\n");
-         break;
+         if (fit.get_length() > 1)
+         {
+           EC_word res = nil();
+           uint8_t* array = fit.get_bytes();
+           for (int i=fit.get_length()-1; i>= 0; i--)
+             res = list( EC_word( (long) array[i]), res);
+           if ( EC_succeed != EC_arg( 3 ).unify( res ) )
+           {
+             printf( "p_bb_get(): could not bind return value\n" );
+             return EC_fail;
+           }
+         } else
+         {
+           if ( EC_succeed != EC_arg( 3 ).unify( EC_word( (long) 
fit.get_byte() ) ) )
+           {
+             printf( "p_bb_get(): could not bind return value\n" );
+             return EC_fail;
+           }
+        }
+        break;
 
        case IFT_ENUM:
          if (EC_succeed != EC_arg(3).unify(fit.get_value_string())) {

- *commit* 5d9d2ad24b708098677c0f1229dcd3d2c2ad4542 - - - - - - - - - -
Author:  Till Hofmann <hofm...@kbsg.rwth-aachen.de>
Date:    Thu Jan 22 18:44:03 2015 +0100
Subject: eclipse_externals: properly handle reference counting for sent messages

 src/libs/eclipse_externals/blackboard.cpp |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/eclipse_externals/blackboard.cpp 
b/src/libs/eclipse_externals/blackboard.cpp
index a012e0d..9cc3f4f 100644
--- a/src/libs/eclipse_externals/blackboard.cpp
+++ b/src/libs/eclipse_externals/blackboard.cpp
@@ -900,9 +900,18 @@ p_bb_send_message()
        };
       }
 
-      iface->msgq_enqueue(msg);
-      // return the msgID as 4th argument
-      EC_arg(4).unify((long)(msg->id()));
+       msg->ref();
+       try {
+               (*it)->msgq_enqueue( msg );
+               // return the msgID as 4th argument
+               EC_arg( 4 ).unify((int)(msg->id()));
+               msg->unref();
+       } catch (Exception &e) {
+               msg->unref();
+               e.print_trace();
+               return EC_fail;
+       }
+
     } catch (Exception& e) {
       fprintf(stderr, "p_bb_send_message() failed: %s\n", 
e.what_no_backtrace());
       return EC_fail;




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org
_______________________________________________
fawkes-commits mailing list
fawkes-commits@lists.kbsg.rwth-aachen.de
https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits

Reply via email to