/// <summary>
        /// This is a helper method that makes it simple to run an AOT compilation on the given type.
        /// </summary>
        /// <param name="type">The type to perform the AOT compilation on.</param>
        /// <param name="aotCompiledClassInCSharp">The AOT class. Add this C# code to your project.</param>
        /// <returns>True if AOT compilation was successful.</returns>
        public static bool TryToPerformAotCompilation(Type type, Config p_config, out string aotCompiledClassInCSharp)
        {
            if (MetaTypeCache.GetInGlobalCache(type, p_config).EmitAotData())
            {
                aotCompiledClassInCSharp = AvailableAotCompilations[type];
                return(true);
            }

            aotCompiledClassInCSharp = default(string);
            return(false);
        }
Esempio n. 2
0
        public MetaType Get(Type type)
        {
            MetaType metaType = null;

            if (!_metaTypes.TryGetValue(type, out metaType))
            {
                metaType         = MetaTypeCache.GetInGlobalCache(type, _configUsed);
                _metaTypes[type] = metaType;
            }
            return(metaType);
        }