Beispiel #1
0
    void Property::Read(ModuleReader &reader, const MemberHeader &header)
    {
        // Get the module.
        Module *module = GetModule();

        // Read the member attributes.
        ReadAttributes(reader, header.memberAttributes);

        // Read the type, and the number of indices.
        uint8_t numindices;
        uint32_t typeId;
        reader >> typeId >> numindices;

        // Read the indices
        for(size_t i = 0; i < numindices; ++i)
        {
            uint32_t indexTypeId;
            reader >> indexTypeId;
            indices.push_back(module->GetType(indexTypeId));
        }

        // Read the get and set accessor.
        uint32_t getId, setId;
        reader >> getId >> setId;

        // Get the type, getter and setter.
        type = module->GetType(typeId);
        if(getId != 0)
            getAccessor = module->GetFunction(getId);
        if(setId != 0)
            setAccessor = module->GetFunction(setId);
    }
Beispiel #2
0
    void FunctionInstance::Read(ModuleReader &reader, const MemberHeader &header)
    {
        // Read the function id.
        uint32_t functionId;
        reader >> functionId;

        // Get the function.
        Module *module = GetModule();
        function = module->GetFunction(functionId);

        // Read the generic instance
        instance.Read(reader);

        // Use the function generic prototype.
        instance.SetPrototype(function->GetGenericPrototype());
    }