Ignore:
Timestamp:
01/06/17 13:56:26 (7 years ago)
Author:
Sanahuja Guillaume
Message:

modifs uav vrpn i686

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSensorActuator/src/VrpnClient.cpp

    r15 r122  
    2626using namespace flair::gui;
    2727
     28namespace {
     29  flair::sensor::VrpnClient *singleton = NULL;
     30}
     31
     32
    2833namespace flair {
    2934namespace sensor {
    3035
    31 VrpnClient::VrpnClient(const FrameworkManager *parent, string name,
     36VrpnClient *GetVrpnClient(void) { return singleton; }
     37       
     38VrpnClient::VrpnClient(string name,
    3239                       string address, uint16_t us_period, uint8_t priority)
    33     : Thread(parent, name, priority) {
     40    : Thread(getFrameworkManager(), name, priority) {
     41        if (singleton != NULL) {
     42    Err("VrpnClient must be instanced only one time\n");
     43    return;
     44  }
     45
     46  singleton = this;
    3447  pimpl_ = new VrpnClient_impl(this, name, address, us_period);
    3548}
    3649
    37 VrpnClient::VrpnClient(const FrameworkManager *parent, string name,
     50VrpnClient::VrpnClient(string name,
    3851                       SerialPort *serialport, uint16_t us_period,
    3952                       uint8_t priority)
    40     : Thread(parent, name, priority) {
     53    : Thread(getFrameworkManager(), name, priority) {
     54        if (singleton != NULL) {
     55    Err("VrpnClient must be instanced only one time\n");
     56    return;
     57  }
     58
     59  singleton = this;
    4160  pimpl_ = new VrpnClient_impl(this, name, serialport, us_period);
    4261}
Note: See TracChangeset for help on using the changeset viewer.