gitee.com/curryzheng/dm@v0.0.1/zzm.go (about) 1 /* 2 * Copyright (c) 2000-2018, 达梦数据库有限公司. 3 * All rights reserved. 4 */ 5 6 package dm 7 8 type StructDescriptor struct { 9 m_typeDesc *TypeDescriptor 10 } 11 12 func newStructDescriptor(fulName string, conn *DmConnection) (*StructDescriptor, error) { 13 sd := new(StructDescriptor) 14 if fulName == "" { 15 return nil, ECGO_INVALID_COMPLEX_TYPE_NAME.throw() 16 } 17 18 sd.m_typeDesc = newTypeDescriptorWithFulName(fulName, conn) 19 20 err := sd.m_typeDesc.parseDescByName() 21 if err != nil { 22 return nil, err 23 } 24 25 return sd, nil 26 } 27 28 func newStructDescriptorByTypeDescriptor(desc *TypeDescriptor) *StructDescriptor { 29 sd := new(StructDescriptor) 30 sd.m_typeDesc = desc 31 return sd 32 } 33 34 func (sd *StructDescriptor) getSize() int { 35 return sd.m_typeDesc.m_size 36 } 37 38 func (sd *StructDescriptor) getObjId() int { 39 return sd.m_typeDesc.m_objId 40 } 41 42 func (sd *StructDescriptor) getItemsDesc() []TypeDescriptor { 43 return sd.m_typeDesc.m_fieldsObj 44 }