ocnode.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc.
  2. See the COPYRIGHT file for more information. */
  3. #ifndef OCNODE_H
  4. #define OCNODE_H
  5. /*! Specifies the Diminfo. */
  6. /* Track info purely about declared dimensions.
  7. More information is included in the Dimdata structure (dim.h)
  8. */
  9. typedef struct OCdiminfo {
  10. struct OCnode* array; /* defining array node (if known)*/
  11. unsigned int arrayindex;/* rank position ofthis dimension in the array*/
  12. ocindex_t declsize; /* from DDS*/
  13. } OCdiminfo;
  14. /*! Specifies the Arrayinfo.*/
  15. typedef struct OCarrayinfo {
  16. /* The complete set of dimension info applicable to this node*/
  17. OClist* dimensions;
  18. /* convenience (because they are computed so often*/
  19. unsigned int rank; /* == |dimensions|*/
  20. } OCarrayinfo;
  21. /*! Specifies Attribute info */
  22. typedef struct OCattribute {
  23. char* name;
  24. OCtype etype; /* type of the attribute */
  25. size_t nvalues;
  26. char** values; /* |values| = nvalues*sizeof(char**)*/
  27. } OCattribute;
  28. /*! Specifies the Attinfo.*/
  29. /* This is the form as it comes out of the DAS parser*/
  30. typedef struct OCattinfo {
  31. int isglobal; /* is this supposed to be a global attribute set?*/
  32. OClist* values; /* oclist<char*>*/
  33. } OCattinfo;
  34. /*! Specifies the OCnode. */
  35. typedef struct OCnode {
  36. unsigned int magic;
  37. OCtype octype;
  38. OCtype etype; /* essentially the dap type from the dds*/
  39. char* name;
  40. char* fullname;
  41. struct OCnode* container; /* this node is subnode of container */
  42. struct OCnode* root; /* root node of tree containing this node */
  43. struct OCtree* tree; /* !NULL iff this is a root node */
  44. struct OCnode* datadds; /* correlated datadds node, if any */
  45. OCdiminfo dim; /* octype == OC_Dimension*/
  46. OCarrayinfo array; /* octype == {OC_Structure, OC_Primitive}*/
  47. OCattinfo att; /* octype == OC_Attribute */
  48. /* primary edge info*/
  49. OClist* subnodes; /*oclist<OCnode*>*/
  50. /*int attributed;*/ /* 1 if merge was done*/
  51. OClist* attributes; /* oclist<OCattribute*>*/
  52. struct OCSKIP {/* Support fast skipping ; in following, 0 => undefined */
  53. ocindex_t count; /* no. instances (== dimension cross product); may be indeterminate*/
  54. ocoffset_t instancesize;/*size of single instance; may be indeterminate*/
  55. ocoffset_t totalsize; /* usually: count*instancesize + overhead; may be indeterminate */
  56. ocoffset_t offset; /* mostly for debugging */
  57. } skip;
  58. #ifdef OCIGNORE
  59. struct {/* do simple index cache */
  60. int cacheable; /* is this object cacheable? */
  61. int valid; /* is this cache valid */
  62. ocindex_t index; /* last index */
  63. ocoffset_t offset; /* position of the last indexed instance */
  64. } cache;
  65. #endif
  66. } OCnode;
  67. #if SIZEOF_SIZE_T == 4
  68. #define OCINDETERMINATE ((size_t)0xffffffff)
  69. #endif
  70. #if SIZEOF_SIZE_T == 8
  71. #define OCINDETERMINATE ((size_t)0xffffffffffffffff)
  72. #endif
  73. #endif /*OCNODE_H*/