Rename ValueConsumer members and arguments
@@ -20,27 +20,31 @@ class ValueConsumer {
/**
* Used to set an input of this consumer. It is usually called
* automatically by a ValueProducer.
- * @param newValue the value of the input
- * @param inputChannel Consumers can have one or more inputs feeding them.
+ * @param new_value the value of the input
+ * @param input_channel Consumers can have one or more inputs feeding them.
* This parameter allows you to specify which input number the producer
* is connecting to. For single input consumers, leave the index at zero.
*/
- virtual void set_input(T newValue, uint8_t inputChannel = 0) {
+ virtual void set_input(T new_value, uint8_t input_channel = 0) {
}
/**
* Registers this consumer with the specified producer, letting it
* know that this consumer would like to receive notifications whenever
* its value changes.
- * @param inputChannel Consumers can have one or more inputs feeding them.
+ * @param input_channel Consumers can have one or more inputs feeding them.
* This parameter allows you to specify which input number the producer
* is connecting to. For single input consumers, leave the index at zero.
*/
- void connectFrom(ValueProducer<T>* pProducer, uint8_t inputChannel = 0) {
- pProducer->attach([pProducer, this, inputChannel](){
- this->set_input(pProducer->get(), inputChannel);
+ void connect_from(ValueProducer<T>* producer, uint8_t input_channel = 0) {
+ producer->attach([producer, this, input_channel](){
+ this->set_input(producer->get(), input_channel);
});
}
+ [[deprecated("Use connect_from() instead.")]]
+ void connectFrom(ValueProducer<T>* producer, uint8_t input_channel = 0) {
+ connect_from(producer, input_channel);
+ }
};
