Exemplo n.º 1
0
        /// <summary>
        /// gets the types which must be mapped before type (the already mapped and the not already mapped ones).
        /// For those types, an include is needed before the type definition starts
        /// </summary>
        /// <param name="depInfo"></param>
        public IList GetTypesToIncludeBeforeType()
        {
            ArrayList result = new ArrayList();

            // inheritance deps must be mapped before type
            InsertInheritanceTypesBefore(false, result); // do not check for already mapped here

            // insert all already mapped types, this type depends on
            foreach (MapTypeInfo info in m_dependenciesContent)
            {
                Debug.WriteLine("getTypesToIncludeBefore-content: " + ForType +
                                ", pot include: " + info.Type + ", already mapped: " + m_manager.CheckMapped(info) +
                                ", is fwd ref possible: " + info.IsForwardDeclPossible);
                if (!info.IsForwardDeclPossible && (!m_manager.IsDefaultMapped(info.Type)))
                {
                    // need to add an include, if no forward declaration is possible
                    // do always use forward declarations if possible to prevent cyclic includes!
                    // for default idl types, don't add an include!
                    Debug.WriteLine("add it");
                    result.Add(info);
                }
            }

            return(result);
        }