WPILibC++  2018.4.1-20180729223220-1149-g7bd3f9f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Sendable.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2011-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <string>
11 
12 #include <wpi/Twine.h>
13 
14 namespace frc {
15 
16 class SendableBuilder;
17 
18 class Sendable {
19  public:
20  virtual ~Sendable() = default;
21 
27  virtual std::string GetName() const = 0;
28 
34  virtual void SetName(const wpi::Twine& name) = 0;
35 
42  void SetName(const wpi::Twine& subsystem, const wpi::Twine& name) {
43  SetSubsystem(subsystem);
44  SetName(name);
45  }
46 
52  virtual std::string GetSubsystem() const = 0;
53 
59  virtual void SetSubsystem(const wpi::Twine& subsystem) = 0;
60 
66  virtual void InitSendable(SendableBuilder& builder) = 0;
67 };
68 
69 } // namespace frc
void SetName(const wpi::Twine &subsystem, const wpi::Twine &name)
Sets both the subsystem name and device name of this Sendable object.
Definition: Sendable.h:42
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
virtual void SetSubsystem(const wpi::Twine &subsystem)=0
Sets the subsystem name of this Sendable object.
virtual void InitSendable(SendableBuilder &builder)=0
Initializes this Sendable object.
virtual std::string GetSubsystem() const =0
Gets the subsystem name of this Sendable object.
virtual void SetName(const wpi::Twine &name)=0
Sets the name of this Sendable object.
Definition: SendableBuilder.h:23
Definition: Sendable.h:18
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:79
virtual std::string GetName() const =0
Gets the name of this Sendable object.