Skip to content

Commit a8090b3

Browse files
committed
Const-qualify isConnected() in base
This should be const qualified as it was before. The class state should change on 'update()' and the detector state should change on 'poll()'. This function should never change the class state.
1 parent d50bd66 commit a8090b3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/SimRacing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ bool Peripheral::update() {
366366
return this->updateState(connected);
367367
}
368368

369-
bool Peripheral::isConnected() {
369+
bool Peripheral::isConnected() const {
370370
// if detector exists, return state
371371
if (this->detector) {
372372
return this->detector->isConnected();

src/SimRacing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ namespace SimRacing {
281281
*
282282
* @returns 'true' if the device is connected, 'false' otherwise
283283
*/
284-
bool isConnected();
284+
bool isConnected() const;
285285

286286
/** @copydoc DeviceConnection::setStablePeriod(unsigned long) */
287287
void setStablePeriod(unsigned long t);

0 commit comments

Comments
 (0)