Viam C++ SDK current
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
viam::sdk::Button Class Referenceabstract

A Button represents a physical or virtual button. More...

#include "components/button.hpp"

+ Inheritance diagram for viam::sdk::Button:

Public Member Functions

void push ()
 Push the button.
 
virtual void push (const ProtoStruct &extra)=0
 Push the button.
 
virtual ProtoStruct do_command (const ProtoStruct &command)=0
 Send/receive arbitrary commands to the resource.
 
API api () const override
 Returns the API associated with a particular resource.
 
- Public Member Functions inherited from viam::sdk::Component
Name get_resource_name () const override
 Returns the Name for a particular resource.
 
- Public Member Functions inherited from viam::sdk::Resource
 Resource (std::string name)
 
virtual std::string name () const
 Return the resource's name.
 

Protected Member Functions

 Button (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Component
 Component (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Resource
Name get_resource_name (const std::string &type) const
 

Detailed Description

A Button represents a physical or virtual button.

This acts as an abstract parent class to be inherited from by any drivers representing specific button implementations. This class cannot be used on its own.

Member Function Documentation

◆ api()

API viam::sdk::Button::api ( ) const
overridevirtual

Returns the API associated with a particular resource.

Implements viam::sdk::Resource.

◆ do_command()

virtual ProtoStruct viam::sdk::Button::do_command ( const ProtoStruct & command)
pure virtual

Send/receive arbitrary commands to the resource.

Parameters
Commandthe command to execute.
Returns
The result of the executed command.

Implemented in viam::sdk::impl::ButtonClient.

◆ push()

virtual void viam::sdk::Button::push ( const ProtoStruct & extra)
pure virtual

Push the button.

Parameters
extraAny additional arguments to the method.

Implemented in viam::sdk::impl::ButtonClient, and viam::sdk::impl::ButtonClient.


The documentation for this class was generated from the following file: