public long getFID() { if (fileFormat != null) { return(fileFormat.getFID()); } else { return(-1); } }
/** * Returns the list of members of this group. The list is an java.util.List * containing HObjects. * * @return the list of members of this group. */ public List <HObject> getMemberList() { FileFormat theFile = this.getFileFormat(); if ((memberList == null) && (theFile != null)) { int size = Math.Min(getNumberOfMembersInFile(), getFileFormat().getMaxMembers()); memberList = new List <HObject>(size + 5); // avoid infinite loop search for groups without members // find the memberList from the file by checking the group path and // name. group may be created out of the structure tree // (H4/5File.loadTree()). if (theFile.getFID() < 0) { try { theFile.open(); } // load the file structure; catch (Exception ex) { ; } } HObject root = theFile.getRootObject(); if (root == null) { return(memberList); } foreach (HObject uObj in ((Group)root).depthFirstMemberList()) { if (uObj is Group g) { if (g.getPath() != null) // add this check to get rid of null exception { if ((this.isRoot() && g.isRoot()) || (this.getPath().Equals(g.getPath()) && g.getName().EndsWith(this.getName()))) { memberList = g.getMemberList(); break; } } } } } return(memberList); }
public H5Group(FileFormat theFile, string name, string path, Group parent, IntPtr oid) : base(theFile, name, path, parent, oid) { nMembersInFile = -1; obj_info = new H5O.info_t(); if (theFile != null) { // throw new Exception("??"); // retrieve the object ID try { IntPtr ptr = new IntPtr(); var reference = H5R.create(ptr, theFile.getFID(), this.getFullName(), H5R.type_t.OBJECT, -1); //todo: address = ptr; //this.oid = new long[1]; //this.oid[0] = HDFNativeData.byteToLong(ref_buf, 0); } catch (Exception ex) { Hdf5Utils.LogError?.Invoke("ERROR: " + ex); } } }