00001 ///////////////////////////////////////////////////////////////////////////////////////// 00002 /// \file types.h 00003 /// \brief Declaration of the type enums describing the various entities in a %SPARK problem 00004 /// 00005 /// Declaration of : 00006 /// - atomic class types in SPARK::AtomicTypes 00007 /// - function types in SPARK::FunTypes 00008 /// - callback types in SPARK::CallbackTypes 00009 /// - callback return types in SPARK::ReturnTypes 00010 /// - callback prototypes in SPARK::ProtoTypes 00011 /// - variable types in SPARK::VariableTypes 00012 /// - request types in SPARK::RequestTypes 00013 /// 00014 ///////////////////////////////////////////////////////////////////////////////////////// 00015 /// \attention 00016 /// PORTIONS COPYRIGHT (C) 2003 AYRES SOWELL ASSOCIATES, INC. \n 00017 /// PORTIONS COPYRIGHT (C) 2003 THE REGENTS OF THE UNIVERSITY OF CALIFORNIA . 00018 /// PENDING APPROVAL BY THE US DEPARTMENT OF ENERGY. ALL RIGHTS RESERVED. 00019 /// 00020 ///////////////////////////////////////////////////////////////////////////////////////// 00021 /// \author Dimitri Curtil (LBNL/SRG) 00022 /// \date January 5, 2003 00023 ///////////////////////////////////////////////////////////////////////////////////////// 00024 00025 00026 #if !defined(__TYPES_H__) 00027 #define __TYPES_H__ 00028 00029 00030 ///////////////////////////////////////////////////////////////////////////////////////// 00031 namespace SPARK { 00032 00033 // Include language enums generated by parser 00034 #if !defined( __LANGUAGE_H__ ) 00035 # define __LANGUAGE_H__ 00036 # include "language.h" // for enum AtomicTypes, FunTypes 00037 #endif //__LANGUAGE_H__ 00038 00039 00040 00041 ///////////////////////////////////////////////////////////////////////////////////// 00042 // Type definition 00043 ///////////////////////////////////////////////////////////////////////////////////// 00044 00045 /// Enum for callback types 00046 enum CallbackTypes { 00047 // Modifier callbacks 00048 CallbackType_EVALUATE = 0, ///< Specifies an EVALUATE callback 00049 CallbackType_PREDICT, ///< Specifies a PREDICT callback 00050 00051 // Non-modifier callbacks 00052 CallbackType_CONSTRUCT, ///< Specifies a CONSTRUCT callback 00053 CallbackType_DESTRUCT, ///< Specifies a DESTRUCT callback 00054 CallbackType_PREPARE_STEP, ///< Specifies a PREPARE_STEP callback 00055 CallbackType_ROLLBACK, ///< Specifies a ROLLBACK callback 00056 CallbackType_COMMIT, ///< Specifies a COMMIT callback 00057 00058 // Predicate callbacks 00059 CallbackType_CHECK_INTEGRATION_STEP, ///< Specifies a CHECK_INTEGRATION_STEP callback for CLASSTYPE=INTEGRATOR only 00060 00061 // Static non-modifier callbacks 00062 CallbackType_STATIC_CONSTRUCT, ///< Specifies a STATIC_CONSTRUCT callback 00063 CallbackType_STATIC_DESTRUCT, ///< Specifies a STATIC_DESTRUCT callback 00064 CallbackType_STATIC_PREPARE_STEP, ///< Specifies a STATIC_PREPARE_STEP callback 00065 CallbackType_STATIC_ROLLBACK, ///< Specifies a STATIC_ROLLBACk callback 00066 CallbackType_STATIC_COMMIT, ///< Specifies a STATIC_COMMIT callback 00067 00068 // Static predicate callbacks 00069 CallbackType_STATIC_CHECK_INTEGRATION_STEP, ///< Specifies a STATIC_CHECK_INTEGRATION_STEP callback for CLASSTYPE=INTEGRATOR only 00070 00071 CALLBACKTYPES_L, ///< Number of different callback types 00072 CallbackType_NONE = CALLBACKTYPES_L, ///< Default value for non-initialized CallbackTypes variables 00073 00074 00075 // Begin/End callback tags 00076 BEGIN_CALLBACKS = CallbackType_EVALUATE, 00077 END_CALLBACKS = CALLBACKTYPES_L, 00078 00079 // Instance 00080 BEGIN_INSTANCE_CALLBACK = CallbackType_EVALUATE, 00081 END_INSTANCE_CALLBACK = CallbackType_STATIC_CONSTRUCT, 00082 NUM_INSTANCE_CALLBACKS = END_INSTANCE_CALLBACK - BEGIN_INSTANCE_CALLBACK, 00083 00084 // Static 00085 BEGIN_STATIC_CALLBACK = CallbackType_STATIC_CONSTRUCT, 00086 END_STATIC_CALLBACK = CALLBACKTYPES_L, 00087 NUM_STATIC_CALLBACKS = END_STATIC_CALLBACK - BEGIN_STATIC_CALLBACK, 00088 00089 // Modifiers 00090 BEGIN_MODIFIER_CALLBACK = CallbackType_EVALUATE, 00091 END_MODIFIER_CALLBACK = CallbackType_CONSTRUCT, 00092 NUM_MODIFIER_CALLBACKS = END_MODIFIER_CALLBACK - BEGIN_MODIFIER_CALLBACK, 00093 00094 // Non-modifiers 00095 BEGIN_NON_MODIFIER_CALLBACK = CallbackType_CONSTRUCT, 00096 END_NON_MODIFIER_CALLBACK = CallbackType_CHECK_INTEGRATION_STEP, 00097 NUM_NON_MODIFIER_CALLBACKS = END_NON_MODIFIER_CALLBACK - BEGIN_NON_MODIFIER_CALLBACK, 00098 00099 // Predicates 00100 BEGIN_PREDICATE_CALLBACK = CallbackType_CHECK_INTEGRATION_STEP, 00101 END_PREDICATE_CALLBACK = CallbackType_STATIC_CONSTRUCT, 00102 NUM_PREDICATE_CALLBACKS = END_PREDICATE_CALLBACK - BEGIN_PREDICATE_CALLBACK, 00103 00104 // Static non-modifiers 00105 BEGIN_STATIC_NON_MODIFIER_CALLBACK = CallbackType_STATIC_CONSTRUCT, 00106 END_STATIC_NON_MODIFIER_CALLBACK = CallbackType_STATIC_CHECK_INTEGRATION_STEP, 00107 NUM_STATIC_NON_MODIFIER_CALLBACKS = END_STATIC_NON_MODIFIER_CALLBACK - BEGIN_STATIC_NON_MODIFIER_CALLBACK, 00108 00109 // Static predicates 00110 BEGIN_STATIC_PREDICATE_CALLBACK = CallbackType_STATIC_CHECK_INTEGRATION_STEP, 00111 END_STATIC_PREDICATE_CALLBACK = CALLBACKTYPES_L, 00112 NUM_STATIC_PREDICATE_CALLBACKS = END_STATIC_PREDICATE_CALLBACK - BEGIN_STATIC_PREDICATE_CALLBACK 00113 00114 }; 00115 00116 00117 /// Enum for callback prototypes 00118 enum ProtoTypes { 00119 ProtoType_MODIFIER = 0, ///< Prototype used by modifier callbacks (e.g., evaluate and predict) 00120 ProtoType_NON_MODIFIER, ///< Prototype used by non-modifier callbacks (e.g., construct, destruct, ...) 00121 ProtoType_PREDICATE, ///< Prototype used by predicate callbacks (e.g., check_integration_step, ...) 00122 00123 ProtoType_STATIC_NON_MODIFIER,///< Prototype used by static non-modifier callbacks (e.g., static_construct, ...) 00124 ProtoType_STATIC_PREDICATE, ///< Prototype used by static predicate callbacks (e.g., static_check_integration_step, ...) 00125 00126 PROTOTYPES_L, ///< Number of different prototype types 00127 ProtoType_NONE = PROTOTYPES_L ///< Default value for non-initialized ProtoTypes variables 00128 }; 00129 00130 00131 /// Enum for return types from modifier callbacks 00132 enum ReturnTypes { 00133 ReturnType_VALUE = 0, ///< Indicates that scalar value written to the target TVariable object is the variable value 00134 ReturnType_RESIDUAL, ///< Indicates that scalar value written to the target TVariable object is the residual value of the function matched with this variable 00135 00136 RETURNTYPES_L, ///< Number of different return types 00137 ReturnType_NONE=RETURNTYPES_L ///< Default value for non-initialized ReturnTypes variables 00138 }; 00139 00140 00141 /// Enum for the various variable types in the problem 00142 enum VariableTypes { 00143 VariableType_GLOBAL_TIME = 0, ///< Refers to the LINK tagged with the GLOBAL_TIME keyword 00144 VariableType_GLOBAL_TIME_STEP, ///< Refers to the LINK tagged with the GLOBAL_TIME_TIME keyword 00145 VariableType_PARAMETER, ///< Refers to the LINKs specified with the PARAMETER keyword 00146 VariableType_INPUT, ///< Refers to the LINKs specified with the INPUT keyword 00147 VariableType_UNKNOWN, ///< Refers to the LINKs specified with none of the above keywords 00148 00149 VARIABLETYPES_L, ///< Number of different variable types 00150 VariableType_NONE=VARIABLETYPES_L ///< Default value for non-initialized VariableTypes variables 00151 }; 00152 00153 00154 /// Enum for the various atomic class requests 00155 /// 00156 /// The values are specified by the following bit masks that can be combined using the bitwise OR ( | ) operator. 00157 enum RequestTypes { 00158 RequestType_ABORT = 0, ///< Refers to a SPARK::TDispatcher::abort() request (see macro REQUEST__ABORT in spark.h) 00159 00160 RequestType_STOP, ///< Refers to a SPARK::TDispatcher::stop() request (see macro REQUEST__STOP in spark.h) 00161 RequestType_SET_STOP_TIME, ///< Refers to a SPARK::TDispatcher::set_stop_time() request (see macro REQUEST__SET_STOP_TIME in spark.h) 00162 00163 RequestType_REPORT, ///< Refers to a SPARK::TDispatcher::report() request (see macro REQUEST__REPORT in spark.h) 00164 RequestType_SNAPSHOT, ///< Refers to a SPARK::TDispatcher::snapshot() request (see macro REQUEST__SNAPSHOT in spark.h) 00165 00166 RequestType_SET_MEETING_POINT, ///< Refers to a SPARK::TDispatcher::set_meeting_point() request (see macro REQUEST__SET_MEETING_POINT in spark.h) 00167 RequestType_CLEAR_MEETING_POINTS, ///< Refers to a SPARK::TDispatcher::clear_meeting_points() request (see macro REQUEST__CLEAR_MEETING_POINTS in spark.h) 00168 00169 RequestType_RESTART, ///< Refers to a SPARK::TDispatcher::restart() request (see macro REQUEST__RESTART in spark.h) 00170 00171 RequestType_SET_TIME_STEP, ///< Refers to a SPARK::TDispatcher::set_time_step() request (see macro REQUEST__SET_TIME_STEP in spark.h) 00172 RequestType_SET_DYNAMIC_STEPPER, ///< Refers to a SPARK::TDispatcher::set_dynamic_stepper() request (see macro REQUEST__SET_DYNAMIC_STEPPER in spark.h) 00173 00174 REQUESTTYPES_L, ///< Number of different request types 00175 RequestType_NONE=REQUESTTYPES_L ///< Default value for an invalid request type 00176 }; 00177 00178 00179 }; // namespace SPARK 00180 ///////////////////////////////////////////////////////////////////////////////////////// 00181 00182 00183 #endif //__TYPES_H__ 00184 00185 00186