[cig-commits] r6075 - in long/3D/Gale/trunk/src/StGermain: .
Base/Automation/src
walter at geodynamics.org
walter at geodynamics.org
Fri Feb 23 10:00:54 PST 2007
Author: walter
Date: 2007-02-23 10:00:54 -0800 (Fri, 23 Feb 2007)
New Revision: 6075
Modified:
long/3D/Gale/trunk/src/StGermain/
long/3D/Gale/trunk/src/StGermain/Base/Automation/src/Variable.c
long/3D/Gale/trunk/src/StGermain/Base/Automation/src/Variable.h
Log:
r3326 at earth (orig r3987): LukeHodkinson | 2007-01-29 14:01:10 -0800
Adding an extra member on the Variable class so
that vector valued variables can ensure their
parents are built before themselves.
Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
- 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3196
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/branches/decomp3d/StGermain:3981
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3899
+ 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3196
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/branches/decomp3d/StGermain:3987
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3899
Modified: long/3D/Gale/trunk/src/StGermain/Base/Automation/src/Variable.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/Automation/src/Variable.c 2007-02-23 18:00:50 UTC (rev 6074)
+++ long/3D/Gale/trunk/src/StGermain/Base/Automation/src/Variable.c 2007-02-23 18:00:54 UTC (rev 6075)
@@ -395,6 +395,7 @@
self->structSizePtr = structSizePtr;
self->arraySizePtr = arraySizePtr;
self->arrayPtrPtr = arrayPtrPtr;
+ self->parent = NULL;
/* Use of this class has increased... can't assume the info arrays are on persistant memory... copy by default. They will
be deleted. */
@@ -460,6 +461,7 @@
self->arraySizePtr,
self->arrayPtrPtr,
vr );
+ self->components[component_I]->parent = self;
}
}
}
@@ -503,6 +505,7 @@
self->arraySizePtr,
self->arrayPtrPtr,
vr );
+ self->components[vector_I]->parent = self;
}
}
}
@@ -740,6 +743,9 @@
void _Variable_Build( void* variable, void* data ) {
Variable* self = (Variable*)variable;
Index component_I;
+
+ if( self->parent )
+ Build( self->parent, NULL, False );
/* Obtain the actual array size, and array pointer */
Journal_Firewall(
Modified: long/3D/Gale/trunk/src/StGermain/Base/Automation/src/Variable.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/Automation/src/Variable.h 2007-02-23 18:00:50 UTC (rev 6074)
+++ long/3D/Gale/trunk/src/StGermain/Base/Automation/src/Variable.h 2007-02-23 18:00:54 UTC (rev 6075)
@@ -85,7 +85,9 @@
Index arraySize; /**< The size/count of the 1D array of structures. */ \
Variable** components; /**< For each component of this variable that we made a variable for, the pointer to the variable. */ \
Bool allocateSelf; \
- Variable_Register* vr;
+ Variable_Register* vr; \
+ \
+ Variable* parent;
struct _Variable { __Variable };
@@ -295,7 +297,7 @@
/** Implementation of "get" the structure in an array that the requested data member is in if CAUTIOUS is defined.
* It ensures that array_I is within its bounds. Private (Do not directly use!) */
#define _Variable_GetStructPtr( self, array_I ) \
- ( (array_I) < (self)->arraySize ? \
+ ( ((array_I) < (self)->arraySize) ? \
__Variable_GetStructPtr( (self), (array_I) ) : \
/*TODO : call J_Firewall, then return NULL. */ \
(void*)(Journal_Firewall( \
@@ -320,7 +322,7 @@
/** Implementation of "get" the requested data member in a structure in an array if CAUTIOUS is defined.
* It ensures that component_I and array_I are within its bounds. Private (Do not directly use!) */
#define _Variable_GetPtr( self, array_I, component_I, vector_I ) \
- ( (component_I) < (self)->offsetCount ? \
+ ( ((component_I) < (self)->offsetCount) ? \
__Variable_GetPtr( (self), (array_I), (component_I), (vector_I) ) :\
(void*)(Journal_Firewall( \
0, \
@@ -346,7 +348,7 @@
/** Assuming this is a Variable of a "char" inbuilt type, return a pointer to that char (type casted to char*).
* It ensures the Variable is of a "char" and is not complex. */
#define Variable_GetPtrChar( self, array_I ) \
- ( (self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Char ? \
+ ( ((self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Char) ? \
_Variable_GetPtrChar( (self), (array_I) ) : \
(char*)(Journal_Firewall( \
0, \
@@ -366,7 +368,7 @@
/** Assuming this is a Variable of a vector "char" inbuilt type, return that char. It ensures that vector_I is
* within range. */
#define Variable_GetValueAtChar( self, array_I, vector_I ) \
- ( (vector_I) < (self)->dataTypeCounts[0] ? \
+ ( ((vector_I) < (self)->dataTypeCounts[0]) ? \
_Variable_GetValueAtChar( (self), (array_I), (vector_I) ) : \
(char)Journal_Firewall( \
0, \
@@ -450,7 +452,7 @@
/** Assuming this is a Variable of a "short" inbuilt type, return a pointer to that short (type casted to short*).
* It ensures the Variable is of a "short" and is not complex. */
#define Variable_GetPtrShort( self, array_I ) \
- ( (self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Short ? \
+ ( ((self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Short) ? \
_Variable_GetPtrShort( (self), (array_I) ) : \
(short*)(Journal_Firewall( \
0, \
@@ -470,7 +472,7 @@
/** Assuming this is a Variable of a vector "short" inbuilt type, return that short. It ensures that vector_I is
* within range. */
#define Variable_GetValueAtShort( self, array_I, vector_I ) \
- ( (vector_I) < (self)->dataTypeCounts[0] ? \
+ ( ((vector_I) < (self)->dataTypeCounts[0]) ? \
_Variable_GetValueAtShort( (self), (array_I), (vector_I) ) : \
(short)Journal_Firewall( \
0, \
@@ -555,7 +557,7 @@
/** Assuming this is a Variable of a "int" inbuilt type, return a pointer to that int (type casted to int*).
* It ensures the Variable is of a "int" and is not complex. */
#define Variable_GetPtrInt( self, array_I ) \
- ( (self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Int ? \
+ ( ((self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Int) ? \
_Variable_GetPtrInt( (self), (array_I) ) : \
(int*)(Journal_Firewall( \
0, \
@@ -575,7 +577,7 @@
/** Assuming this is a Variable of a vector "int" inbuilt type, return that int. It ensures that vector_I is
* within range. */
#define Variable_GetValueAtInt( self, array_I, vector_I ) \
- ( (vector_I) < (self)->dataTypeCounts[0] ? \
+ ( ((vector_I) < (self)->dataTypeCounts[0]) ? \
_Variable_GetValueAtInt( (self), (array_I), (vector_I) ) : \
(int)Journal_Firewall( \
0, \
@@ -658,7 +660,7 @@
/** Assuming this is a Variable of a "float" inbuilt type, return a pointer to that float (type casted to float*).
* It ensures the Variable is of a "float" and is not complex. */
#define Variable_GetPtrFloat( self, array_I ) \
- ( (self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Float ? \
+ ( ((self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Float) ? \
_Variable_GetPtrFloat( (self), (array_I) ) : \
(float*)(Journal_Firewall( \
0, \
@@ -678,7 +680,7 @@
/** Assuming this is a Variable of a vector "float" inbuilt type, return that float. It ensures that vector_I is
* within range. */
#define Variable_GetValueAtFloat( self, array_I, vector_I ) \
- ( (vector_I) < (self)->dataTypeCounts[0] ? \
+ ( ((vector_I) < (self)->dataTypeCounts[0]) ? \
_Variable_GetValueAtFloat( (self), (array_I), (vector_I) ) : \
(float)Journal_Firewall( \
0, \
@@ -763,7 +765,7 @@
/** Assuming this is a Variable of a "double" inbuilt type, return a pointer to that double (type casted to
* double*). It ensures the Variable is of a "double" and is not complex. */
#define Variable_GetPtrDouble( self, array_I ) \
- ( (self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Double ? \
+ ( ((self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Double) ? \
_Variable_GetPtrDouble( (self), (array_I) ) : \
(double*)(Journal_Firewall( \
0, \
@@ -783,7 +785,7 @@
/** Assuming this is a Variable of a vector "double" inbuilt type, return that double. It ensures that vector_I is
* within range. */
#define Variable_GetValueAtDouble( self, array_I, vector_I ) \
- ( (vector_I) < (self)->dataTypeCounts[0] ? \
+ ( ((vector_I) < (self)->dataTypeCounts[0]) ? \
_Variable_GetValueAtDouble( (self), (array_I), (vector_I) ) : \
(double)Journal_Firewall( \
0, \
@@ -876,7 +878,7 @@
/** Assuming this is a Variable of a "pointer" inbuilt type, return a pointer to that pointer (type casted to
* void**). It ensures the Variable is of a "pointer" and is not complex. */
#define Variable_GetPtrPointer( self, array_I ) \
- ( (self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Pointer ? \
+ ( ((self)->offsetCount == 1 && (self)->dataTypes[0] == Variable_DataType_Pointer) ? \
_Variable_GetPtrPointer( (self), (array_I) ) : \
(void**)(Journal_Firewall( \
0, \
@@ -896,7 +898,7 @@
/** Assuming this is a Variable of a vector "pointer" inbuilt type, return that pointer. It ensures that vector_I is
* within range. */
#define Variable_GetValueAtPointer( self, array_I, vector_I ) \
- ( (vector_I) < (self)->dataTypeCounts[0] ? \
+ ( ((vector_I) < (self)->dataTypeCounts[0]) ? \
_Variable_GetValueAtPointer( (self), (array_I), (vector_I) ) : \
(void*)(Journal_Firewall( \
0, \
@@ -976,11 +978,11 @@
/** Assuming this is a Variable of any inbuilt type, return a char (type casted to char). Private. (Do not directly
* use!). Resolution order: char, short, int, float, double, pointer. */
#define _Variable_GetValueAsChar( self, array_I ) \
- ( (self)->dataTypes[0] == Variable_DataType_Char ? Variable_GetValueChar( (self), (array_I) ) : \
- (self)->dataTypes[0] == Variable_DataType_Short ? Variable_GetValueShortAsChar( (self), (array_I) ) : \
- (self)->dataTypes[0] == Variable_DataType_Int ? Variable_GetValueIntAsChar( (self), (array_I) ) : \
- (self)->dataTypes[0] == Variable_DataType_Float ? Variable_GetValueFloatAsChar( (self), (array_I) ) : \
- (self)->dataTypes[0] == Variable_DataType_Double ? Variable_GetValueDoubleAsChar( (self), (array_I) ) : \
+ ( ((self)->dataTypes[0] == Variable_DataType_Char) ? Variable_GetValueChar( (self), (array_I) ) : \
+ ((self)->dataTypes[0] == Variable_DataType_Short) ? Variable_GetValueShortAsChar( (self), (array_I) ) : \
+ ((self)->dataTypes[0] == Variable_DataType_Int) ? Variable_GetValueIntAsChar( (self), (array_I) ) : \
+ ((self)->dataTypes[0] == Variable_DataType_Float) ? Variable_GetValueFloatAsChar( (self), (array_I) ) : \
+ ((self)->dataTypes[0] == Variable_DataType_Double) ? Variable_GetValueDoubleAsChar( (self), (array_I) ) : \
(char)Journal_Firewall( \
0, \
Journal_Register( Error_Type, Variable_Type ), \
@@ -989,7 +991,7 @@
/** Assuming this is a Variable of any inbuilt type, return a char (type casted to char). It ensures the Variable
* is not complex. Resolution order: char, short, int, float, double, pointer. */
#define Variable_GetValueAsChar( self, array_I ) \
- ( (self)->offsetCount == 1 ? \
+ ( ((self)->offsetCount == 1) ? \
_Variable_GetValueAsChar( (self), (array_I) ) : \
(char)Journal_Firewall( \
0, \
@@ -1004,11 +1006,11 @@
/** Assuming this is a Variable of any inbuilt type, return a short (type casted to short). Private. (Do not directly
* use!). Resolution order: char, short, int, float, double, pointer. */
#define _Variable_GetValueAsShort( self, array_I ) \
- ( (self)->dataTypes[0] == Variable_DataType_Char ? Variable_GetValueCharAsShort( (self), (array_I) ) : \
- (self)->dataTypes[0] == Variable_DataType_Short ? Variable_GetValueShort( (self), (array_I) ) : \
- (self)->dataTypes[0] == Variable_DataType_Int ? Variable_GetValueIntAsShort( (self), (array_I) ) : \
- (self)->dataTypes[0] == Variable_DataType_Float ? Variable_GetValueFloatAsShort( (self), (array_I) ) : \
- (self)->dataTypes[0] == Variable_DataType_Double ? Variable_GetValueDoubleAsShort( (self), (array_I) ) : \
+ ( ((self)->dataTypes[0] == Variable_DataType_Char) ? Variable_GetValueCharAsShort( (self), (array_I) ) : \
+ ((self)->dataTypes[0] == Variable_DataType_Short) ? Variable_GetValueShort( (self), (array_I) ) : \
+ ((self)->dataTypes[0] == Variable_DataType_Int) ? Variable_GetValueIntAsShort( (self), (array_I) ) : \
+ ((self)->dataTypes[0] == Variable_DataType_Float) ? Variable_GetValueFloatAsShort( (self), (array_I) ) : \
+ ((self)->dataTypes[0] == Variable_DataType_Double) ? Variable_GetValueDoubleAsShort( (self), (array_I) ) : \
(short)Journal_Firewall( \
0, \
Journal_Register( Error_Type, Variable_Type ), \
@@ -1017,7 +1019,7 @@
/** Assuming this is a Variable of any inbuilt type, return a short (type casted to short). It ensures the Variable
* is not complex. Resolution order: char, short, int, float, double, pointer. */
#define Variable_GetValueAsShort( self, array_I ) \
- ( (self)->offsetCount == 1 ? \
+ ( ((self)->offsetCount == 1) ? \
_Variable_GetValueAsShort( (self), (array_I) ) : \
(short)Journal_Firewall( \
0, \
More information about the cig-commits
mailing list