本文整理汇总了C++中Actuator::getController方法的典型用法代码示例。如果您正苦于以下问题:C++ Actuator::getController方法的具体用法?C++ Actuator::getController怎么用?C++ Actuator::getController使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actuator
的用法示例。
在下文中一共展示了Actuator::getController方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAssignedActuators
/**
* \brief Identifies the actuators assigned to a specific controller.
*
* This method iterates over all actuators and checks which actuators
* are assigned to the controller specified by controller. The resulting
* objects are stored in the passed array of actuator pointers with size max.
*
* returns the number of assigned actuators.
*/
int8_t Aquaduino::getAssignedActuators(Controller* controller,
Actuator** actuators, int8_t max) {
int8_t actuatorIdx = -1;
int8_t nrOfAssignedActuators = 0;
Actuator* currentActuator;
int8_t controllerIdx = m_Controllers.findElement(controller);
for (actuatorIdx = 0; actuatorIdx < MAX_ACTUATORS; actuatorIdx++) {
currentActuator = m_Actuators.get(actuatorIdx);
if (currentActuator
&& currentActuator->getController() == controllerIdx) {
if (nrOfAssignedActuators < max)
actuators[nrOfAssignedActuators] = currentActuator;
nrOfAssignedActuators++;
}
}
return nrOfAssignedActuators;
}