You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __PATHFINDER_BINARY_LOG_HEADER__
  2. #define __PATHFINDER_BINARY_LOG_HEADER__
  3. #include <ctype.h>
  4. #include <err.h>
  5. #include <errno.h>
  6. #include <getopt.h>
  7. #include <ifaddrs.h>
  8. #include <netdb.h>
  9. #include <paths.h>
  10. #include <poll.h>
  11. #include <stdio.h>
  12. #include <signal.h>
  13. #include <stdint.h>
  14. #include <stdlib.h>
  15. #include <string.h>
  16. #include <time.h>
  17. #include <unistd.h>
  18. #include <arpa/inet.h>
  19. #include <netinet/ip.h>
  20. #include <netinet/udp.h>
  21. #include <sys/param.h> /* MIN() */
  22. #include <sys/socket.h>
  23. #include "../base/basicSettingsProvider.h"
  24. #include "../base/basicFunctionality.h"
  25. #include "../base/basicMutex.h"
  26. #include "../../pathfinder/pathfinderDBConnector.h"
  27. class objectPathfinderBinaryLog{
  28. protected:
  29. char m_sUUID[42];
  30. PATHFINDER_DBC * m_pDBC;
  31. public:
  32. static objectPathfinderBinaryLog * getInstance();
  33. void attachDBC( PATHFINDER_DBC *DBC );
  34. bool activate();
  35. bool finish();
  36. bool deleteDataFile( CSTR name );
  37. void registerGPS( GPS_EVTREC *ptr );
  38. void registerBNO( BNO_EVTREC *ptr );
  39. void registerOPF( OPF_EVTREC *ptr );
  40. void registerPIC( PF_TIMESTAMP *ts, CSTR name );
  41. void registerLFS( LRF_EVTREC *ptr );
  42. private:
  43. basicLogCollection * m_pLog;
  44. static objectPathfinderBinaryLog * _instance;
  45. basicMutex m_mProtector;
  46. objectPathfinderBinaryLog();
  47. virtual ~objectPathfinderBinaryLog();
  48. uint32_t m_nDBID;
  49. bool m_bActive;
  50. void uuidgen( bool gen = true );
  51. FILE * m_pFID;
  52. };
  53. #endif