ML Reference
|
00001 // **InsertLicense** code 00002 //------------------------------------------------------------------------- 00009 //------------------------------------------------------------------------- 00010 #ifndef __mlState_H 00011 #define __mlState_H 00012 00013 // ML-includes 00014 #ifndef __mlInitSystemML_H 00015 #include "mlInitSystemML.h" 00016 #endif 00017 00018 ML_START_NAMESPACE 00019 00022 class StateBuffer; 00023 00024 //------------------------------------------------------------------------- 00027 // 00101 //------------------------------------------------------------------------- 00102 class State 00103 { 00104 00105 public: 00106 00107 //------------------------------------------------------ 00109 00110 //------------------------------------------------------ 00111 00120 MLEXPORT static MLErrorCode pushState(bool readEnvironmentVars) ML_RETURN_VALUE_SHOULD_BE_USED; 00121 00124 MLEXPORT static MLErrorCode popState(); 00126 00127 protected: 00128 00130 friend MLint32 MLinit(); 00131 00133 friend void MLdestroy(); 00134 00136 MLEXPORT static MLErrorCode _init(); 00137 00141 MLEXPORT static MLErrorCode _destroy(); 00142 00143 private: 00144 00146 MLEXPORT State(); 00147 00149 MLEXPORT ~State(); 00150 00152 MLEXPORT State(const State &); 00153 00155 MLEXPORT State& operator=(const State &); 00156 00160 MLEXPORT static StateBuffer* _getMLStateAndReset(); 00161 00168 MLEXPORT static bool _restoreMLState(StateBuffer* &state); 00169 }; 00170 00171 ML_END_NAMESPACE 00172 00173 //----------------------------------------------------------------------------------- 00174 // Stream output for std::ostream 00175 //----------------------------------------------------------------------------------- 00176 namespace std { 00177 00179 MLEXPORT ostream& operator<<(ostream& s, const ML_NAMESPACE::StateBuffer &sb); 00180 00181 } 00182 00183 #endif //of __mlState_H 00184 00185 00186 00187