Viam C++ SDK current
Loading...
Searching...
No Matches
impl.hpp
1#pragma once
2
3#include <vector>
4
5#include "api.hpp"
6
7using namespace viam::sdk;
8
9// MySummation inherits from the `Summation` class defined in `api.hpp` and
10// implements all relevant methods.
11class MySummation : public Summation {
12 public:
13 MySummation(std::string name, bool subtract)
14 : Summation(std::move(name)), subtract_(subtract) {}
15 MySummation(const Dependencies& deps, const ResourceConfig& cfg);
16 static std::vector<std::string> validate(ResourceConfig cfg);
17
18 double sum(std::vector<double> numbers) override;
19
20 private:
21 bool subtract_;
22};
Definition impl.hpp:11
Definition api.hpp:22
Definition resource.hpp:43
virtual std::string name() const
Return the resource's name.