ReflectedTypedef

Represents information about a $typedef declaration in the Xc++ language.


$struct+ ReflectedTypedef
{
    $ConstStringZ GetName() const { return m_name; }

    //////////////// State //////////////////
    ConstStringZ m_name;
    const octet_t* m_bc;       // Specifies type and metadata
    ConstStringZ const* m_stringTable;
};


ConstStringZ m_name

The fully qualified name of the typdef-name represented as a pointer to a UTF-8 encoded null-terminated string (see ConstStringZ).


const octet_t* m_bc

Pointer to an array of octets which is the byte code defining the type.


ConstStringZ const* m_stringTable

The address of an array of pointers to UTF-8 encoded null-terminated strings (see ConstStringZ), which is the string table associated with the byte code defining the type. May be null if no string table is required.

Example

Consider the following $typedef declaration in extended C++. The '+' means reflection information is generated.


namespace ns
{
    $typedef+ ceda::float64 Mass;
}

This generates the following code at the point of definition:


namespace ns
{
    typedef ceda::float64 Mass;
    inline ceda::ConstStringZ GetTypedefName_Mass()
    {
        return "ns::Mass";
    }
}

and the following additional code is appended to a cpp file in order to register a ReflectedTypedef:


//### $typedef+ ns::Mass
namespace ceda { XTarget* Ceda_Core_Object_exObject_GetXTarget(); }
namespace ns
{
    void _Register_Mass()
    {
        static const ceda::octet_t Mass_type[] =
        {
            0x0d
        };
        static const ceda::ReflectedTypedef Mass_typedef =
        {
            "ns::Mass",
            Mass_type,
            0
        };
        cxVerify(ceda::RegisterReflectedTypedef(&Mass_typedef,ceda::Ceda_Core_Object_exObject_GetXTarget()) == ceda::NSE_OK);
    }
} // ns