ros-industrial-consortium / packml

ROS packml (https://en.wikipedia.org/wiki/PackML) support package
Apache License 2.0
9 stars 14 forks source link

Replace multiple command methods with single method in state machine interface. #44

Open joshuaplusone opened 5 years ago

joshuaplusone commented 5 years ago

Replace

virtual bool start();
virtual bool clear();
virtual bool reset();
virtual bool hold();
virtual bool unhold();
virtual bool suspend();
virtual bool unsuspend();
virtual bool stop();
virtual bool abort();

with

bool sendTransitionCommand(CmdEnum command);
joshuaplusone commented 5 years ago

Should be able to get rid of the protected implementations of the following as well:

  /**
   * @brief Override to call implementations version of start command.
   *
   */
  virtual void _start() = 0;

  /**
   * @brief Override to call implementations version of clear command.
   *
   */
  virtual void _clear() = 0;

  /**
   * @brief Override to call implementations version of the reset command.
   *
   */
  virtual void _reset() = 0;

  /**
   * @brief Override to call implementations version of the hold command.
   *
   */
  virtual void _hold() = 0;

  /**
   * @brief Override to call implementations version of the unhold command.
   *
   */
  virtual void _unhold() = 0;

  /**
   * @brief Override to call implementations version of the suspend command.
   *
   */
  virtual void _suspend() = 0;

  /**
   * @brief Override to call implementations version of the unsuspend command.
   *
   */
  virtual void _unsuspend() = 0;

  /**
   * @brief Override to call implementations version of the stop command.
   *
   */
  virtual void _stop() = 0;