Changeset 288 in dev for trunk/abdev/BasicCompiler_Common/include
- Timestamp:
- Aug 17, 2007, 7:36:51 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common/include
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/include/Binary.h
r287 r288 61 61 } 62 62 buffer = (char *)realloc( buffer, allocateSize ); 63 64 // 再確保した部分を0で埋める 65 memset( buffer + size, 0, allocateSize - size ); 63 66 } 64 67 } … … 96 99 return size; 97 100 } 101 void Resize( int newSize ) 102 { 103 Realloc( newSize ); 104 size = newSize; 105 } 98 106 99 107 long GetLong( int pos ) const … … 102 110 } 103 111 112 void Overwrite( int pos, const char *buffer, int size ) 113 { 114 memcpy( this->buffer + pos, buffer, size ); 115 } 104 116 void Overwrite( int pos, char c ) 105 117 { … … 117 129 memcpy( this->buffer + this->size, buffer, size ); 118 130 this->size += size; 131 } 132 void Put( double dbl ) 133 { 134 Put( (const char *)(&dbl), sizeof(double) ); 135 } 136 void Put( float flt ) 137 { 138 Put( (const char *)(&flt), sizeof(float) ); 119 139 } 120 140 void Put( _int64 i64data ) -
trunk/abdev/BasicCompiler_Common/include/Meta.h
r280 r288 26 26 27 27 // グローバル変数 28 Variables globalVars;28 GlobalVars globalVars; 29 29 30 30 // グローバル定数 … … 113 113 } 114 114 115 const Variables &GetGlobalVars() const115 const GlobalVars &GetGlobalVars() const 116 116 { 117 117 return globalVars; 118 118 } 119 Variables &GetGlobalVars()119 GlobalVars &GetGlobalVars() 120 120 { 121 121 return globalVars; -
trunk/abdev/BasicCompiler_Common/include/Variable.h
r287 r288 5 5 #include <Symbol.h> 6 6 #include <Type.h> 7 #include <Binary.h> 7 8 8 9 class Variable : public Symbol … … 223 224 class Variables : public vector<Variable *> 224 225 { 226 protected: 225 227 int allSize; 226 int allInitSize;227 public:228 Variables()229 : allSize( 0 )230 , allInitSize( 0 )231 {232 }233 ~Variables(){234 Clear();235 }236 237 void Clear(){238 for( int i=0; i<(int)this->size(); i++ ){239 delete (*this)[i];240 }241 242 allSize = 0;243 allInitSize = 0;244 clear();245 }246 void PullOutAll()247 {248 clear();249 }250 251 bool DuplicateCheck( const Symbol &symbol ) const;252 253 const Variable *BackSearch( const Symbol &symbol ) const;254 const Variable *Find( const Symbol &symbol )const;255 256 void Add( Variable *pVar, bool isResetOffsetAddress = true );257 258 int GetAllSize() const259 {260 return allSize;261 }262 int GetAllInitSize() const263 {264 return allInitSize;265 }266 267 228 268 229 // XMLシリアライズ用 … … 275 236 ar & boost::serialization::make_nvp("vector_Variable", boost::serialization::base_object<vector<Variable *>>(*this)); 276 237 } 238 239 public: 240 Variables() 241 : allSize( 0 ) 242 { 243 } 244 ~Variables(){ 245 Clear(); 246 } 247 248 void Clear(){ 249 for( int i=0; i<(int)this->size(); i++ ){ 250 delete (*this)[i]; 251 } 252 253 allSize = 0; 254 clear(); 255 } 256 void PullOutAll() 257 { 258 clear(); 259 } 260 261 int GetAllSize() const 262 { 263 return allSize; 264 } 265 266 bool DuplicateCheck( const Symbol &symbol ) const; 267 268 const Variable *BackSearch( const Symbol &symbol ) const; 269 const Variable *Find( const Symbol &symbol )const; 277 270 }; 278 271 279 class GlobalVar : public Variable272 class GlobalVars : public Variables 280 273 { 281 BYTE *initBuffer; 282 public: 283 GlobalVar() 284 { 285 initBuffer = (BYTE *)malloc( 1 ); 286 } 287 ~GlobalVar() 288 { 289 free( initBuffer ); 290 } 274 public: 275 Binary initAreaBuffer; 276 277 // XMLシリアライズ用 278 private: 279 friend class boost::serialization::access; 280 template<class Archive> void serialize(Archive& ar, const unsigned int version) 281 { 282 trace_for_serialize( "serializing - GlobalVars" ); 283 284 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Variables ); 285 ar & BOOST_SERIALIZATION_NVP( initAreaBuffer ); 286 } 287 public: 288 GlobalVars() 289 { 290 } 291 ~GlobalVars() 292 { 293 } 294 295 void Add( Variable *pVar, bool isResetOffsetAddress = true ); 291 296 }; -
trunk/abdev/BasicCompiler_Common/include/option.h
r276 r288 37 37 38 38 // XMLシリアライズに関するログを生成する 39 //#define USE_TRACE_FOR_SERIALIZE39 #define USE_TRACE_FOR_SERIALIZE 40 40 41 41 // ソースコードステップに関するログを生成する
Note:
See TracChangeset
for help on using the changeset viewer.