ro() public method

public ro ( ) : List
return List
Example #1
0
 public static List list()
 {
     lock (m_podsByName)
     {
         // TODO - eventually we need a faster way to load
         //  pod meta-data into memory without actually loading
         //  every pod into memory
         if (m_allPodsList == null)
         {
             List names = Env.cur().findAllPodNames();
             List pods  = new List(Sys.PodType);
             for (int i = 0; i < names.sz(); ++i)
             {
                 string name = (string)names.get(i);
                 try
                 {
                     pods.add(doFind(name, true, null));
                 }
                 catch (Exception e)
                 {
                     System.Console.WriteLine("ERROR: Invalid pod file: " + name);
                     Err.dumpStack(e);
                 }
             }
             m_allPodsList = pods.ro();
         }
         return(m_allPodsList);
     }
 }
Example #2
0
        //////////////////////////////////////////////////////////////////////////
        // Load
        //////////////////////////////////////////////////////////////////////////

        internal void load(FPod fpod)
        {
            this.fpod        = fpod;
            this.typesByName = new Hashtable();

            // create a hollow Type for each FType (this requires two steps,
            // because we don't necessary have all the Types created for
            // superclasses until this loop completes)
            m_types = new ClassType[fpod.m_types.Length];
            for (int i = 0; i < fpod.m_types.Length; i++)
            {
                // create type instance
                ClassType type = new ClassType(this, fpod.m_types[i]);

                // add to my data structures
                m_types[i] = type;
                if (typesByName[type.m_name] != null)
                {
                    throw Err.make("Invalid pod: " + m_name + " type already defined: " + type.m_name).val;
                }
                typesByName[type.m_name] = type;
            }

            // get TypeType to use for mixin List (we need to handle case
            // when loading sys itself - and lookup within my own pod)
            Type typeType = Sys.TypeType;

            if (typeType == null)
            {
                typeType = (Type)typesByName["Type"];
            }

            // now that everthing is mapped, we can fill in the super
            // class fields (unless something is wacked, this will only
            // use Types in my pod or in pods already loaded)
            for (int i = 0; i < fpod.m_types.Length; i++)
            {
                FType     ftype = fpod.m_types[i];
                ClassType type  = m_types[i];
                type.m_base = findType(ftype.m_base);

                List mixins = new List(typeType, ftype.m_mixins.Length);
                for (int j = 0; j < ftype.m_mixins.Length; j++)
                {
                    mixins.add(findType(ftype.m_mixins[j]));
                }
                type.m_mixins = mixins.ro();
            }
        }
Example #3
0
 public static List findAll(Type t)
 {
     string qname = t.qname();
       List list = new List(Sys.ServiceType);
       lock (m_lock)
       {
     Node node = (Node)byType[qname];
     while (node != null)
     {
       list.add(node.service);
       node = node.next;
     }
       }
       return list.ro();
 }
Example #4
0
        public static List listFullNames()
        {
            List list = new List(Sys.StrType);

            for (int i = 0; i < indexNames.Length; ++i)
            {
                string prefix = prefixes[indexPrefixes[i] & 0xff];
                string name   = indexNames[i];
                if (prefix.Length != 0)
                {
                    name = prefix + "/" + name;
                }
                list.add(name);
            }
            return(list.ro());
        }
Example #5
0
        public static List findAll(Type t)
        {
            string qname = t.qname();
            List   list  = new List(Sys.ServiceType);

            lock (m_lock)
            {
                Node node = (Node)byType[qname];
                while (node != null)
                {
                    list.add(node.service);
                    node = node.next;
                }
            }
            return(list.ro());
        }
Example #6
0
        /// <summary>
        /// Constructor used by GenericType and we are given the generic
        /// method that is being parameterized.
        /// </summary>
        public Method(Type parent, string name, int flags, Facets facets, int lineNum, Type returns, Type inheritedReturns, List pars, Method generic)
            : base(parent, name, flags, facets, lineNum)
        {
            List fparams = pars.ro();
              if ((flags & (FConst.Static|FConst.Ctor)) == 0)
              {
            object[] temp = new object[pars.sz()+1];
            temp[0] = new Param("this", parent, 0);
            pars.copyInto(temp, 1, pars.sz());
            fparams = new List(Sys.ParamType, temp);
              }

              this.m_func = new MethodFunc(this, returns, fparams);
              this.m_params = pars;
              this.m_inheritedReturns = inheritedReturns;
              this.m_mask = (generic != null) ? 0 : toMask(parent, returns, pars);
              this.m_generic = generic;
        }
Example #7
0
        /// <summary>
        /// Constructor used by GenericType and we are given the generic
        /// method that is being parameterized.
        /// </summary>
        public Method(Type parent, string name, int flags, Facets facets, int lineNum, Type returns, Type inheritedReturns, List pars, Method generic)
            : base(parent, name, flags, facets, lineNum)
        {
            List fparams = pars.ro();

            if ((flags & (FConst.Static | FConst.Ctor)) == 0)
            {
                object[] temp = new object[pars.sz() + 1];
                temp[0] = new Param("this", parent, 0);
                pars.copyInto(temp, 1, pars.sz());
                fparams = new List(Sys.ParamType, temp);
            }

            this.m_func             = new MethodFunc(this, returns, fparams);
            this.m_params           = pars;
            this.m_inheritedReturns = inheritedReturns;
            this.m_mask             = (generic != null) ? 0 : toMask(parent, returns, pars);
            this.m_generic          = generic;
        }
Example #8
0
File: TimeZone.cs Project: xored/f4
 public static List listFullNames()
 {
     List list = new List(Sys.StrType);
       for (int i=0; i<indexNames.Length; ++i)
       {
     string prefix = prefixes[indexPrefixes[i] & 0xff];
     string name = indexNames[i];
     if (prefix.Length != 0) name = prefix + "/" + name;
     list.add(name);
       }
       return list.ro();
 }
Example #9
0
 internal Version(List segments)
 {
     this.m_segments = segments.ro();
 }
Example #10
0
 internal Version(List segments)
 {
     this.m_segments = segments.ro();
 }
Example #11
0
File: Pod.cs Project: nomit007/f4
        //////////////////////////////////////////////////////////////////////////
        // Load
        //////////////////////////////////////////////////////////////////////////
        internal void load(FPod fpod)
        {
            this.fpod = fpod;
              this.typesByName = new Hashtable();

              // create a hollow Type for each FType (this requires two steps,
              // because we don't necessary have all the Types created for
              // superclasses until this loop completes)
              m_types = new ClassType[fpod.m_types.Length];
              for (int i=0; i<fpod.m_types.Length; i++)
              {
            // create type instance
            ClassType type = new ClassType(this, fpod.m_types[i]);

            // add to my data structures
            m_types[i] = type;
            if (typesByName[type.m_name] != null)
              throw Err.make("Invalid pod: " + m_name + " type already defined: " + type.m_name).val;
            typesByName[type.m_name] = type;
              }

              // get TypeType to use for mixin List (we need to handle case
              // when loading sys itself - and lookup within my own pod)
              Type typeType = Sys.TypeType;
              if (typeType == null)
            typeType = (Type)typesByName["Type"];

              // now that everthing is mapped, we can fill in the super
              // class fields (unless something is wacked, this will only
              // use Types in my pod or in pods already loaded)
              for (int i=0; i<fpod.m_types.Length; i++)
              {
            FType ftype = fpod.m_types[i];
            ClassType type = m_types[i];
            type.m_base = findType(ftype.m_base);

            List mixins = new List(typeType, ftype.m_mixins.Length);
            for (int j=0; j<ftype.m_mixins.Length; j++)
              mixins.add(findType(ftype.m_mixins[j]));
            type.m_mixins = mixins.ro();
              }
        }
Example #12
0
File: Pod.cs Project: nomit007/f4
 public static List list()
 {
     lock (m_podsByName)
       {
     // TODO - eventually we need a faster way to load
     //  pod meta-data into memory without actually loading
     //  every pod into memory
     if (m_allPodsList == null)
     {
       List names = Env.cur().findAllPodNames();
       List pods = new List(Sys.PodType);
       for (int i=0; i<names.sz(); ++i)
       {
     string name = (string)names.get(i);
     try
     {
       pods.add(doFind(name, true, null));
     }
     catch (Exception e)
     {
       System.Console.WriteLine("ERROR: Invalid pod file: " + name);
       Err.dumpStack(e);
     }
       }
       m_allPodsList = pods.ro();
     }
     return m_allPodsList;
       }
 }