Ejemplo n.º 1
0
        public bool IsFixedType()
        {
            NcTypeEnum nc_type = GetTypeClass();

            if (nc_type == NcTypeEnum.NC_VLEN || nc_type == NcTypeEnum.NC_OPAQUE || nc_type == NcTypeEnum.NC_ENUM ||
                nc_type == NcTypeEnum.NC_COMPOUND)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 2
0
 public HashSet<NcType> GetTypes(string name, NcTypeEnum enumType, Location location=Location.Current) {
     CheckNull();
     Dictionary<string, NcType> types = GetTypes(location);
     HashSet<NcType> ncTypes = new HashSet<NcType>();
     foreach(KeyValuePair<string, NcType> k in types) {
         if(k.Value.GetTypeClass() == enumType && k.Key == name)
             ncTypes.Add(k.Value);
     }
     return ncTypes;
 }
Ejemplo n.º 3
0
        public int GetTypeCount(NcTypeEnum enumType, Location location=Location.Current) {
            CheckNull();
            Int32 ntypes=0;
            // search in current group
            if(location == Location.Current || location == Location.ParentsAndCurrent 
                                                        || location == Location.ChildrenAndCurrent
                                                        || location == Location.All) {
                Int32 ntypesp=0;
                Int32[] typeidsp = null;
                NcCheck.Check(NetCDF.nc_inq_typeids(myId, ref ntypesp, typeidsp));
                typeidsp = new Int32[ntypesp];
                NcCheck.Check(NetCDF.nc_inq_typeids(myId, ref ntypesp, typeidsp));

                foreach(Int32 i in typeidsp) {
                    NcType typeTmp = new NcType(this,i);
                    if(typeTmp.GetTypeClass() == enumType)
                        ntypes++;
                }
            }

            // search in parent groups
            if(location == Location.Parents || location == Location.ParentsAndCurrent 
                                                        || location == Location.All) {
                Dictionary<string, NcGroup> groups = GetGroups(GroupLocation.ParentsGrps);
                foreach(KeyValuePair<string, NcGroup> k in groups) {
                    ntypes += k.Value.GetTypeCount(enumType);
                }
            }

            // search in children groups
            if(location == Location.Children || location == Location.ChildrenAndCurrent
                                                        || location == Location.All) {
                Dictionary<string, NcGroup> groups = GetGroups(GroupLocation.AllChildrenGrps);
                foreach(KeyValuePair<string, NcGroup> k in groups) {
                    ntypes += k.Value.GetTypeCount(enumType);
                }
            }
            return ntypes;
        }