View Single Post
  #5   Spotlight this post!  
Unread 04-06-2016, 11:36 AM
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 298
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: What does SendableChooser.GetSelected() return as?

It returns a void*, which you cast to a Whatever* that you passed into AddObject (in your case, Command*)

Code:
autoChooser.AddObject("Lowbar Auto", new Auto);

// Then in autonomous init 
((Command*) autoChooser.GetSelected())->Start();
(A templated SendableChooser might solve this confusion)

It's not a memory leak since you'd never normally delete your auto commands anyway.
Reply With Quote