Drake
diagram3.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 
7 
8 namespace drake {
9 namespace systems {
10 
22 template <typename T>
23 class Diagram3: public System3<T> {
24 public:
28  explicit Diagram3(const std::string& name) : System3<T>(name) {}
29 private:
30  // Implement System3<T> interface.
31 
32  std::unique_ptr<AbstractContext3> DoCreateEmptyContext() const final {
33  return std::make_unique<Context3<double>>();
34  }
35 
36  // Don't need any additional resources.
37 
38  // Calculation consists of finding the subsystem that owns the actual
39  // output port and making it do the evaluation.
40  void DoCalcOutputPort(const AbstractContext3& context, int port_num,
41  AbstractValue* value) const final {
42  throw std::logic_error(
43  "Diagram3::DoCalcOutputPort(): a diagram shouldn't own any ports.");
44  }
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
Diagram3(const std::string &name)
Default constructor creates a diagram with no subsystems and no input or output ports.
Definition: diagram3.h:28
A Diagram is a concrete System that contains other System objects as subsystems and wires them togeth...
Definition: diagram3.h:23
A fully type-erased container class.
Definition: value.h:22