Exemplo n.º 1
0
 private Config(MetaTypeCache p_metaTypeCache)
 {
     if (p_metaTypeCache == null)
     {
         p_metaTypeCache = new MetaTypeCache(this);
     }
     _metaTypeCache = p_metaTypeCache;
 }
        /// <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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
 public Config()
 {
     _metaTypeCache = new MetaTypeCache(this);
 }