[184] | 1 | #pragma once
|
---|
| 2 |
|
---|
[206] | 3 | class UserProc;
|
---|
[325] | 4 | class Delegate;
|
---|
[206] | 5 |
|
---|
[344] | 6 | class ClassPrototype : public Prototype, public DynamicMethodsPrototype
|
---|
[342] | 7 | {
|
---|
[344] | 8 | // XMLシリアライズ用
|
---|
| 9 | private:
|
---|
| 10 | friend class boost::serialization::access;
|
---|
| 11 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 12 | {
|
---|
| 13 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Prototype );
|
---|
| 14 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( DynamicMethodsPrototype );
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | public:
|
---|
[523] | 18 | ClassPrototype( const NamespaceScopes &namespaceScopes, const std::string &name )
|
---|
[344] | 19 | : Prototype( namespaceScopes, name )
|
---|
| 20 | , DynamicMethodsPrototype()
|
---|
| 21 | {
|
---|
| 22 | }
|
---|
| 23 | ClassPrototype()
|
---|
| 24 | : Prototype()
|
---|
| 25 | , DynamicMethodsPrototype()
|
---|
| 26 | {
|
---|
| 27 | }
|
---|
| 28 | };
|
---|
| 29 |
|
---|
[342] | 30 | class CClass: public ClassPrototype, public Jenga::Common::ObjectInHashmap<CClass>
|
---|
[206] | 31 | {
|
---|
| 32 | public:
|
---|
| 33 | // 型の種類
|
---|
| 34 | enum ClassType{
|
---|
| 35 | Class,
|
---|
| 36 | Interface,
|
---|
[370] | 37 | ComInterface,
|
---|
[206] | 38 | Enum,
|
---|
| 39 | Delegate,
|
---|
| 40 | Structure,
|
---|
| 41 | };
|
---|
[193] | 42 |
|
---|
[206] | 43 | private:
|
---|
| 44 | ClassType classType;
|
---|
[184] | 45 |
|
---|
[206] | 46 | // importされている名前空間
|
---|
| 47 | NamespaceScopesCollection importedNamespaces;
|
---|
[290] | 48 |
|
---|
| 49 | // 型パラメータ
|
---|
| 50 | GenericTypes formalGenericTypes;
|
---|
| 51 |
|
---|
[382] | 52 | // 基底クラス
|
---|
[206] | 53 | const CClass *pSuperClass;
|
---|
[184] | 54 |
|
---|
[382] | 55 | // 基底クラスの型パラメータ(実パラメータ)
|
---|
[299] | 56 | Types superClassActualTypeParameters;
|
---|
| 57 |
|
---|
[206] | 58 | // Blittable型情報
|
---|
| 59 | Type blittableType;
|
---|
[184] | 60 |
|
---|
[206] | 61 | // 実装するインターフェイス
|
---|
| 62 | Interfaces interfaces;
|
---|
[191] | 63 |
|
---|
[206] | 64 | // 動的メンバ
|
---|
| 65 | Members dynamicMembers;
|
---|
[191] | 66 |
|
---|
[206] | 67 | // 静的メンバ
|
---|
| 68 | Members staticMembers;
|
---|
| 69 |
|
---|
| 70 | // 動的メソッド
|
---|
| 71 | int ConstructorMemberSubIndex;
|
---|
| 72 | int DestructorMemberSubIndex;
|
---|
| 73 | int vtblNum; // 仮想関数の数
|
---|
| 74 |
|
---|
| 75 | // 静的メソッド
|
---|
| 76 | Methods staticMethods;
|
---|
| 77 |
|
---|
[232] | 78 | //アラインメント値
|
---|
| 79 | int fixedAlignment;
|
---|
| 80 |
|
---|
[191] | 81 | // XMLシリアライズ用
|
---|
| 82 | private:
|
---|
| 83 | friend class boost::serialization::access;
|
---|
| 84 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 85 | {
|
---|
[206] | 86 | trace_for_serialize( "serializing - CClass" );
|
---|
| 87 |
|
---|
[342] | 88 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( ClassPrototype );
|
---|
[206] | 89 | ar & BOOST_SERIALIZATION_NVP( classType );
|
---|
| 90 | ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
|
---|
[293] | 91 | ar & BOOST_SERIALIZATION_NVP( formalGenericTypes );
|
---|
[206] | 92 | ar & boost::serialization::make_nvp( "pSuperClass", const_cast<CClass *&>(pSuperClass) );
|
---|
[299] | 93 | ar & BOOST_SERIALIZATION_NVP( superClassActualTypeParameters );
|
---|
[206] | 94 | ar & BOOST_SERIALIZATION_NVP( blittableType );
|
---|
[353] | 95 | ar & BOOST_SERIALIZATION_NVP( interfaces );
|
---|
[206] | 96 | ar & BOOST_SERIALIZATION_NVP( dynamicMembers );
|
---|
| 97 | ar & BOOST_SERIALIZATION_NVP( staticMembers );
|
---|
| 98 | ar & BOOST_SERIALIZATION_NVP( ConstructorMemberSubIndex );
|
---|
| 99 | ar & BOOST_SERIALIZATION_NVP( DestructorMemberSubIndex );
|
---|
| 100 | ar & BOOST_SERIALIZATION_NVP( vtblNum );
|
---|
| 101 | ar & BOOST_SERIALIZATION_NVP( staticMethods );
|
---|
[232] | 102 | ar & BOOST_SERIALIZATION_NVP( fixedAlignment );
|
---|
[191] | 103 | }
|
---|
[184] | 104 |
|
---|
[206] | 105 | bool isReady;
|
---|
[184] | 106 | public:
|
---|
[206] | 107 |
|
---|
[523] | 108 | CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name )
|
---|
[342] | 109 | : ClassPrototype( namespaceScopes, name )
|
---|
[206] | 110 | , importedNamespaces( importedNamespaces )
|
---|
| 111 | , classType( Class )
|
---|
| 112 | , pSuperClass( NULL )
|
---|
[290] | 113 | , blittableType( Type() )
|
---|
[206] | 114 | , isReady( false )
|
---|
[232] | 115 | , fixedAlignment( 0 )
|
---|
[206] | 116 | , ConstructorMemberSubIndex( -1 )
|
---|
| 117 | , DestructorMemberSubIndex( -1 )
|
---|
| 118 | , vtblNum( 0 )
|
---|
| 119 | , vtbl_offset( -1 )
|
---|
[370] | 120 | , comVtblOffset( 0 )
|
---|
[206] | 121 | , isCompilingConstructor( false )
|
---|
| 122 | , isCompilingDestructor( false )
|
---|
| 123 | , pobj_NextClass( NULL )
|
---|
[409] | 124 | , cacheSize( 0 )
|
---|
[191] | 125 | {
|
---|
| 126 | }
|
---|
[206] | 127 | CClass()
|
---|
[342] | 128 | : ClassPrototype()
|
---|
[206] | 129 | , importedNamespaces()
|
---|
| 130 | , classType()
|
---|
| 131 | , pSuperClass( NULL )
|
---|
[290] | 132 | , blittableType( Type() )
|
---|
[206] | 133 | , isReady( false )
|
---|
[232] | 134 | , fixedAlignment( 0 )
|
---|
[206] | 135 | , ConstructorMemberSubIndex( -1 )
|
---|
| 136 | , DestructorMemberSubIndex( -1 )
|
---|
| 137 | , vtblNum( 0 )
|
---|
| 138 | , vtbl_offset( -1 )
|
---|
[370] | 139 | , comVtblOffset( 0 )
|
---|
[206] | 140 | , isCompilingConstructor( false )
|
---|
| 141 | , isCompilingDestructor( false )
|
---|
| 142 | , pobj_NextClass( NULL )
|
---|
[409] | 143 | , cacheSize( 0 )
|
---|
[206] | 144 | {
|
---|
| 145 | }
|
---|
| 146 | ~CClass()
|
---|
| 147 | {
|
---|
| 148 | // 動的メンバ
|
---|
[346] | 149 | BOOST_FOREACH( CMember *member, dynamicMembers )
|
---|
| 150 | {
|
---|
[206] | 151 | delete member;
|
---|
| 152 | }
|
---|
[191] | 153 |
|
---|
[206] | 154 | // 静的メンバ
|
---|
[346] | 155 | BOOST_FOREACH( CMember *member, staticMembers )
|
---|
| 156 | {
|
---|
[206] | 157 | delete member;
|
---|
| 158 | }
|
---|
[346] | 159 |
|
---|
| 160 | // インターフェイス
|
---|
| 161 | BOOST_FOREACH( ::Interface *pInterface, interfaces )
|
---|
| 162 | {
|
---|
| 163 | delete pInterface;
|
---|
| 164 | }
|
---|
[206] | 165 | }
|
---|
[184] | 166 |
|
---|
[270] | 167 | virtual const std::string &GetKeyName() const
|
---|
| 168 | {
|
---|
| 169 | return GetName();
|
---|
| 170 | }
|
---|
| 171 | virtual bool IsDuplication( const CClass *pClass ) const
|
---|
| 172 | {
|
---|
| 173 | if( pClass->IsEqualSymbol( *this ) )
|
---|
| 174 | {
|
---|
| 175 | return true;
|
---|
| 176 | }
|
---|
| 177 | return false;
|
---|
| 178 | }
|
---|
| 179 |
|
---|
[206] | 180 | void Readed(){
|
---|
| 181 | isReady = true;
|
---|
| 182 | }
|
---|
| 183 | bool IsReady() const{
|
---|
| 184 | return isReady;
|
---|
| 185 | }
|
---|
[184] | 186 |
|
---|
[206] | 187 | const NamespaceScopesCollection &GetImportedNamespaces() const
|
---|
| 188 | {
|
---|
| 189 | return importedNamespaces;
|
---|
| 190 | }
|
---|
| 191 |
|
---|
[290] | 192 | // 型パラメータ
|
---|
[424] | 193 | const GenericTypes &GetFormalGenericTypes() const
|
---|
| 194 | {
|
---|
| 195 | return formalGenericTypes;
|
---|
| 196 | }
|
---|
[290] | 197 | void AddFormalGenericType( GenericType genericType )
|
---|
| 198 | {
|
---|
| 199 | this->formalGenericTypes.push_back( genericType );
|
---|
| 200 | }
|
---|
[299] | 201 | int GetFormalGenericTypeParameterIndex( const std::string &name ) const
|
---|
| 202 | {
|
---|
| 203 | int i = 0;
|
---|
| 204 | BOOST_FOREACH( const GenericType &genericType, formalGenericTypes )
|
---|
| 205 | {
|
---|
| 206 | if( genericType.GetName() == name )
|
---|
| 207 | {
|
---|
| 208 | return i;
|
---|
| 209 | }
|
---|
| 210 | i++;
|
---|
| 211 | }
|
---|
| 212 | return -1;
|
---|
| 213 | }
|
---|
[290] | 214 | bool IsExistFormalGenericTypeParameter( const std::string &name ) const
|
---|
| 215 | {
|
---|
| 216 | BOOST_FOREACH( const GenericType &genericType, formalGenericTypes )
|
---|
| 217 | {
|
---|
| 218 | if( genericType.GetName() == name )
|
---|
| 219 | {
|
---|
| 220 | return true;
|
---|
| 221 | }
|
---|
| 222 | }
|
---|
| 223 | return false;
|
---|
| 224 | }
|
---|
[379] | 225 | bool IsGeneric() const
|
---|
| 226 | {
|
---|
| 227 | return ( this->formalGenericTypes.size() != 0 );
|
---|
| 228 | }
|
---|
[290] | 229 |
|
---|
[206] | 230 | // 継承元クラス
|
---|
| 231 | bool HasSuperClass() const
|
---|
| 232 | {
|
---|
| 233 | return ( pSuperClass != NULL );
|
---|
| 234 | }
|
---|
| 235 | const CClass &GetSuperClass() const
|
---|
| 236 | {
|
---|
| 237 | return *pSuperClass;
|
---|
| 238 | }
|
---|
| 239 | void SetSuperClass( const CClass *pSuperClass )
|
---|
| 240 | {
|
---|
| 241 | this->pSuperClass = pSuperClass;
|
---|
| 242 | }
|
---|
[299] | 243 | const Types &GetSuperClassActualTypeParameters() const
|
---|
| 244 | {
|
---|
| 245 | return superClassActualTypeParameters;
|
---|
| 246 | }
|
---|
| 247 | void SetSuperClassActualTypeParameters( const Types &actualTypeParameters )
|
---|
| 248 | {
|
---|
| 249 | this->superClassActualTypeParameters = actualTypeParameters;
|
---|
| 250 | }
|
---|
[206] | 251 |
|
---|
| 252 | // Blittable型
|
---|
| 253 | bool IsBlittableType() const
|
---|
| 254 | {
|
---|
| 255 | return !blittableType.IsNull();
|
---|
| 256 | }
|
---|
| 257 | const Type &GetBlittableType() const
|
---|
| 258 | {
|
---|
| 259 | return blittableType;
|
---|
| 260 | }
|
---|
| 261 | void SetBlittableType( const Type &type ){
|
---|
| 262 | blittableType = type;
|
---|
| 263 | }
|
---|
| 264 |
|
---|
| 265 | bool IsClass() const;
|
---|
| 266 | bool IsInterface() const;
|
---|
[370] | 267 | bool IsComInterface() const;
|
---|
[206] | 268 | bool IsEnum() const;
|
---|
| 269 | bool IsDelegate() const;
|
---|
| 270 | bool IsStructure() const;
|
---|
| 271 | void SetClassType( ClassType classType )
|
---|
| 272 | {
|
---|
| 273 | this->classType = classType;
|
---|
| 274 | }
|
---|
| 275 |
|
---|
| 276 |
|
---|
| 277 | //コンストラクタをコンパイルしているかどうかのチェックフラグ
|
---|
[184] | 278 | private:
|
---|
[206] | 279 | mutable bool isCompilingConstructor;
|
---|
[184] | 280 | public:
|
---|
[206] | 281 | void NotifyStartConstructorCompile() const;
|
---|
| 282 | void NotifyFinishConstructorCompile() const;
|
---|
| 283 | bool IsCompilingConstructor() const;
|
---|
[184] | 284 |
|
---|
[206] | 285 | //デストラクタをコンパイルしているかどうかのチェックフラグ
|
---|
| 286 | private:
|
---|
| 287 | mutable bool isCompilingDestructor;
|
---|
| 288 | public:
|
---|
| 289 | void NotifyStartDestructorCompile() const;
|
---|
| 290 | void NotifyFinishDestructorCompile() const;
|
---|
| 291 | bool IsCompilingDestructor() const;
|
---|
[191] | 292 |
|
---|
[193] | 293 |
|
---|
[206] | 294 | //自身の派生クラスかどうかを確認
|
---|
| 295 | bool IsSubClass( const CClass *pClass ) const;
|
---|
| 296 |
|
---|
| 297 | //自身と等しいまたは派生クラスかどうかを確認
|
---|
| 298 | bool IsEqualsOrSubClass( const CClass *pClass ) const;
|
---|
| 299 |
|
---|
| 300 | // 自身と等しいまたは派生クラス、基底クラスかどうかを確認
|
---|
| 301 | bool IsEqualsOrSubClassOrSuperClass( const CClass &objClass ) const;
|
---|
| 302 |
|
---|
| 303 | // インターフェイス
|
---|
| 304 | bool HasInterfaces() const
|
---|
| 305 | {
|
---|
| 306 | return ( interfaces.size() != 0 );
|
---|
| 307 | }
|
---|
[342] | 308 | const Interfaces &GetInterfaces() const
|
---|
| 309 | {
|
---|
| 310 | return interfaces;
|
---|
| 311 | }
|
---|
[206] | 312 | bool IsInheritsInterface( const CClass *pInterfaceClass ) const;
|
---|
| 313 |
|
---|
[340] | 314 | // クラス継承
|
---|
[299] | 315 | bool InheritsClass( const CClass &inheritsClass, const Types &actualTypeParameters, int nowLine );
|
---|
[206] | 316 |
|
---|
[340] | 317 | // インターフェイス実装
|
---|
[376] | 318 | bool Implements( const CClass &interfaceClass, const Types &actualTypeParameters, int nowLine );
|
---|
[340] | 319 |
|
---|
[206] | 320 | //メンバ、メソッドの追加
|
---|
| 321 | CMember *CreateMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine );
|
---|
| 322 | void AddMember( Prototype::Accessibility accessibility, bool idConst, bool isRef, char *buffer, int nowLine );
|
---|
| 323 | void AddStaticMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine );
|
---|
| 324 |
|
---|
| 325 | //重複チェック
|
---|
[409] | 326 | bool DupliCheckAll(const char *name) const;
|
---|
| 327 | bool DupliCheckMember(const char *name) const;
|
---|
[206] | 328 |
|
---|
| 329 | const Members &GetDynamicMembers() const
|
---|
| 330 | {
|
---|
| 331 | return dynamicMembers;
|
---|
| 332 | }
|
---|
| 333 | const Members &GetStaticMembers() const
|
---|
| 334 | {
|
---|
| 335 | return staticMembers;
|
---|
| 336 | }
|
---|
| 337 | Members &GetDynamicMembers()
|
---|
| 338 | {
|
---|
| 339 | return dynamicMembers;
|
---|
| 340 | }
|
---|
| 341 | Members &GetStaticMembers()
|
---|
| 342 | {
|
---|
| 343 | return staticMembers;
|
---|
| 344 | }
|
---|
[355] | 345 |
|
---|
[409] | 346 | const CMember *FindDynamicMember( const char *memberName ) const;
|
---|
| 347 | bool HasDynamicMember( const char *memberName ) const
|
---|
[355] | 348 | {
|
---|
[409] | 349 | return ( FindDynamicMember( memberName ) != NULL );
|
---|
[355] | 350 | }
|
---|
[206] | 351 |
|
---|
[350] | 352 | void EnumDynamicMethodsOrInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const;
|
---|
| 353 | const CMethod *GetDynamicMethodOrInterfaceMethod( const UserProc *pUserProc ) const;
|
---|
[347] | 354 |
|
---|
[206] | 355 | const Methods &GetStaticMethods() const
|
---|
| 356 | {
|
---|
| 357 | return staticMethods;
|
---|
| 358 | }
|
---|
| 359 | Methods &GetStaticMethods()
|
---|
| 360 | {
|
---|
| 361 | return staticMethods;
|
---|
| 362 | }
|
---|
| 363 |
|
---|
| 364 | //デフォルト コンストラクタ
|
---|
| 365 | const CMethod *GetConstructorMethod() const
|
---|
| 366 | {
|
---|
| 367 | if( ConstructorMemberSubIndex == -1 ) return NULL;
|
---|
[342] | 368 | return GetDynamicMethods()[ConstructorMemberSubIndex];
|
---|
[206] | 369 | }
|
---|
| 370 | void SetConstructorMemberSubIndex( int constructorMemberSubIndex )
|
---|
| 371 | {
|
---|
| 372 | this->ConstructorMemberSubIndex = constructorMemberSubIndex;
|
---|
| 373 | }
|
---|
| 374 |
|
---|
| 375 | //デストラクタ メソッドを取得
|
---|
| 376 | const CMethod *GetDestructorMethod() const
|
---|
| 377 | {
|
---|
| 378 | if( DestructorMemberSubIndex == -1 ) return NULL;
|
---|
[342] | 379 | return GetDynamicMethods()[DestructorMemberSubIndex];
|
---|
[206] | 380 | }
|
---|
| 381 | void SetDestructorMemberSubIndex( int destructorMemberSubIndex )
|
---|
| 382 | {
|
---|
| 383 | this->DestructorMemberSubIndex = destructorMemberSubIndex;
|
---|
| 384 | }
|
---|
| 385 |
|
---|
[325] | 386 | // デリゲート情報を取得
|
---|
| 387 | const ::Delegate &GetDelegate() const;
|
---|
| 388 |
|
---|
[232] | 389 | // ユーザ指定のアラインメント固定値
|
---|
| 390 | int GetFixedAlignment() const
|
---|
| 391 | {
|
---|
| 392 | return fixedAlignment;
|
---|
| 393 | }
|
---|
| 394 | void SetFixedAlignment( int fixedAlignment )
|
---|
| 395 | {
|
---|
| 396 | this->fixedAlignment = fixedAlignment;
|
---|
| 397 | }
|
---|
| 398 |
|
---|
[206] | 399 | // メンバの総合サイズを取得
|
---|
[409] | 400 | private:
|
---|
| 401 | int cacheSize;
|
---|
| 402 | public:
|
---|
[206] | 403 | int GetSize() const;
|
---|
| 404 |
|
---|
| 405 | // メンバのオフセットを取得
|
---|
[409] | 406 | int GetMemberOffset( const char *memberName ) const;
|
---|
[206] | 407 | private:
|
---|
| 408 | // アラインメント値を取得
|
---|
| 409 | int GetAlignment() const;
|
---|
| 410 |
|
---|
[342] | 411 |
|
---|
| 412 | /////////////////////////////////////////////////////////////////
|
---|
| 413 | // vtbl
|
---|
| 414 | /////////////////////////////////////////////////////////////////
|
---|
[206] | 415 | public:
|
---|
[342] | 416 | // vtblに存在する仮想関数の数
|
---|
| 417 | int GetVtblNum() const
|
---|
| 418 | {
|
---|
| 419 | return vtblNum;
|
---|
| 420 | }
|
---|
| 421 | void SetVtblNum( int vtblNum )
|
---|
| 422 | {
|
---|
| 423 | this->vtblNum = vtblNum;
|
---|
| 424 | }
|
---|
| 425 | void AddVtblNum( int vtblNum )
|
---|
| 426 | {
|
---|
| 427 | this->vtblNum += vtblNum;
|
---|
| 428 | }
|
---|
| 429 | bool IsExistVirtualFunctions() const
|
---|
| 430 | {
|
---|
[409] | 431 | // 構造体以外は仮想関数を持つ
|
---|
| 432 | return !IsStructure();
|
---|
[342] | 433 | }
|
---|
| 434 |
|
---|
| 435 | private:
|
---|
| 436 | long vtbl_offset;
|
---|
[370] | 437 | long comVtblOffset;
|
---|
[342] | 438 | long vtblMasterListOffset;
|
---|
[345] | 439 | std::vector<long> vtblMasterList;
|
---|
[342] | 440 | public:
|
---|
[348] | 441 | void GetVtblMasterListIndexAndVtblIndex( const UserProc *pUserProc, int &vtblMasterListIndex, int &vtblIndex ) const;
|
---|
[350] | 442 | int GetVtblMasterListIndex( const CClass *pClass ) const;
|
---|
[370] | 443 | long GetComVtblOffset() const;
|
---|
[345] | 444 | long GetVtblMasterListOffset() const;
|
---|
| 445 | void GenerateVTableMasterList( const std::vector<long> &vtableMasterList, long &offset );
|
---|
[342] | 446 | void GenerateFullVTables();
|
---|
| 447 | void ActionVtblSchedule( LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection, LONG_PTR MemPos_DataSection );
|
---|
[206] | 448 | bool IsAbstract() const;
|
---|
| 449 |
|
---|
| 450 |
|
---|
[355] | 451 | // TypeInfo用
|
---|
| 452 | mutable int typeInfoDataTableOffset;
|
---|
| 453 | void SetTypeInfoDataTableOffset( int typeInfoDataTableOffset ) const
|
---|
| 454 | {
|
---|
| 455 | this->typeInfoDataTableOffset = typeInfoDataTableOffset;
|
---|
| 456 | }
|
---|
| 457 | int GetTypeInfoDataTableOffset() const
|
---|
| 458 | {
|
---|
| 459 | return typeInfoDataTableOffset;
|
---|
| 460 | }
|
---|
| 461 |
|
---|
[387] | 462 | // 動的型データ用のメンバデータを取得
|
---|
| 463 | std::string GetStaticDefiningStringAsMemberNames() const;
|
---|
| 464 | std::string GetStaticDefiningStringAsMemberTypeInfoNames() const;
|
---|
[412] | 465 | std::string GetStaticDefiningStringAsMemberOffsets() const;
|
---|
[417] | 466 | void GetReferenceOffsetsInitializeBuffer( std::string &referenceOffsetsBuffer, int &numOfReference, int baseOffset = 0 ) const;
|
---|
[355] | 467 |
|
---|
[387] | 468 |
|
---|
[206] | 469 | //線形リスト用
|
---|
| 470 | CClass *pobj_NextClass;
|
---|
| 471 | };
|
---|
| 472 |
|
---|
[270] | 473 | class Classes : public Jenga::Common::Hashmap<CClass>
|
---|
[206] | 474 | {
|
---|
[191] | 475 | // XMLシリアライズ用
|
---|
[206] | 476 | public:
|
---|
| 477 | Classes()
|
---|
| 478 | : pCompilingMethod( NULL )
|
---|
| 479 | , pStringClass( NULL )
|
---|
| 480 | , pObjectClass( NULL )
|
---|
[350] | 481 | , pInterfaceInfo( NULL )
|
---|
[206] | 482 | {
|
---|
| 483 | }
|
---|
| 484 | ~Classes()
|
---|
| 485 | {
|
---|
| 486 | }
|
---|
| 487 |
|
---|
| 488 | virtual CClass *Create( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name);
|
---|
[369] | 489 | bool Insert( CClass *pClass, int nowLine );
|
---|
[206] | 490 | CClass *Add( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine);
|
---|
| 491 |
|
---|
[342] | 492 | // vtblを一時的に生成
|
---|
[282] | 493 | void GenerateVTables();
|
---|
[206] | 494 |
|
---|
[342] | 495 | // vtblのを正規のオフセットで再構築
|
---|
| 496 | void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection, LONG_PTR MemPos_DataSection );
|
---|
| 497 |
|
---|
[206] | 498 | virtual void InitStaticMember();
|
---|
| 499 |
|
---|
| 500 | virtual void Compile_System_InitializeUserTypes();
|
---|
[355] | 501 | virtual void Compile_System_InitializeUserTypesForBaseType();
|
---|
[206] | 502 |
|
---|
[523] | 503 | const CClass *Find( const NamespaceScopes &namespaceScopes, const std::string &name ) const;
|
---|
| 504 | const CClass *Find( const std::string &fullName ) const;
|
---|
[206] | 505 |
|
---|
| 506 |
|
---|
| 507 | /////////////////////////////
|
---|
| 508 | // 現在コンパイル中の情報
|
---|
| 509 | /////////////////////////////
|
---|
| 510 | private:
|
---|
| 511 | const CMethod *pCompilingMethod;
|
---|
| 512 | public:
|
---|
| 513 | void StartCompile( const UserProc *pUserProc );
|
---|
| 514 |
|
---|
| 515 | //現在コンパイル中のメソッド情報を取得
|
---|
| 516 | const CMethod *GetNowCompilingMethodInfo(){
|
---|
| 517 | return pCompilingMethod;
|
---|
| 518 | }
|
---|
| 519 |
|
---|
| 520 |
|
---|
| 521 | /////////////////////////////
|
---|
| 522 | // 特殊クラス
|
---|
| 523 | /////////////////////////////
|
---|
[272] | 524 | mutable const CClass *pStringClass;
|
---|
| 525 | mutable const CClass *pObjectClass;
|
---|
[349] | 526 | mutable const CClass *pInterfaceInfo;
|
---|
[272] | 527 | const CClass *GetStringClassPtr() const;
|
---|
| 528 | const CClass *GetObjectClassPtr() const;
|
---|
[349] | 529 | const CClass *GetInterfaceInfoClassPtr() const;
|
---|
[184] | 530 | };
|
---|