30 #include <boost/assert.hpp>
36 namespace connection {
41 return m_names.front();
49 : m_names(1, name), m_token(nullptr) {}
52 : m_names(names), m_token(nullptr) {}
64 BOOST_ASSERT(m_token ==
nullptr);
70 m_descriptor = jsonString;
78 return m_token !=
nullptr;
82 BOOST_ASSERT(m_token);
void setDeviceDescriptor(std::string const &jsonString)
Send new/updated JSON device descriptor.
A DeviceToken connects the generic device interaction code in PluginKit's C API with the workings of ...
virtual void m_sendData(util::time::TimeValue const ×tamp, MessageType *type, const char *bytestream, size_t len)=0
(Subclass implementation) Send message.
ConnectionDevice(std::string const &name)
Constructor for use by derived classes only.
DeviceToken & m_getDeviceToken()
accessor for device token
Base class for connection-specific message type registration.
virtual ~ConnectionDevice()
destructor
void setDeviceToken(DeviceToken &token)
For use only by DeviceToken.
std::string const & getDeviceDescriptor() const
Get the most current JSON device descriptor.
void process()
Process messages. This shouldn't block.
NameList const & getNames() const
accessor for device names
void sendData(util::time::TimeValue const ×tamp, MessageType *type, const char *bytestream, size_t len)
Send message (as primary device name)
std::string const & getName() const
accessor for (primary) device name
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
bool m_hasDeviceToken() const
Does this connection device have a device token? Should be true in nearly every case.
virtual void m_process()=0
(Subclass implementation) Process messages. This shouldn't block.