#ifndef _PROPERTIES_H
#define _PROPERTIES_H

#if 0
// https://www.codeproject.com/Articles/118921/C-Properties

#define PROPERTY(t,n)  __declspec( property ( put = property__set_##n, get = property__get_##n ) ) t n;\
	typedef t property__tmp_type_##n
#define READONLY_PROPERTY(t,n) __declspec( property (get = property__get_##n) ) t n;\
	typedef t property__tmp_type_##n
#define WRITEONLY_PROPERTY(t,n) __declspec( property (put = property__set_##n) ) t n;\
	typedef t property__tmp_type_##n

#define GET(n) property__tmp_type_##n property__get_##n()
#define SET(n) void property__set_##n(const property__tmp_type_##n& value)
#endif


#define PROPERTY(t, n, def, getter, setter) \
	protected: \
		t n=def; \
	public: \
		inline const t& getter() {return n;} \
		inline void setter(const t& value) {n =value;}

#define READONLY_PROPERTY(t, n, def, getter) \
	protected: \
		t n=def; \
	public: \
		inline const t& getter() {return n;} 

#define WRITEONLY_PROPERTY(t, n, def, getter) \
	protected: \
		t n=def; \
	public: \
		inline void setter(const t& value) {n =value;}

#define POINTER_PROPERTY(t, n, def, getter, setter) \
	protected: \
		t * n=def; \
	public: \
		inline t* getter() {return n;} \
		inline void setter( t * value) {n =value;}

#define READONLY_POINTER_PROPERTY(t, n, def, getter) \
	protected: \
		t *n=def; \
	public: \
		inline t* getter() {return n;}

#define WRITEONLY_POINTER_PROPERTY(t, n, def, getter) \
	protected: \
		t *n=def; \
	public: \
		inline void setter( t* value) {n =value;}

#endif /* _PROPERTIES_H */ 