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.

IStimulusSender.h 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "defines.h"
  3. namespace TCPTagging {
  4. /*
  5. * \class IStimulusSender
  6. * \author Jussi T. Lindgren / Inria
  7. * \brief Interface of a simple client to send stimuli to Acquisition Server's TCP Tagging
  8. */
  9. class OV_API IStimulusSender
  10. {
  11. public:
  12. // Connect to the TCP Tagging plugin of the Acquisition Server
  13. // If sAddress is empty string, the StimulusSender will be inactive and connect() will not print an error but returns false.
  14. virtual bool connect(const char* sAddress, const char* sStimulusPort) = 0;
  15. // Send a stimulation.
  16. // Or flags with FLAG_FPTIME if the provided time is fixed point.
  17. // Or flags with FLAG_AUTOSTAMP_CLIENTSIDE to set the latest timestamp before sending. Then, timestamp is ignored.
  18. // Or flags with FLAG_AUTOSTAMP_SERVERSIDE to request these server to stamp on receiveing. Then, timestamp is ignored.
  19. virtual bool sendStimulation(uint64_t stimulation, uint64_t timestamp = 0, uint64_t flags = (Flag_Fptime | Flag_Autostamp_Clientside)) = 0;
  20. // To allow derived class' destructor to be called
  21. virtual ~IStimulusSender() = default;
  22. // Note: duplicated in TCP Tagging plugin in AS
  23. enum ETCPTaggingFlags
  24. {
  25. Flag_Fptime = (1LL << 0), // The time given is fixed point time.
  26. Flag_Autostamp_Clientside = (1LL << 1), // Ignore given stamp, bake timestamp on client side before sending
  27. Flag_Autostamp_Serverside = (1LL << 2) // Ignore given stamp, bake timestamp on server side when receiving
  28. };
  29. };
  30. // Clients are constructed via this call.
  31. extern OV_API IStimulusSender* CreateStimulusSender();
  32. } // namespace TCPTagging