Class property setter/getter declaration syntax problem

I’m trying to create a class property for managing application settings in non-volatile memory (e.g. user-adjustable settings remembered between runs, like Settings.Volume, and elegant code like “if (Settings.AccelerometerSupported) then… ). I just can’t make the compiler happy and fear this language may not even support the concept.

I haven’t worked in C++ in decades (am accustomed to higher-level languages), so I may be missing something obvious. Hours googling and attempting dozens of combinations of braces and semicolons have only yielded not-so-helpful compiler errors.

I know I can write public get_this and set_this methods/functions, but I’m trying to be more elegant about it. Can this be done, and if so, can someone help with the syntax? Thanks!


//Configuration/settings support

#ifndef SettingsManager_h
#define SettingsManager_h

#include "Arduino.h"

class SettingsManager
		SettingsManager(int NVRAMOffset=0);
		byte AutoLockDelay {get_AutoLockDelay,set_AutoLockDelay};	//PROBLEM HERE, numerous attempts at combinations of {}; chars not shown
		int _NVRAMOffset;
		void set_AutoLockDelay(byte value);
		byte get_AutoLockDelay();


//Configuration support

#include <Arduino.h>"
#include <EEPROM.h>

#include "SettingsManager.h"

//Offsets into NVRAM
#define	NVRixAutoLockDelaySecs	0

SettingsManager::SettingsManager(int NVRAMOffset)

//AutoLockDelay property
void SettingsManager::setAutoLockDelay(byte value)

byte SettingsManager::getAutoLockDelay()
byte AutoLockDelay {get_AutoLockDelay,set_AutoLockDelay};

If this is supposed to be a function prototype, it is missing the parens wrapping the parameters/arguments.

For example:

byte setAutoDelayLock(int value);

Can this be done, and if so, can someone help with the syntax?

Got it -- no native support. I saw the stackoverflow article(s) in my searches, but was looking for something more elegant. Thanks for the help, all.