qxLib
Macros
property.h File Reference

Go to the source code of this file.

Macros

#define QX_GETTER(type, name)
 Fast C#-like getter. More...
 
#define QX_GETTER_REF(type, name)
 Fast C#-like ref getter. More...
 
#define QX_SETTER(type, name)
 Fast C#-like setter. More...
 
#define QX_PROPERTY(type, name, ...)
 A set of data member, getter and setter. More...
 

Detailed Description

Author
Khrapov
Date
7.08.2022

Definition in file property.h.

Macro Definition Documentation

◆ QX_GETTER

#define QX_GETTER (   type,
  name 
)
Value:
const type& Get##name() const \
{ \
return m_##name; \
}

Fast C#-like getter.

Parameters
type- value type
name- value name

Definition at line 17 of file property.h.

◆ QX_GETTER_REF

#define QX_GETTER_REF (   type,
  name 
)
Value:
type& Get##name() \
{ \
return m_##name; \
}

Fast C#-like ref getter.

Parameters
type- value type
name- value name

Definition at line 29 of file property.h.

◆ QX_PROPERTY

#define QX_PROPERTY (   type,
  name,
  ... 
)
Value:
public: \
QX_GETTER(type, name); \
QX_SETTER(type, name); \
\
private: \
type m_##name = type(__VA_ARGS__)

A set of data member, getter and setter.

Parameters
type- data type
name- data name
...- data default value

Definition at line 55 of file property.h.

◆ QX_SETTER

#define QX_SETTER (   type,
  name 
)
Value:
void Set##name(const type& val) \
{ \
m_##name = val; \
}

Fast C#-like setter.

Parameters
type- value type
name- value name

Definition at line 42 of file property.h.