Pass value object attributes by reference (instead of pointer)
This underlines that no reference inside the setter is taken, and that these attributes are non-nullable. Also removes a couple of superfluous attribute macros.
This commit is contained in:
parent
5549ff78f0
commit
c9d5059238
29 changed files with 92 additions and 110 deletions
src
16
src/util.h
16
src/util.h
|
@ -152,20 +152,4 @@ inline C *dataPtr(std::vector<C> &v)
|
|||
#define DEF_ATTR_SIMPLE_STATIC(klass, name, type, location) \
|
||||
DEF_ATTR_SIMPLE_DETAILED(klass, name, type, location, )
|
||||
|
||||
#define DEF_ATTR_OBJ_VALUE(klass, name, type, location) \
|
||||
DEF_ATTR_RD_SIMPLE_DETAILED(klass, name, type, location, const) \
|
||||
void klass :: set##name(type value) \
|
||||
{ \
|
||||
guardDisposed(); \
|
||||
*location = *value; \
|
||||
}
|
||||
|
||||
#define DEF_ATTR_OBJ_VALUE_STATIC(klass, name, type, location) \
|
||||
DEF_ATTR_RD_SIMPLE_DETAILED(klass, name, type, location, ) \
|
||||
void klass :: set##name(type value) \
|
||||
{ \
|
||||
guardDisposed(); \
|
||||
*location = *value; \
|
||||
}
|
||||
|
||||
#endif // UTIL_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue