Changeset 5758 in ntrip for trunk/BNC/src/PPP/pppClient.cpp


Ignore:
Timestamp:
Aug 3, 2014, 1:44:02 PM (10 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/pppClient.cpp

    r5744 r5758  
    4040 * -----------------------------------------------------------------------*/
    4141
     42#include <QThreadStorage>
    4243
    4344#include <iostream>
     
    6162using namespace std;
    6263
    63 // Global Variable
    64 //////////////////////////////////////////////////////////////////////////////
    65 t_pppClient* PPP_CLIENT = 0;
     64// Global variable holding thread-specific pointers
     65//////////////////////////////////////////////////////////////////////////////
     66QThreadStorage<t_pppClient*> CLIENTS;
     67
     68// Static function returning thread-specific pointer
     69//////////////////////////////////////////////////////////////////////////////
     70t_pppClient* t_pppClient::instance() {
     71  return CLIENTS.localData();
     72}
    6673
    6774// Constructor
     
    7683  _staRover = new t_station();
    7784  _filter   = new t_filter();
     85  CLIENTS.setLocalData(this);
    7886}
    7987
     
    8189//////////////////////////////////////////////////////////////////////////////
    8290t_pppClient::~t_pppClient() {
     91  cout << "~t_pppClient" << endl;
    8392  delete _log;
    8493  delete _opt;
Note: See TracChangeset for help on using the changeset viewer.