Exemple #1
0
        private void ReadData()
        {
            // Only read once the data.
            if (readedData)
            {
                return;
            }
            readedData = true;

            ModuleReader reader = new ModuleReader(new MemoryStream(rawData));

            // Get the module.
            ChelaModule module = GetModule();

            // Read the template.
            template = (Structure)module.GetMember(reader.ReadUInt());

            // Read the factory.
            factory = (Scope)module.GetMember(reader.ReadUInt());

            // Read the generic instance.
            genericInstance = GenericInstance.Read(template.GetGenericPrototype(), reader, module);

            // Initialize.
            Initialize(template, genericInstance);
            rawData = null;
        }
Exemple #2
0
        internal override void Read(ModuleReader reader, MemberHeader header)
        {
            // Get the module.
            ChelaModule module = GetModule();

            // Read the type.
            type = module.GetType(reader.ReadUInt());

            // Read the number of indices.
            int numIndices = reader.ReadByte();

            if (numIndices > 0)
            {
                indices = new IChelaType[numIndices];
            }

            // Read the indices.
            for (int i = 0; i < numIndices; ++i)
            {
                indices[i] = module.GetType(reader.ReadUInt());
            }

            // Read the get accessor.
            getAccessor = (Function)module.GetMember(reader.ReadUInt());

            // Read the set accessor.
            setAccessor = (Function)module.GetMember(reader.ReadUInt());
        }
Exemple #3
0
        internal override void Read(ModuleReader reader, MemberHeader header)
        {
            // Get the module.
            ChelaModule module = GetModule();

            // Read the type.
            type = module.GetType(reader.ReadUInt());

            // Read the add modifier.
            addModifier = (Function)module.GetMember(reader.ReadUInt());

            // Read the remove modifier.
            removeModifier = (Function)module.GetMember(reader.ReadUInt());
        }