Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions h5a.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
)

type Attribute struct {
Location
Identifier
}

func newAttribute(id C.hid_t) *Attribute {
d := &Attribute{Location{Identifier{id}}}
d := &Attribute{Identifier{id}}
runtime.SetFinalizer(d, (*Attribute).finalizer)
return d
}
Expand Down Expand Up @@ -59,9 +59,9 @@ func (s *Attribute) Id() int {
}

// Access the type of an attribute
func (s *Attribute) GetType() Location {
func (s *Attribute) GetType() Identifier {
ftype := C.H5Aget_type(s.id)
return Location{Identifier{ftype}}
return Identifier{ftype}
}

// Close releases and terminates access to an attribute.
Expand Down
4 changes: 2 additions & 2 deletions h5d.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
)

type Dataset struct {
Location
Identifier
}

func newDataset(id C.hid_t) *Dataset {
d := &Dataset{Location{Identifier{id}}}
d := &Dataset{Identifier{id}}
runtime.SetFinalizer(d, (*Dataset).finalizer)
return d
}
Expand Down
2 changes: 1 addition & 1 deletion h5f.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (f *File) finalizer() {
}

func newFile(id C.hid_t) *File {
f := &File{CommonFG{Location{Identifier{id}}}}
f := &File{CommonFG{Identifier{id}}}
runtime.SetFinalizer(f, (*File).finalizer)
return f
}
Expand Down
6 changes: 3 additions & 3 deletions h5g.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

// CommonFG is for methods common to both File and Group
type CommonFG struct {
Location
Identifier
}

// Group is an HDF5 container object. It can contain any Location.
Expand All @@ -37,7 +37,7 @@ func (g *CommonFG) CreateGroup(name string) (*Group, error) {
if err := checkID(hid); err != nil {
return nil, err
}
group := &Group{CommonFG{Location{Identifier{hid}}}}
group := &Group{CommonFG{Identifier{hid}}}
runtime.SetFinalizer(group, (*Group).finalizer)
return group, nil
}
Expand Down Expand Up @@ -87,7 +87,7 @@ func (g *CommonFG) OpenGroup(name string) (*Group, error) {
if err := checkID(hid); err != nil {
return nil, err
}
group := &Group{CommonFG{Location{Identifier{hid}}}}
group := &Group{CommonFG{Identifier{hid}}}
runtime.SetFinalizer(group, (*Group).finalizer)
return group, nil
}
Expand Down
7 changes: 1 addition & 6 deletions h5i.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ type Identifier struct {
id C.hid_t
}

// A Location embeds Identifier. Dataset, Datatype and Group are all Locations.
type Location struct {
Identifier
}

// Id returns the int value of an identifier.
func (i Identifier) Id() int {
return int(i.id)
Expand Down Expand Up @@ -64,7 +59,7 @@ func (i Identifier) File() *File {
if fid < 0 {
return nil
}
return &File{CommonFG{Location{Identifier{fid}}}}
return &File{CommonFG{Identifier{fid}}}
}

// Type returns the type of the identifier.
Expand Down
4 changes: 2 additions & 2 deletions h5pt.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import (

// Table is an hdf5 packet-table.
type Table struct {
Location
Identifier
}

func newPacketTable(id C.hid_t) *Table {
t := &Table{Location{Identifier{id}}}
t := &Table{Identifier{id}}
runtime.SetFinalizer(t, (*Table).finalizer)
return t
}
Expand Down
10 changes: 5 additions & 5 deletions h5t.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

type Datatype struct {
Location
Identifier
}

type TypeClass C.H5T_class_t
Expand Down Expand Up @@ -105,7 +105,7 @@ func OpenDatatype(c CommonFG, name string, tapl_id int) (*Datatype, error) {

// NewDatatype creates a Datatype from an hdf5 id.
func NewDatatype(id C.hid_t) *Datatype {
t := &Datatype{Location{Identifier{id}}}
t := &Datatype{Identifier{id}}
runtime.SetFinalizer(t, (*Datatype).finalizer)
return t
}
Expand Down Expand Up @@ -208,7 +208,7 @@ func NewArrayType(base_type *Datatype, dims []int) (*ArrayType, error) {
if err := checkID(hid); err != nil {
return nil, err
}
t := &ArrayType{Datatype{Location{Identifier{hid}}}}
t := &ArrayType{Datatype{Identifier{hid}}}
runtime.SetFinalizer(t, (*ArrayType).finalizer)
return t, nil
}
Expand Down Expand Up @@ -246,7 +246,7 @@ func NewVarLenType(base_type *Datatype) (*VarLenType, error) {
if err := checkID(id); err != nil {
return nil, err
}
t := &VarLenType{Datatype{Location{Identifier{id}}}}
t := &VarLenType{Datatype{Identifier{id}}}
runtime.SetFinalizer(t, (*VarLenType).finalizer)
return t, nil
}
Expand All @@ -267,7 +267,7 @@ func NewCompoundType(size int) (*CompoundType, error) {
if err := checkID(id); err != nil {
return nil, err
}
t := &CompoundType{Datatype{Location{Identifier{id}}}}
t := &CompoundType{Datatype{Identifier{id}}}
runtime.SetFinalizer(t, (*CompoundType).finalizer)
return t, nil
}
Expand Down
Loading