private void Initialize()

in SharpGen.Platform/CppParser.cs [75:127]


        private void Initialize()
        {
            foreach (var bindRule in _configRoot.ConfigFilesLoaded.SelectMany(cfg => cfg.Bindings))
                _boundTypes.Add(bindRule.From);

            foreach (var configFile in _configRoot.ConfigFilesLoaded)
            {
                foreach (var includeRule in configFile.Includes)
                {
                    _includeToProcess.Add(includeRule.Id);

                    // Handle attach types
                    // Set that the include is attached (so that all types inside are attached
                    var isIncludeFullyAttached = includeRule.Attach ?? false;
                    if (isIncludeFullyAttached || includeRule.AttachTypes.Count > 0)
                    {
                        // An include can be fully attached ( include rule is set to true)
                        // or partially attached (the include rule contains Attach for specific types)
                        // We need to know which includes are attached, if they are fully or partially
                        if (!_includeIsAttached.ContainsKey(includeRule.Id))
                            _includeIsAttached.Add(includeRule.Id, isIncludeFullyAttached);
                        else if (isIncludeFullyAttached)
                        {
                            _includeIsAttached[includeRule.Id] = true;
                        }

                        // Attach types if any
                        if (includeRule.AttachTypes.Count > 0)
                        {
                            if (!_includeAttachedTypes.TryGetValue(includeRule.Id, out HashSet<string> typesToAttach))
                            {
                                typesToAttach = new HashSet<string>();
                                _includeAttachedTypes.Add(includeRule.Id, typesToAttach);
                            }

                            // For specific attach types, register them
                            foreach (var attachTypeName in includeRule.AttachTypes)
                            {
                                typesToAttach.Add(attachTypeName);
                            }
                        }
                    }
                }

                // Register extension headers
                if (configFile.Extension.Any(rule => rule.GeneratesExtensionHeader()))
                {
                    _includeToProcess.Add(configFile.ExtensionId);
                    if (!_includeIsAttached.ContainsKey(configFile.ExtensionId))
                        _includeIsAttached.Add(configFile.ExtensionId, true);
                }
            }
        }