Changeset 112:2328084a5200 in finroc_plugins_blackboard


Ignore:
Timestamp:
25.02.2014 15:20:57 (8 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Message:

tLockException now derives from tRPCException. This has the advantage that error codes are available - why locking failed.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tBlackboardReadAccess.h

    r102 r112  
    201201      catch (const rpc_ports::tRPCException& e) 
    202202      { 
    203         throw tLockException(); 
     203        throw tLockException(e.GetType()); 
    204204      } 
    205205    } 
     
    213213    if (!this->blackboard) 
    214214    { 
    215       throw tLockException(); 
     215      throw tLockException(rpc_ports::tFutureStatus::INVALID_CALL); 
    216216    } 
    217217    FINROC_LOG_PRINT(DEBUG_VERBOSE_1, "Acquiring read lock on blackboard '", blackboard.GetName(), "' at ", rrlib::time::Now()); 
  • tBlackboardWriteAccess.h

    r102 r112  
    219219      catch (const rpc_ports::tRPCException& e) 
    220220      { 
    221         throw tLockException(); 
     221        throw tLockException(e.GetType()); 
    222222      } 
    223223    } 
     
    231231    if (!this->blackboard) 
    232232    { 
    233       throw tLockException(); 
     233      throw tLockException(rpc_ports::tFutureStatus::INVALID_CALL); 
    234234    } 
    235235    FINROC_LOG_PRINT(DEBUG_VERBOSE_1, "Acquiring write lock on blackboard '", blackboard.GetName(), "' at ", rrlib::time::Now()); 
  • tLockException.h

    r111 r112  
    6363//! Blackboard lock exception 
    6464/*! 
    65  * Thrown when blackboard lock takes too long 
     65 * Thrown when blackboard lock fails 
    6666 */ 
    67 class tLockException : public std::exception 
     67class tLockException : public rpc_ports::tRPCException 
    6868{ 
    6969 
     
    7373public: 
    7474 
    75   virtual const char* what() const throw() override 
    76   { 
    77     return "Lock failed"; 
    78   } 
     75  tLockException(rpc_ports::tFutureStatus type) : 
     76    rpc_ports::tRPCException(type) 
     77  {} 
    7978 
    8079//---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.