artf4107: Removed most "Init" functions from classes

They were either replaced with delegating constructors or merged into the only constructor in the class.

Change-Id: I3d35139f6ab23c719433a9f76942b02a3b07ddac
This commit is contained in:
Tyler Veness
2015-06-29 02:43:44 -07:00
parent e4a8aacc51
commit 1ab3ea670d
62 changed files with 258 additions and 525 deletions

View File

@@ -13,9 +13,12 @@
#include "WPIErrors.h"
/**
* Initialize an analog trigger from a channel.
* Constructor for an analog trigger given a channel number.
*
* @param channel The channel number on the roboRIO to represent. 0-3 are
* on-board 4-7 are on the MXP port.
*/
void AnalogTrigger::InitTrigger(uint32_t channel) {
AnalogTrigger::AnalogTrigger(int32_t channel) {
void *port = getPort(channel);
int32_t status = 0;
uint32_t index = 0;
@@ -26,22 +29,14 @@ void AnalogTrigger::InitTrigger(uint32_t channel) {
HALReport(HALUsageReporting::kResourceType_AnalogTrigger, channel);
}
/**
* Constructor for an analog trigger given a channel number.
*
* @param channel The channel number on the roboRIO to represent. 0-3 are
* on-board 4-7 are on the MXP port.
*/
AnalogTrigger::AnalogTrigger(int32_t channel) { InitTrigger(channel); }
/**
* Construct an analog trigger given an analog input.
* This should be used in the case of sharing an analog channel between the
* trigger and an analog input object.
* @param channel The pointer to the existing AnalogInput object
*/
AnalogTrigger::AnalogTrigger(AnalogInput *input) {
InitTrigger(input->GetChannel());
AnalogTrigger::AnalogTrigger(AnalogInput *input) :
AnalogTrigger(input->GetChannel()) {
}
AnalogTrigger::~AnalogTrigger() {