zzl.go 919 B

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