Changeset 162 in pacpusframework for branches/2.0-beta1/include/Pacpus/PacpusTools
- Timestamp:
- Aug 1, 2013, 4:46:07 PM (11 years ago)
- Location:
- branches/2.0-beta1/include/Pacpus/PacpusTools
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0-beta1/include/Pacpus/PacpusTools/AsyncWorkerBase.h
r89 r162 16 16 17 17 //#include <boost/noncopyable.hpp> 18 #include <Pacpus/PacpusTools/PacpusToolsConfig.h> 18 19 #include <QObject> 19 20 20 21 namespace pacpus 21 22 { 22 /** 23 * @brief A simple base class for asynchronous workers able to partake in the 24 * Qt slot / signal mechanism 25 * 26 * This class represents an asynchronous event-based worker able to receive and 27 * send Qt signals to other workers or threads. The rationale is to be able to 28 * define stateful objects that perform calculations asynchronously, triggered 29 * by external user-defined messages. 30 */ 31 class AsyncWorkerBase 23 24 /// A simple base class for asynchronous workers able to partake in the 25 /// Qt slot / signal mechanism 26 /// 27 /// This class represents an asynchronous event-based worker able to receive and 28 /// send Qt signals to other workers or threads. The rationale is to be able to 29 /// define stateful objects that perform calculations asynchronously, triggered 30 /// by external user-defined messages. 31 class PACPUSTOOLS_API AsyncWorkerBase 32 32 : public QObject 33 33 //, private boost::noncopyable 34 34 { 35 35 Q_OBJECT 36 Q_DISABLE_COPY(AsyncWorkerBase) 37 public: 38 /** Constructor. */ 36 Q_DISABLE_COPY(AsyncWorkerBase) 37 38 public: 39 /// Constructor. 39 40 AsyncWorkerBase(); 40 41 41 /** Destructor. */42 42 /// Destructor. 43 virtual ~AsyncWorkerBase(); 43 44 44 /**Starts the worker by creating a new thread for it, and calling the setup() virtual method. */45 45 /// Starts the worker by creating a new thread for it, and calling the setup() virtual method. */ 46 void start(); 46 47 47 /** Terminates the worker as soon as there are no more requests pending and its current processing 48 * is finished. 49 * 50 * This method tries to end the worker gracefully. All pending signals sent before the stop() request will 51 * be honored. 52 * It is safe to call this method from any thread. 53 * 54 * @param autoDelete if true, deletes the worker as soon as its event loop has finished processing. 55 */ 56 void stop(bool autoDelete); 48 /// Terminates the worker as soon as there are no more requests pending and its current processing 49 /// is finished. 50 /// 51 /// This method tries to end the worker gracefully. All pending signals sent before the stop() request will 52 /// be honored. 53 /// It is safe to call this method from any thread. 54 /// 55 /// @param autoDelete if true, deletes the worker as soon as its event loop has finished processing. 56 void stop(bool autoDelete); 57 57 58 /** Returns true if the worker is active. */ 59 bool isActive() const { return active_; } 58 /// @returns @b true if the worker is active, @b false otherwise. 59 bool isActive() const 60 { 61 return active_; 62 } 60 63 61 64 Q_SIGNALS: … … 73 76 virtual void cleanup(); 74 77 75 /** Returns true if the worker is stopping. */78 /// Returns true if the worker is stopping. 76 79 bool isStopping() const { return stopping_; } 77 80 … … 83 86 84 87 private: 85 /*! \brief Ends the worker, asking the underlying thread to terminate 86 * 87 * This method signals the end of processing and requests the underlying thread to terminate. Actual termination 88 * will occur as soon as all pending signals (including those that may come from other workers during the 89 * finish request handling) have been processed. 90 */ 88 /// Ends the worker, asking the underlying thread to terminate 89 /// 90 /// This method signals the end of processing and requests the underlying thread to terminate. Actual termination 91 /// will occur as soon as all pending signals (including those that may come from other workers during the 92 /// finish request handling) have been processed. 91 93 void finish(); 92 94 … … 95 97 bool stopping_; 96 98 }; 99 97 100 } // namespace pacpus 98 101 -
branches/2.0-beta1/include/Pacpus/PacpusTools/PeriodicWorker.h
r89 r162 15 15 #define DEF_PACPUS_PERIODIC_WORKER_H 16 16 17 // Includes, pacpus.18 17 #include <Pacpus/PacpusTools/AsyncWorkerBase.h> 18 #include <Pacpus/PacpusTools/PacpusToolsConfig.h> 19 19 20 20 class QTimer; … … 22 22 namespace pacpus 23 23 { 24 /** PeriodicWorker 25 * @brief A simple base class for periodic worker. 26 * 27 * @example 28 * class MyWorker 29 * : public PeriodicWorkder 30 * { 31 * public: 32 * void doWork() { std::cout << "Hey, I'm working!" << std::endl; } 33 * }; 34 * 35 * // Do its work every second. 36 * MyWorker worker; 37 * worker.startWork(1000); 38 */ 39 class PeriodicWorker 24 25 /// @brief A simple base class for periodic worker. 26 /// 27 /// @example 28 /// To use the PeriodicWorker, simply inherit from this class when creating your worker. 29 /// ~~~ 30 /// class MyWorker 31 /// : public PeriodicWorkder 32 /// { 33 /// public: 34 /// void doWork() { std::cout << "Hey, I'm working!" << std::endl; } 35 /// }; 36 /// 37 /// // Do its work every second. 38 /// MyWorker worker; 39 /// worker.startWork(1000); 40 /// ~~~ 41 class PACPUSTOOLS_API PeriodicWorker 40 42 : public AsyncWorkerBase 41 43 { … … 48 50 virtual ~PeriodicWorker(); 49 51 50 /** Start the periodic worker. 51 * @param msec Period in mseconds. 52 */ 52 /// Start the periodic worker. 53 /// @param msec Period in mseconds. 53 54 void startWork(int msec); 54 55 55 /** Stop the periodic worker, but do not delete it. */56 /// Stop the periodic worker, but do not delete it. 56 57 void stopWork(); 57 58 58 public slots: 59 /** Do the work. 60 * This method need to be implemented in the subclasses, it will be called 61 * each time the timer has reached its period. 62 */ 59 public Q_SLOTS: 60 /// Do the work. 61 /// This method need to be implemented in the subclasses, it will be called 62 /// each time the timer has reached its period. 63 63 virtual void doWork() = 0; 64 64 … … 66 66 QTimer* mHeartbeat; 67 67 }; 68 } 68 69 } // namespace pacpus 69 70 70 71 #endif // DEF_PACPUS_PERIODIC_WORKER_H -
branches/2.0-beta1/include/Pacpus/PacpusTools/PosixShMem.h
r126 r162 22 22 23 23 /// @todo Documentation 24 class PACPUS _TOOLS_API PosixShMem24 class PACPUSTOOLS_API PosixShMem 25 25 : public ShMemBase 26 26 { -
branches/2.0-beta1/include/Pacpus/PacpusTools/ShMem.h
r148 r162 4 4 // %pacpus:license} 5 5 /// @file 6 /// @author Firstname Surname<firstname.surname@utc.fr>7 /// @date Month, Year6 /// @author Gerald Dherbomez <firstname.surname@utc.fr> 7 /// @date January, 2007 8 8 /// @version $Id: ShMem.h 76 2013-01-10 17:05:10Z kurdejma $ 9 9 /// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved. … … 32 32 /// 33 33 /// Inherits from Win32ShMem on Windows system and from PosixShMem on Unix-like systems. 34 class /*PACPUS _TOOLS_API*/ ShMem34 class /*PACPUSTOOLS_API*/ ShMem 35 35 : public ShMemType 36 36 { -
branches/2.0-beta1/include/Pacpus/PacpusTools/ShMemBase.h
r126 r162 18 18 19 19 /// Base class for shared memory objects. 20 class PACPUS _TOOLS_API ShMemBase20 class PACPUSTOOLS_API ShMemBase 21 21 { 22 22 public: -
branches/2.0-beta1/include/Pacpus/PacpusTools/Win32ShMem.h
r126 r162 24 24 typedef void * HANDLE; 25 25 26 #ifdef _MSC_VER 27 # pragma warning(push) 28 # pragma warning(disable: 4275) 29 #endif // _MSC_VER 30 31 namespace pacpus { 32 26 33 /// Shared memory object for Windows. 27 class PACPUS _TOOLS_API Win32ShMem34 class PACPUSTOOLS_API Win32ShMem 28 35 : public ShMemBase 29 36 { … … 57 64 }; 58 65 66 } // namespace pacpus 67 68 #ifdef _MSC_VER 69 # pragma warning(pop) 70 #endif // _MSC_VER 71 59 72 #endif // DEF_PACPUS_WIN32SHMEM_H -
branches/2.0-beta1/include/Pacpus/PacpusTools/geodesie.h
r149 r162 4 4 // %} 5 5 /// @file 6 /// @author Firstname Surname<firstname.surname@utc.fr>7 /// @date Month, Year6 /// @author Jean Laneurit <firstname.surname@utc.fr> 7 /// @date April, 2010 8 8 /// @version $Id: geodesie.h 75 2013-01-10 17:04:19Z kurdejma $ 9 9 /// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved. … … 40 40 /// @todo Documentation 41 41 /// @todo Rewrite! 42 struct PACPUS _TOOLS_API Matrice42 struct PACPUSTOOLS_API Matrice 43 43 { 44 44 /// Copy ctor … … 71 71 }; 72 72 73 PACPUS _TOOLS_API Matrice TransMat(const Matrice A);74 PACPUS _TOOLS_API Matrice ProdMat(const Matrice A,const Matrice B);75 PACPUS _TOOLS_API void Write(const Matrice A,std::ostream& out);73 PACPUSTOOLS_API Matrice TransMat(const Matrice A); 74 PACPUSTOOLS_API Matrice ProdMat(const Matrice A,const Matrice B); 75 PACPUSTOOLS_API void Write(const Matrice A,std::ostream& out); 76 76 77 77 //////////////////////////////////////////////////////////////////////// 78 78 /// @todo Documentation 79 class PACPUS _TOOLS_API Raf9879 class PACPUSTOOLS_API Raf98 80 80 { 81 81 public: … … 135 135 136 136 //////////////////////////////////////////////////////////////////////// 137 PACPUS _TOOLS_API void Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,Matrice in,double& E,double& N,double& h,Matrice& out);138 PACPUS _TOOLS_API void Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,double& E,double& N,double& h);139 PACPUS _TOOLS_API void Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,double& lambda,double& phi,double& he);140 PACPUS _TOOLS_API void Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,Matrice in,double& lambda,double& phi,double& he,Matrice& out);137 PACPUSTOOLS_API void Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,Matrice in,double& E,double& N,double& h,Matrice& out); 138 PACPUSTOOLS_API void Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,double& E,double& N,double& h); 139 PACPUSTOOLS_API void Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,double& lambda,double& phi,double& he); 140 PACPUSTOOLS_API void Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,Matrice in,double& lambda,double& phi,double& he,Matrice& out); 141 141 /** Convert from geographique to ECEF. 142 142 * @param[in] longitude Longitude in radian. … … 144 144 * @param[in] he Height in meter. 145 145 */ 146 PACPUS _TOOLS_API void Geographique_2_ECEF(double longitude, double latitude, double he, double& x, double& y, double& z);146 PACPUSTOOLS_API void Geographique_2_ECEF(double longitude, double latitude, double he, double& x, double& y, double& z); 147 147 /** Convert from ECEF two ENU. 148 148 * @param[in] lon0 Longitude of the origin in radian. … … 150 150 * @param[in] he0 Height of the origin in radian. 151 151 */ 152 PACPUS _TOOLS_API void ECEF_2_ENU(double x,double y,double z,double& e,double& n,double& u,double lon0,double lat0,double he0);152 PACPUSTOOLS_API void ECEF_2_ENU(double x,double y,double z,double& e,double& n,double& u,double lon0,double lat0,double he0); 153 153 //////////////////////////////////////////////////////////////////////// 154 154 155 155 ///ALGO0001 156 156 /// @todo Rename 157 PACPUS _TOOLS_API double LatitueIsometrique(double latitude,double e);157 PACPUSTOOLS_API double LatitueIsometrique(double latitude,double e); 158 158 ///ALGO0002 159 159 /// @todo Rename 160 PACPUS _TOOLS_API double LatitueIsometrique2Lat(double latitude_iso,double e,double epsilon);160 PACPUSTOOLS_API double LatitueIsometrique2Lat(double latitude_iso,double e,double epsilon); 161 161 162 162 ///ALGO0003 163 PACPUS _TOOLS_API void Geo2ProjLambert(163 PACPUSTOOLS_API void Geo2ProjLambert( 164 164 double lambda,double phi, 165 165 double n, double c,double e, … … 167 167 double& X,double& Y); 168 168 ///ALGO0004 169 PACPUS _TOOLS_API void Proj2GeoLambert(169 PACPUSTOOLS_API void Proj2GeoLambert( 170 170 double X,double Y, 171 171 double n, double c,double e, … … 174 174 double& lambda,double& phi); 175 175 176 PACPUS _TOOLS_API double ConvMerApp(double longitude);176 PACPUSTOOLS_API double ConvMerApp(double longitude); 177 177 178 178 /** … … 216 216 } 217 217 218 PACPUS _TOOLS_API QMatrix4x4 yprenuToMatrix(QVector3D angle, QVector3D position);218 PACPUSTOOLS_API QMatrix4x4 yprenuToMatrix(QVector3D angle, QVector3D position); 219 219 220 220 } // namespace Geodesie -
branches/2.0-beta1/include/Pacpus/PacpusTools/matrice.h
r126 r162 4 4 // %pacpus:license} 5 5 /// @file 6 /// @author Firstname Surname<firstname.surname@utc.fr>7 /// @date Month, Year6 /// @author Jean Laneurit <firstname.surname@utc.fr> 7 /// @date April, 2010 8 8 /// @version $Id: matrice.h 76 2013-01-10 17:05:10Z kurdejma $ 9 9 /// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved. … … 26 26 /// Simple matrix. 27 27 /// @todo Documentation 28 class PACPUS _TOOLS_API matrice28 class PACPUSTOOLS_API matrice 29 29 { 30 30 typedef double *ligne;
Note:
See TracChangeset
for help on using the changeset viewer.