gitee.com/curryzheng/dm@v0.0.1/b.go (about)

     1  /*
     2   * Copyright (c) 2000-2018, 达梦数据库有限公司.
     3   * All rights reserved.
     4   */
     5  
     6  package dm
     7  
     8  type ArrayDescriptor struct {
     9  	m_typeDesc *TypeDescriptor
    10  }
    11  
    12  func newArrayDescriptor(fulName string, conn *DmConnection) (*ArrayDescriptor, error) {
    13  
    14  	ad := new(ArrayDescriptor)
    15  
    16  	if fulName == "" {
    17  		return nil, ECGO_INVALID_COMPLEX_TYPE_NAME.throw()
    18  	}
    19  
    20  	ad.m_typeDesc = newTypeDescriptorWithFulName(fulName, conn)
    21  	err := ad.m_typeDesc.parseDescByName()
    22  	if err != nil {
    23  		return nil, err
    24  	}
    25  
    26  	return ad, nil
    27  }
    28  
    29  func newArrayDescriptorByTypeDescriptor(desc *TypeDescriptor) *ArrayDescriptor {
    30  	ad := new(ArrayDescriptor)
    31  	ad.m_typeDesc = desc
    32  	return ad
    33  }
    34  
    35  func (ad *ArrayDescriptor) getMDesc() *TypeDescriptor {
    36  	return ad.m_typeDesc
    37  }
    38  
    39  func (ad *ArrayDescriptor) getItemDesc() *TypeDescriptor {
    40  	return ad.m_typeDesc.m_arrObj
    41  }
    42  
    43  func (ad *ArrayDescriptor) getLength() int {
    44  	return ad.m_typeDesc.m_length
    45  }