Drake
adder3.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdint>
4 #include <memory>
5 
11 
12 namespace drake {
13 namespace systems {
14 
18 template <typename T>
19 class Adder3 : public System3<T> {
20  public:
25  DRAKESYSTEMFRAMEWORK_EXPORT Adder3(const std::string& name, int num_inputs,
26  int length);
27 
28  private:
29  // Implement System3<T> interface.
30 
31  // Allocates the number of input ports specified in the constructor.
32  // Allocates no state.
33  std::unique_ptr<AbstractContext3> DoCreateEmptyContext() const override {
34  return std::make_unique<Context3<T>>();
35  }
36 
37  // Sums the input ports into the output port. If the input ports are not
38  // of number num_inputs_ or size length_, std::runtime_error will be thrown.
39  DRAKESYSTEMFRAMEWORK_EXPORT void DoCalcOutputPort(
40  const AbstractContext3& context, int port_num,
41  AbstractValue* value) const override;
42 
43  const int num_inputs_;
44  const int length_;
45 };
46 
47 } // namespace systems
48 } // namespace drake
An abstract superclass for the Context3 objects for dynamical systems, encapsulating functionality th...
Definition: context3.h:87
A superclass template for systems that use a specified scalar type T for numerical values...
Definition: system3.h:481
Definition: constants.h:3
DRAKESYSTEMFRAMEWORK_EXPORT Adder3(const std::string &name, int num_inputs, int length)
Create an Adder System with a given number of VectorInputPort&#39;s of a particular length, with a single VectorOutputPort of the same length.
Definition: adder3.cc:14
A fully type-erased container class.
Definition: value.h:22
An adder for arbitrarily many vector-valued inputs of equal length.
Definition: adder3.h:19