Changeset 10040 in ntrip for trunk/BNC/src/combination
- Timestamp:
- May 11, 2023, 2:23:16 PM (21 months ago)
- Location:
- trunk/BNC/src/combination
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/combination/bnccomb.cpp
r10039 r10040 114 114 } 115 115 116 117 // Singleton 118 //////////////////////////////////////////////////////////////////////////// 119 bncComb* bncComb::instance() {//cout << "bncComb::instance()" << endl; 120 static bncComb _bncComb; 121 return &_bncComb; 122 } 116 // Singleton: definition class variable 117 //////////////////////////////////////////////////////////////////////////// 118 bncComb* bncComb::instance = nullptr; 119 123 120 124 121 // Constructor 125 122 //////////////////////////////////////////////////////////////////////////// 126 bncComb::bncComb() : _ephUser(true) { //cout << "bncComb::bncComb()" << endl;123 bncComb::bncComb() : _ephUser(true) { 127 124 128 125 bncSettings settings; -
trunk/BNC/src/combination/bnccomb.h
r10039 r10040 22 22 Q_OBJECT 23 23 public: 24 bncComb(); 25 virtual ~bncComb(); 26 static bncComb* instance(); 24 static bncComb* getInstance() { 25 if (instance == 0) { 26 instance = new bncComb; 27 } 28 return instance; 29 } 30 bncComb(const bncComb&) = delete; 31 bncComb& operator=(const bncComb&) = delete; 32 static void destruct() { 33 delete instance; 34 instance = nullptr; 35 } 27 36 int nStreams() const {return _ACs.size();} 28 37 … … 33 42 void slotNewCodeBiases(QList<t_satCodeBias> satCodeBiases); 34 43 35 36 44 private slots: 37 45 void slotReadBiasSnxFile(); … … 44 52 45 53 private: 46 //bncComb(); // private constructor 47 bncComb(const bncComb&); 48 bncComb& operator=(const bncComb&); 49 54 bncComb(); // no public constructor 55 ~bncComb(); // no public destructor 56 static bncComb* instance; // declaration class variable 50 57 enum e_method{singleEpoch, filter}; 51 58 … … 267 274 }; 268 275 269 #define BNC_CMB (bncComb:: instance())276 #define BNC_CMB (bncComb::getInstance()) 270 277 271 278 #endif
Note:
See TracChangeset
for help on using the changeset viewer.