46 d->typedProperty.reset();
52 return d->typedProperty.findOnSwitchIndex();
58 return d->typedProperty.findOnSwitchName();
64 return d->typedProperty.findOnSwitch();
70 return d->typedProperty.isSwitchOn(name);
76 if (d->onNewValuesCallback)
79 for (
int i = 0; i <
n; ++i)
81 newValues[names[i]] = states[i];
84 d->onNewValuesCallback(newValues);
87 return d->typedProperty.update(states, names,
n) && (
emitUpdate(),
true);
93 return d->onNewValuesCallback !=
nullptr || d->onUpdateCallback !=
nullptr;
97 const char *
device,
const char *name,
const char *label,
const char *group,
102 d->typedProperty.setWidgets(d->widgets.data(), d->widgets.size());
103 d->typedProperty.fill(
device, name, label, group, permission, rule, timeout, state);
109 d->typedProperty.setRule(rule);
115 return d->typedProperty.getRule();
121 return d->typedProperty.getRuleAsString();
127 return d->typedProperty.isUpdated(states, names,
n);
133 d->onNewValuesCallback = callback;
PropertyBasicPrivateTemplate(size_t count)
PropertyBasic(PropertyBasicPrivate &dd)
virtual ~PropertySwitchPrivate()
PropertySwitchPrivate(size_t count)
std::string findOnSwitchName() const
void onNewValues(const std::function< void(const NewValues &)> &callback)
bool isSwitchOn(const std::string &name) const
bool update(const ISState states[], const char *const names[], int n)
bool hasUpdateCallback() const
const char * getRuleAsString() const
PropertySwitch(size_t count)
void setRule(ISRule rule)
INDI::WidgetViewSwitch * findOnSwitch() const
bool isUpdated(const ISState states[], const char *const names[], int n) const
int findOnSwitchIndex() const
void fill(const char *device, const char *name, const char *label, const char *group, IPerm permission, ISRule rule, double timeout, IPState state)
Provides generic container for INDI properties.
friend class PropertySwitch
std::shared_ptr< PropertyPrivate > d_ptr
IPerm
Permission hint, with respect to client.
ISRule
Switch vector rule hint.
*brief user defined string literal for JSON values *sa std::size_t n
Namespace to encapsulate INDI client, drivers, and mediator classes.
WidgetView< ISwitch > WidgetViewSwitch