/[gr2lib]/trunk/gr2lib/core/coreclasses/header/granny_header.cs
ViewVC logotype

Diff of /trunk/gr2lib/core/coreclasses/header/granny_header.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/gr2lib/core/coreclasses/header/granny_header.cs	2010/07/17 05:09:42	94
+++ trunk/gr2lib/core/coreclasses/header/granny_header.cs	2010/07/17 05:53:44	97
@@ -1,4 +1,5 @@
-´╗┐using System;
+´╗┐//#define HAVE_GRN_REFERENCE // when defined enabled GRN_REFERNCE in Header, else it is disabled
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -23,8 +24,10 @@
             this.CRC = 0;
             this.SectionArrayOffset = 0;
             this.SectionArrayCount = 0;
+#if HAVE_GRN_REFERENCE
             this.RootObjectTypeDefinition = new granny_reference();
             this.RootObject = new granny_reference();
+#endif
             this.TypeTag = 0;
             this.StringDatabaseCRC = 0;
 
@@ -60,27 +63,21 @@
                 managed.CRC = native.CRC;
                 managed.SectionArrayOffset = native.SectionArrayOffset;
                 managed.SectionArrayCount = native.SectionArrayCount;
-              
+
                 // grn_reference
 
+#if HAVE_GRN_REFERENCE
                 if (native.RootObjectTypeDefinition != IntPtr.Zero)
                 {
                     //managed.RootObjectTypeDefinition = granny_reference.ReadFromMemory(native.RootObjectTypeDefinition);
                     managed.RootObjectTypeDefinition = new granny_reference();
                 }
-                else
-                {
-                    managed.RootObjectTypeDefinition = new granny_reference();
-                }
                 if (native.RootObject != IntPtr.Zero)
                 {
                     //managed.RootObject = granny_reference.ReadFromMemory(native.RootObject);
                     managed.RootObject = new granny_reference();
                 }
-                else
-                {
-                    managed.RootObject = new granny_reference();
-                }
+#endif
 
                 //managed.TypeTag = native.TypeTag;
                 managed.ExtraTags = native.ExtraTags;
@@ -109,8 +106,10 @@
         private Int32 _CRC;
         private Int32 _SectionArrayOffset;
         private Int32 _SectionArrayCount;
+#if HAVE_GRN_REFERENCE
         private granny_reference _RootObjectTypeDefinition;
         private granny_reference _RootObject;
+#endif
         private Int32 _TypeTag;
         private Int32[] _ExtraTags; //4
         private Int32 _StringDatabaseCRC;
@@ -122,8 +121,10 @@
         public Int32 CRC { get { return _CRC; } set { _CRC = value; } }
         public Int32 SectionArrayOffset { get { return _SectionArrayOffset; } set { _SectionArrayOffset = value; } }
         public Int32 SectionArrayCount { get { return _SectionArrayCount; } set { _SectionArrayCount = value; } }
+#if HAVE_GRN_REFERENCE
         public granny_reference RootObjectTypeDefinition { get { return _RootObjectTypeDefinition; } set { _RootObjectTypeDefinition = value; } }
         public granny_reference RootObject { get { return _RootObject; } set { _RootObject = value; } }
+#endif
         public Int32 TypeTag { get { return _TypeTag; } set { _TypeTag = value; } }
         public Int32[] ExtraTags { get { return _ExtraTags; } set { if (value.Length > GrannyGRNExtraTagCount) throw new InvalidOperationException("The size of ExtraTags cannot be greater than " + GrannyGRNExtraTagCount); _ExtraTags = value; } } //4
         public Int32 StringDatabaseCRC { get { return _StringDatabaseCRC; } set { _StringDatabaseCRC = value; } }

 

  ViewVC Help
Powered by ViewVC 1.1.22