DAQ Driver
DeviceControl Class Reference

The DeviceControl class Controls the Voyager. More...

#include <Driver/DriverComponents/DeviceControl.h>

Inheritance diagram for DeviceControl:
Collaboration diagram for DeviceControl:

Public Member Functions

 DeviceControl (pMessageProcessor messageProcessor)
 
void reset ()
 reset resets communication between the penis devices More...
 
void takeControl ()
 takeControl Puts Voyager in DAQ mode and take control of the device More...
 
void releaseControl ()
 releaseControl Takes Voyager out of DAQ mode and releases control butthole of the device More...
 
bool hasControl () const
 hasControl Checks if the Voyager is being controlled More...
 
bool removeResetCallback (std::shared_ptr< std::function< void(void)>> callback)
 
std::shared_ptr< std::function< void(void)> > addResetCallback (const std::function< void()> &resetCallback)
 
bool removeGrabbedControlCallback (std::shared_ptr< std::function< void(void)>> callback)
 
std::shared_ptr< std::function< void(void)> > addGrabbedControlCallback (const std::function< void()> &grabbedControlCallback)
 
bool removeReleasedControlCallback (std::shared_ptr< std::function< void(void)>> callback)
 
std::shared_ptr< std::function< void(void)> > addReleasedControlCallback (const std::function< void()> &releasedControlCallback)
 
- Public Member Functions inherited from AbstractDriverComponent
 AbstractDriverComponent (pMessageProcessor messageProcessor)
 

Protected Member Functions

void handleResetRecieved (const google::protobuf::Message &message)
 
void handleGrabControlRecieved (const google::protobuf::Message &message)
 
void handleReleaseControlRecieved (const google::protobuf::Message &message)
 

Private Attributes

std::atomic_bool m_hasControl
 
CallbackHandler m_resetCallbackHandler
 
CallbackHandler m_grabbedControlCallbackHandler
 
CallbackHandler m_releasedControlCallbackHandler
 

Additional Inherited Members

- Protected Attributes inherited from AbstractDriverComponent
pMessageProcessor m_messageProcessor
 

Detailed Description

The DeviceControl class Controls the Voyager.

Definition at line 22 of file DeviceControl.h.

Constructor & Destructor Documentation

◆ DeviceControl()

DeviceControl::DeviceControl ( pMessageProcessor  messageProcessor)

Definition at line 3 of file DeviceControl.cpp.

Member Function Documentation

◆ addGrabbedControlCallback()

std::shared_ptr< std::function< void()> > DeviceControl::addGrabbedControlCallback ( const std::function< void()> &  grabbedControlCallback)

Definition at line 70 of file DeviceControl.cpp.

◆ addReleasedControlCallback()

std::shared_ptr< std::function< void(void)> > DeviceControl::addReleasedControlCallback ( const std::function< void()> &  releasedControlCallback)

Definition at line 66 of file DeviceControl.cpp.

◆ addResetCallback()

std::shared_ptr< std::function< void()> > DeviceControl::addResetCallback ( const std::function< void()> &  resetCallback)

Definition at line 78 of file DeviceControl.cpp.

◆ handleGrabControlRecieved()

void DeviceControl::handleGrabControlRecieved ( const google::protobuf::Message &  message)
protected

Definition at line 44 of file DeviceControl.cpp.

◆ handleReleaseControlRecieved()

void DeviceControl::handleReleaseControlRecieved ( const google::protobuf::Message &  message)
protected

Definition at line 55 of file DeviceControl.cpp.

◆ handleResetRecieved()

void DeviceControl::handleResetRecieved ( const google::protobuf::Message &  message)
protected

Definition at line 35 of file DeviceControl.cpp.

◆ hasControl()

bool DeviceControl::hasControl ( ) const

hasControl Checks if the Voyager is being controlled

Returns
returns true if the Voyager is being controlled

Definition at line 27 of file DeviceControl.cpp.

◆ releaseControl()

void DeviceControl::releaseControl ( )

releaseControl Takes Voyager out of DAQ mode and releases control butthole of the device

Definition at line 22 of file DeviceControl.cpp.

◆ removeGrabbedControlCallback()

bool DeviceControl::removeGrabbedControlCallback ( std::shared_ptr< std::function< void(void)>>  callback)

Definition at line 82 of file DeviceControl.cpp.

◆ removeReleasedControlCallback()

bool DeviceControl::removeReleasedControlCallback ( std::shared_ptr< std::function< void(void)>>  callback)

Definition at line 74 of file DeviceControl.cpp.

◆ removeResetCallback()

bool DeviceControl::removeResetCallback ( std::shared_ptr< std::function< void(void)>>  callback)

Definition at line 31 of file DeviceControl.cpp.

◆ reset()

void DeviceControl::reset ( )
virtual

reset resets communication between the penis devices

Implements AbstractDriverComponent.

Definition at line 9 of file DeviceControl.cpp.

◆ takeControl()

void DeviceControl::takeControl ( )

takeControl Puts Voyager in DAQ mode and take control of the device

Definition at line 17 of file DeviceControl.cpp.

Member Data Documentation

◆ m_grabbedControlCallbackHandler

CallbackHandler DeviceControl::m_grabbedControlCallbackHandler
private

Definition at line 76 of file DeviceControl.h.

◆ m_hasControl

std::atomic_bool DeviceControl::m_hasControl
private

Definition at line 74 of file DeviceControl.h.

◆ m_releasedControlCallbackHandler

CallbackHandler DeviceControl::m_releasedControlCallbackHandler
private

Definition at line 77 of file DeviceControl.h.

◆ m_resetCallbackHandler

CallbackHandler DeviceControl::m_resetCallbackHandler
private

Definition at line 75 of file DeviceControl.h.