Declaration of a property satisfies the following syntax:
(37) <property> ::= "property" [ "<" [ <propattr_vals> ] ">" ] <type> <identifier> ";" |
Property declaration consists of an optional list of property attribute assignments, the property type and the property name. Property types are described in Section 10.13, “Property and Argument Types”.
It's possible to declare properties with the same name in both base and derived class. The IDL will treat them as two different properties, and they should be defined as such in the C++ definition of the classes.
Access to the properties in the C++ classes can be public, protected or private, as long as the classes are properly defined to be friends of their metaobjects, as described in Section 4.3.1, “Implementation”. The access is not specified in the IDL.
![]() | Warning |
---|---|
All class properties must be properly described in the IDL. If you forget to describe some properties, the IDL will be processed and the generated sources will compile without any error, but the properties you forgot to describe will not be serialized, migrated, replicated, or archived at all. |
Property attribute value assignments satisfy the following syntax:
(38) <propattr_vals> ::= <propattr_val> { "," <propattr_val> }* (39) <propattr_val> ::= <boolpropattr_name> | <propattr_name> "=" <const_expr> (40) <boolpropattr_name> ::= <scoped_name> (41) <propattr_name> ::= <scoped_name> |
The following table lists all property attributes defined in src/core/object/object.idl:
Name | Type | Default | Description |
---|---|---|---|
repflags | ReplicationFlags | REPLICATE | This attribute specifies the migration and replication behavior of the property. See Section 7.5.2, “Choosing Properties To Replicate” for more information about the replication and for exhaustive enumeration of possible values. The default value means that the property will be always included in replications. |
ptr_repflags | ReplicationFlags | NONE | This attribute specifies which objects belong to the same migration or replication groups, as described in Section 7.5.3, “Replication and Migration Groups”. It's useless to set value of this attribute on properties that are not pointers, or do not contain pointers. |