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.

driver.h-skeleton 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #pragma once
  2. #include "ovasIDriver.h"
  3. #include "../ovasCHeader.h"
  4. #include <openvibe/ov_all.h>
  5. #include "../ovasCSettingsHelper.h"
  6. #include "../ovasCSettingsHelperOperators.h"
  7. namespace OpenViBE
  8. {
  9. namespace AcquisitionServer
  10. {
  11. /**
  12. * \class CDriver@@ClassName@@
  13. * \author @@AuthorName@@ (@@CompanyName@@)
  14. * \date @@Date@@
  15. * \brief The CDriver@@ClassName@@ allows the acquisition server to acquire data from a @@DriverName@@ device.
  16. *
  17. * TODO: details
  18. *
  19. * \sa CConfiguration@@ClassName@@
  20. */
  21. class CDriver@@ClassName@@ : public IDriver
  22. {
  23. public:
  24. CDriver@@ClassName@@(IDriverContext& ctx);
  25. virtual ~CDriver@@ClassName@@();
  26. virtual const char* getName();
  27. virtual bool initialize(const size_t nSamplePerSentBlock, IDriverCallback& callback);
  28. virtual bool uninitialize();
  29. virtual bool start();
  30. virtual bool stop();
  31. virtual bool loop();
  32. virtual bool isConfigurable();
  33. virtual bool configure();
  34. virtual const IHeader* getHeader() { return &m_header; }
  35. virtual bool isFlagSet(const EDriverFlag flag) const { return flag==EDriverFlag::IsUnstable; }
  36. protected:
  37. SettingsHelper m_settings;
  38. IDriverCallback* m_callback = nullptr;
  39. // Replace this generic Header with any specific header you might have written
  40. CHeader m_header;
  41. size_t m_nSamplePerSentBlock = 0;
  42. float* m_sample = nullptr;
  43. private:
  44. /*
  45. * Insert here all specific attributes, such as USB port number or device ID.
  46. * Example :
  47. */
  48. // size_t m_connectionID = 0;
  49. };
  50. } //namespace AcquisitionServer
  51. } //namespace OpenViBE