b.go 913 B

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