| #define SQT_COLUMN_ACCESSOR | ( | COLUMN_NAME, | |
| GETTER, | |||
| SETTER ) |
Defines a column that binds to the specified accessor methods of the entity type.
| COLUMN_NAME | The name of the column in the database. It will be also used as the instance name of the column. |
| GETTER | A const member function of the entity type that retrieves the column value from an entity instance. |
| SETTER | A non-const member function of the entity type that assigns the column value to an entity instance. |
This macro is similar to SQT_COLUMN_FIELD, except that it binds to a pair of accessor methods instead of a public member variable.
The getter method must be a const member function that takes no arguments and returns a value. The return type must satisfy the requirements of the sqt::BasicValueType concept. The column's value type is deduced from this return type.
The setter method must be a non-const member function that accepts a value convertible from the getter's return type as its parameter.
Example usage: