Viam C++ SDK current
Loading...
Searching...
No Matches
stoppable.hpp
1#pragma once
2
3#include <viam/sdk/common/utils.hpp>
4
5namespace viam {
6namespace sdk {
7
8class Stoppable {
9 public:
10 virtual ~Stoppable();
13 virtual void stop(const ProtoStruct& extra) = 0;
14
16 inline void stop() {
17 return stop({});
18 }
19
23 static void stop_if_stoppable(const std::shared_ptr<Resource>& resource,
24 const ProtoStruct& extra);
25
28 inline static void stop_if_stoppable(const std::shared_ptr<Resource>& resource) {
29 return stop_if_stoppable(resource, {});
30 }
31
32 protected:
33 explicit Stoppable();
34};
35
36} // namespace sdk
37} // namespace viam
Definition stoppable.hpp:8
virtual void stop(const ProtoStruct &extra)=0
Stops a resource from running.
void stop()
Stops a resource from running.
Definition stoppable.hpp:16
static void stop_if_stoppable(const std::shared_ptr< Resource > &resource, const ProtoStruct &extra)
Stops a Resource if it is Stoppable.
static void stop_if_stoppable(const std::shared_ptr< Resource > &resource)
Stops a Resource if it is Stoppable.
Definition stoppable.hpp:28