Represents information about a member variable of a $model recorded in a ReflectedClass.
$struct+ ReflectedModelField
{
$ConstStringZ GetName() const { return m_name; }
$ssize_t GetOffset() const { return m_offset; }
$bool Present() const { return m_rsn2 == -1; }
$RSN GetRsn1() const { return m_rsn1; }
$RSN GetRsn2() const { return m_rsn2; }
//////////////// State //////////////////
ConstStringZ m_name;
ssize_t m_offset;
const octet_t* m_bc;
RSN m_rsn1;
RSN m_rsn2;
const PtrMapOrSetFns* m_mapOrSetFns;
};
const ReflectedField& AsReflectedField(const ReflectedModelField& rf);
ConstStringZ m_name
The name of the member variable represented as a pointer to a UTF-8 encoded null-terminated string (see ConstStringZ).
ssize_t m_offset
The offset in bytes to the member variable in the containing class, or -1 if the member variable has been dropped.
const octet_t* m_bc
Pointer to an array of octets which is the byte code defining the type of the member variable.
RSN m_rsn1
The RSN when the member variable was added to the containing class
RSN m_rsn2
The RSN when the member variable was dropped from the containing class, or -1 if the member variable is still present.
const PtrMapOrSetFns* m_mapOrSetFns
A PtrMapOrSetFns represents a pointer to the vtable for interface IXMap or IXSet.
A CDM tuple uses a ReflectedModelField for each attribute in the model. A datasource has the concept of a path down through the attributes, and this recurses into nested maps, arrays and tuples. For a given tuple attribute (i.e. ReflectedModelField) we have nested maps and arrays associated with the given byte code. In particular for the nested maps we need to record the XMapFns.
Maps can nest. E.g. map<string, map<string, int> >. Let 'n' denote the total number of map nestings of the field. m_mapFns is the address of an array XMapFns[n], or nullptr if n = 0. As we navigate the path for a given field of a model, we step through the byte code as well as the array.