[184] | 1 | #pragma once
|
---|
| 2 |
|
---|
[637] | 3 | class Procedure
|
---|
| 4 | : public RelationalObjectModuleItem
|
---|
[184] | 5 | {
|
---|
| 6 | public:
|
---|
[206] | 7 | // 種類
|
---|
| 8 | enum Kind{
|
---|
| 9 | Sub,
|
---|
| 10 | Function,
|
---|
| 11 | };
|
---|
| 12 |
|
---|
| 13 | private:
|
---|
| 14 | Kind kind;
|
---|
| 15 |
|
---|
| 16 | bool isCdecl;
|
---|
| 17 | mutable bool isUsing;
|
---|
| 18 |
|
---|
| 19 | // パラメータ
|
---|
| 20 | Parameters params;
|
---|
| 21 |
|
---|
[572] | 22 | protected:
|
---|
| 23 |
|
---|
[206] | 24 | // 戻り値の型
|
---|
| 25 | Type returnType;
|
---|
| 26 |
|
---|
[632] | 27 | private:
|
---|
[206] | 28 | // ソースコードの位置
|
---|
[632] | 29 | SourceCodePosition sourceCodePosition;
|
---|
[206] | 30 |
|
---|
| 31 | // XMLシリアライズ用
|
---|
| 32 | private:
|
---|
| 33 | friend class boost::serialization::access;
|
---|
[208] | 34 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
[184] | 35 | {
|
---|
[206] | 36 | trace_for_serialize( "serializing - Procedure" );
|
---|
| 37 |
|
---|
[637] | 38 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( RelationalObjectModuleItem );
|
---|
[206] | 39 | ar & BOOST_SERIALIZATION_NVP( kind );
|
---|
| 40 | ar & BOOST_SERIALIZATION_NVP( isCdecl );
|
---|
| 41 | ar & BOOST_SERIALIZATION_NVP( isUsing );
|
---|
| 42 | ar & BOOST_SERIALIZATION_NVP( params );
|
---|
| 43 | ar & BOOST_SERIALIZATION_NVP( returnType );
|
---|
[632] | 44 | ar & BOOST_SERIALIZATION_NVP( sourceCodePosition );
|
---|
[184] | 45 | }
|
---|
[206] | 46 |
|
---|
| 47 | public:
|
---|
[637] | 48 | Procedure( const Symbol &symbol, Kind kind, bool isCdecl )
|
---|
| 49 | : RelationalObjectModuleItem( symbol )
|
---|
[206] | 50 | , kind( kind )
|
---|
| 51 | , isCdecl( isCdecl )
|
---|
| 52 | , isUsing( false )
|
---|
| 53 | {
|
---|
| 54 | }
|
---|
| 55 | Procedure()
|
---|
| 56 | {
|
---|
| 57 | }
|
---|
[816] | 58 |
|
---|
| 59 | Procedure(Procedure const& y)
|
---|
| 60 | : RelationalObjectModuleItem(y)
|
---|
| 61 | , kind(y.kind)
|
---|
| 62 | , isCdecl(y.isCdecl)
|
---|
| 63 | , isUsing(y.isUsing)
|
---|
| 64 | , params(y.params)
|
---|
| 65 | , returnType(y.returnType)
|
---|
| 66 | , sourceCodePosition(y.sourceCodePosition)
|
---|
| 67 | {
|
---|
| 68 | }
|
---|
| 69 |
|
---|
| 70 | Procedure(Procedure&& y)
|
---|
| 71 | : RelationalObjectModuleItem(std::move(y))
|
---|
| 72 | , kind(std::move(y.kind))
|
---|
| 73 | , isCdecl(std::move(y.isCdecl))
|
---|
| 74 | , isUsing(std::move(y.isUsing))
|
---|
| 75 | , params(std::move(y.params))
|
---|
| 76 | , returnType(std::move(y.returnType))
|
---|
| 77 | , sourceCodePosition(std::move(y.sourceCodePosition))
|
---|
| 78 | {
|
---|
| 79 | }
|
---|
| 80 |
|
---|
| 81 | Procedure& operator =(Procedure&& y)
|
---|
| 82 | {
|
---|
| 83 | RelationalObjectModuleItem::operator =(std::move(y));
|
---|
| 84 | kind = std::move(y.kind);
|
---|
| 85 | isCdecl = std::move(y.isCdecl);
|
---|
| 86 | isUsing = std::move(y.isUsing);
|
---|
| 87 | params = std::move(y.params);
|
---|
| 88 | returnType = std::move(y.returnType);
|
---|
| 89 | sourceCodePosition = std::move(y.sourceCodePosition);
|
---|
| 90 | return *this;
|
---|
| 91 | }
|
---|
| 92 |
|
---|
| 93 | Procedure& operator =(Procedure const& y)
|
---|
| 94 | {
|
---|
| 95 | return *this = std::move(Procedure(y));
|
---|
| 96 | }
|
---|
| 97 |
|
---|
[206] | 98 | ~Procedure(){
|
---|
[750] | 99 | foreach( Parameter *pParam, params ){
|
---|
[206] | 100 | delete pParam;
|
---|
| 101 | }
|
---|
| 102 | }
|
---|
| 103 |
|
---|
| 104 | bool IsSub() const
|
---|
| 105 | {
|
---|
| 106 | return ( kind == Sub );
|
---|
| 107 | }
|
---|
| 108 | bool IsFunction() const
|
---|
| 109 | {
|
---|
| 110 | return ( kind == Function );
|
---|
| 111 | }
|
---|
| 112 |
|
---|
| 113 | bool IsCdecl() const
|
---|
| 114 | {
|
---|
| 115 | return isCdecl;
|
---|
| 116 | }
|
---|
| 117 | void Using() const
|
---|
| 118 | {
|
---|
| 119 | isUsing = true;
|
---|
| 120 | }
|
---|
| 121 | bool IsUsing() const
|
---|
| 122 | {
|
---|
| 123 | return isUsing;
|
---|
| 124 | }
|
---|
| 125 |
|
---|
[632] | 126 | const SourceCodePosition &GetSourceCodePosition() const
|
---|
[206] | 127 | {
|
---|
[632] | 128 | return sourceCodePosition;
|
---|
[206] | 129 | }
|
---|
[632] | 130 | void SetSourceCodePosition( const SourceCodePosition &sourceCodePosition )
|
---|
[572] | 131 | {
|
---|
[632] | 132 | this->sourceCodePosition = sourceCodePosition;
|
---|
[572] | 133 | }
|
---|
[637] | 134 | virtual void ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable );
|
---|
[206] | 135 |
|
---|
| 136 | const Parameters &Params() const
|
---|
| 137 | {
|
---|
| 138 | return params;
|
---|
| 139 | }
|
---|
[572] | 140 | Parameters &GetParameters()
|
---|
| 141 | {
|
---|
| 142 | return params;
|
---|
| 143 | }
|
---|
[206] | 144 | const Type &ReturnType() const
|
---|
| 145 | {
|
---|
| 146 | return returnType;
|
---|
| 147 | }
|
---|
[572] | 148 | Type &ReturnType()
|
---|
| 149 | {
|
---|
| 150 | return returnType;
|
---|
| 151 | }
|
---|
[639] | 152 |
|
---|
[640] | 153 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
[184] | 154 | };
|
---|
| 155 |
|
---|
[206] | 156 | class UserProc : public Procedure, public Jenga::Common::ObjectInHashmap<UserProc>
|
---|
[184] | 157 | {
|
---|
| 158 | public:
|
---|
[523] | 159 | std::string _paramStr;
|
---|
[184] | 160 |
|
---|
[206] | 161 | private:
|
---|
| 162 | NamespaceScopesCollection importedNamespaces;
|
---|
[184] | 163 |
|
---|
[206] | 164 | // 親クラスと対応するメソッド
|
---|
| 165 | const CClass *pParentClass;
|
---|
[353] | 166 | const Interface *pInterface;
|
---|
[206] | 167 | CMethod *pMethod;
|
---|
| 168 |
|
---|
| 169 | bool isMacro;
|
---|
| 170 |
|
---|
| 171 | // パラメータの追加情報
|
---|
| 172 | int secondParmNum;
|
---|
| 173 | Parameters realParams;
|
---|
| 174 | int realSecondParmNum;
|
---|
| 175 |
|
---|
| 176 | // 各種フラグ
|
---|
| 177 | bool isExport;
|
---|
[641] | 178 | mutable bool isAutoGenerationSystem;
|
---|
[206] | 179 | mutable bool isAutoGeneration;
|
---|
| 180 | mutable bool isCompiled;
|
---|
| 181 |
|
---|
| 182 | mutable DWORD beginOpAddress;
|
---|
| 183 | mutable DWORD endOpAddress;
|
---|
| 184 |
|
---|
| 185 | // ローカル変数
|
---|
| 186 | mutable Variables localVars;
|
---|
| 187 |
|
---|
| 188 | // 識別ID
|
---|
| 189 | int id;
|
---|
| 190 |
|
---|
[224] | 191 | // ネイティブコード
|
---|
| 192 | NativeCode nativeCode;
|
---|
| 193 |
|
---|
[206] | 194 | // XMLシリアライズ用
|
---|
| 195 | private:
|
---|
| 196 | friend class boost::serialization::access;
|
---|
| 197 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
[184] | 198 | {
|
---|
[206] | 199 | trace_for_serialize( "serializing - UserProc" );
|
---|
| 200 |
|
---|
| 201 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
|
---|
[639] | 202 | ar & boost::serialization::make_nvp("pParentClass", const_cast<CClass *&>(pParentClass) );
|
---|
[640] | 203 | ar & boost::serialization::make_nvp("pInterface", const_cast<Interface *&>(pInterface) );
|
---|
[637] | 204 |
|
---|
| 205 | if( ActiveBasic::Common::Environment::IsRemoveExternal() )
|
---|
| 206 | {
|
---|
| 207 | if( this->IsExternal() )
|
---|
| 208 | {
|
---|
| 209 | this->NeedResolve();
|
---|
| 210 | return;
|
---|
| 211 | }
|
---|
| 212 | }
|
---|
| 213 |
|
---|
[206] | 214 | ar & BOOST_SERIALIZATION_NVP( _paramStr );
|
---|
| 215 | ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
|
---|
| 216 | ar & BOOST_SERIALIZATION_NVP( pMethod );
|
---|
| 217 | ar & BOOST_SERIALIZATION_NVP( isMacro );
|
---|
| 218 | ar & BOOST_SERIALIZATION_NVP( secondParmNum );
|
---|
| 219 | ar & BOOST_SERIALIZATION_NVP( realParams );
|
---|
| 220 | ar & BOOST_SERIALIZATION_NVP( realSecondParmNum );
|
---|
| 221 | ar & BOOST_SERIALIZATION_NVP( isExport );
|
---|
[641] | 222 | ar & BOOST_SERIALIZATION_NVP( isAutoGenerationSystem );
|
---|
[206] | 223 | ar & BOOST_SERIALIZATION_NVP( isAutoGeneration );
|
---|
| 224 | ar & BOOST_SERIALIZATION_NVP( isCompiled );
|
---|
| 225 | ar & BOOST_SERIALIZATION_NVP( beginOpAddress );
|
---|
| 226 | ar & BOOST_SERIALIZATION_NVP( endOpAddress );
|
---|
| 227 | ar & BOOST_SERIALIZATION_NVP( localVars );
|
---|
| 228 | ar & BOOST_SERIALIZATION_NVP( id );
|
---|
[224] | 229 | ar & BOOST_SERIALIZATION_NVP( nativeCode );
|
---|
[184] | 230 | }
|
---|
| 231 |
|
---|
[206] | 232 | public:
|
---|
| 233 |
|
---|
[637] | 234 | UserProc( const Symbol &symbol, const NamespaceScopesCollection &importedNamespaces, Kind kind, bool isMacro, bool isCdecl, bool isExport );
|
---|
[632] | 235 | UserProc( const UserProc &userProc, const CClass *pParentClass );
|
---|
| 236 | UserProc();
|
---|
| 237 | ~UserProc();
|
---|
[206] | 238 |
|
---|
[511] | 239 | void SetReturnType( const Type &newReturnType )
|
---|
| 240 | {
|
---|
| 241 | returnType = newReturnType;
|
---|
| 242 | }
|
---|
| 243 |
|
---|
[206] | 244 | virtual const std::string &GetKeyName() const
|
---|
| 245 | {
|
---|
| 246 | return GetName();
|
---|
| 247 | }
|
---|
| 248 |
|
---|
[209] | 249 | virtual bool IsDuplication( const UserProc *pUserProc ) const
|
---|
| 250 | {
|
---|
[640] | 251 | bool isEqualParentClass =
|
---|
| 252 | this->HasParentClass() && pUserProc->HasParentClass()
|
---|
| 253 | ? this->GetParentClassPtr()->Equals( pUserProc->GetParentClassPtr() )
|
---|
| 254 | : this->GetParentClassPtr() == pUserProc->GetParentClassPtr();
|
---|
| 255 | bool isEqualInterface =
|
---|
| 256 | this->pInterface && pUserProc->pInterface
|
---|
| 257 | ? this->pInterface->Equals( pUserProc->pInterface )
|
---|
| 258 | : this->pInterface == pUserProc->pInterface;
|
---|
| 259 |
|
---|
| 260 | if( isEqualParentClass // 親クラスが等しい
|
---|
| 261 | && isEqualInterface // インターフェイスが等しい
|
---|
| 262 | && pUserProc->IsEqualSymbol( *this ) // 名前空間及び名前が等しい
|
---|
| 263 | && this->Params().Equals( pUserProc->Params() ) // パラメータが等しい
|
---|
| 264 | && this->returnType.Equals( pUserProc->returnType ) ) // 戻り値が等しい
|
---|
[209] | 265 | {
|
---|
| 266 | return true;
|
---|
| 267 | }
|
---|
| 268 | return false;
|
---|
| 269 | }
|
---|
| 270 |
|
---|
[637] | 271 | virtual void ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable );
|
---|
| 272 |
|
---|
[382] | 273 | /*!
|
---|
| 274 | @brief オーバーライド用に関数同士が等しいかどうかをチェックする
|
---|
| 275 | @param actualTypeParametersForThisProc thisオブジェクトで保有するメソッドを対象とした実型パラメータ
|
---|
| 276 | pUserProc 照らし合わせる関数
|
---|
| 277 | */
|
---|
| 278 | bool IsEqualForOverride( const Types &actualTypeParametersForThisProc, const UserProc *pUserProc ) const;
|
---|
[351] | 279 |
|
---|
[206] | 280 | bool IsMacro() const
|
---|
| 281 | {
|
---|
| 282 | return isMacro;
|
---|
| 283 | }
|
---|
| 284 |
|
---|
| 285 | int GetSecondParmNum() const
|
---|
| 286 | {
|
---|
| 287 | return secondParmNum;
|
---|
| 288 | }
|
---|
[572] | 289 | void SetSecondParmNum( int secondParmNum )
|
---|
| 290 | {
|
---|
| 291 | this->secondParmNum = secondParmNum;
|
---|
| 292 | }
|
---|
[206] | 293 | const Parameters &RealParams() const
|
---|
| 294 | {
|
---|
| 295 | return realParams;
|
---|
| 296 | }
|
---|
[572] | 297 | Parameters &RealParams()
|
---|
| 298 | {
|
---|
| 299 | return realParams;
|
---|
| 300 | }
|
---|
[511] | 301 | void SetRealParams( const Parameters ¶ms )
|
---|
| 302 | {
|
---|
| 303 | realParams = params;
|
---|
| 304 | }
|
---|
[206] | 305 | int GetRealSecondParmNum() const
|
---|
| 306 | {
|
---|
| 307 | return realSecondParmNum;
|
---|
| 308 | }
|
---|
| 309 |
|
---|
| 310 | void ExportOff(){
|
---|
| 311 | isExport = false;
|
---|
| 312 | }
|
---|
| 313 | bool IsExport() const
|
---|
| 314 | {
|
---|
| 315 | return isExport;
|
---|
| 316 | }
|
---|
[641] | 317 | void ThisIsAutoGenerationSystemProc() const
|
---|
[206] | 318 | {
|
---|
[641] | 319 | isAutoGenerationSystem = true;
|
---|
[206] | 320 | }
|
---|
[641] | 321 | bool IsAutoGenerationSystem() const
|
---|
[206] | 322 | {
|
---|
[641] | 323 | return isAutoGenerationSystem;
|
---|
[206] | 324 | }
|
---|
| 325 | void ThisIsAutoGenerationProc() const
|
---|
| 326 | {
|
---|
| 327 | isAutoGeneration = true;
|
---|
| 328 | }
|
---|
| 329 | bool IsAutoGeneration() const
|
---|
| 330 | {
|
---|
| 331 | return isAutoGeneration;
|
---|
| 332 | }
|
---|
[641] | 333 | bool IsSystem() const;
|
---|
[206] | 334 | void CompleteCompile() const
|
---|
| 335 | {
|
---|
| 336 | isCompiled = true;
|
---|
| 337 | }
|
---|
| 338 | void KillCompileStatus() const
|
---|
| 339 | {
|
---|
| 340 | isCompiled = false;
|
---|
| 341 | }
|
---|
| 342 | bool IsCompiled() const
|
---|
| 343 | {
|
---|
| 344 | return isCompiled;
|
---|
| 345 | }
|
---|
[702] | 346 | bool IsConstructor() const
|
---|
| 347 | {
|
---|
| 348 | return ( this->HasParentClass() && this->GetName() == this->GetParentClass().GetName() );
|
---|
| 349 | }
|
---|
[206] | 350 | bool IsDestructor() const
|
---|
| 351 | {
|
---|
| 352 | return ( GetName()[0] == '~' );
|
---|
| 353 | }
|
---|
| 354 |
|
---|
| 355 | // バイナリコード位置とサイズ
|
---|
| 356 | DWORD GetBeginOpAddress() const
|
---|
| 357 | {
|
---|
| 358 | return beginOpAddress;
|
---|
| 359 | }
|
---|
| 360 | void SetBeginOpAddress( DWORD beginOpAddress ) const
|
---|
| 361 | {
|
---|
| 362 | this->beginOpAddress = beginOpAddress;
|
---|
| 363 | }
|
---|
| 364 | DWORD GetEndOpAddress() const
|
---|
| 365 | {
|
---|
| 366 | return endOpAddress;
|
---|
| 367 | }
|
---|
| 368 | void SetEndOpAddress( DWORD endOpAddress ) const
|
---|
| 369 | {
|
---|
| 370 | this->endOpAddress = endOpAddress;
|
---|
| 371 | }
|
---|
| 372 | int GetCodeSize() const
|
---|
| 373 | {
|
---|
| 374 | return endOpAddress - beginOpAddress;
|
---|
| 375 | }
|
---|
| 376 |
|
---|
[208] | 377 | virtual const NamespaceScopes &GetNamespaceScopes() const;
|
---|
[206] | 378 | const NamespaceScopesCollection &GetImportedNamespaces() const;
|
---|
| 379 |
|
---|
| 380 | Variables &GetLocalVars() const
|
---|
| 381 | {
|
---|
| 382 | return localVars;
|
---|
| 383 | }
|
---|
| 384 |
|
---|
| 385 | int GetId() const
|
---|
| 386 | {
|
---|
| 387 | return id;
|
---|
| 388 | }
|
---|
| 389 |
|
---|
[257] | 390 | const NativeCode &GetNativeCode() const
|
---|
| 391 | {
|
---|
| 392 | return nativeCode;
|
---|
| 393 | }
|
---|
[225] | 394 | NativeCode &GetNativeCode()
|
---|
| 395 | {
|
---|
| 396 | return nativeCode;
|
---|
| 397 | }
|
---|
| 398 |
|
---|
[206] | 399 | std::string GetFullName() const;
|
---|
[350] | 400 | bool IsCastOperator() const;
|
---|
[206] | 401 |
|
---|
| 402 | bool IsVirtual() const;
|
---|
| 403 |
|
---|
| 404 | void SetParentClass( const CClass *pParentClass ){
|
---|
| 405 | this->pParentClass = pParentClass;
|
---|
| 406 | }
|
---|
| 407 | const CClass *GetParentClassPtr() const
|
---|
| 408 | {
|
---|
| 409 | return pParentClass;
|
---|
| 410 | }
|
---|
| 411 | const CClass &GetParentClass() const
|
---|
| 412 | {
|
---|
| 413 | return *pParentClass;
|
---|
| 414 | }
|
---|
| 415 | bool HasParentClass() const
|
---|
| 416 | {
|
---|
| 417 | return ( pParentClass != NULL );
|
---|
| 418 | }
|
---|
[208] | 419 | bool IsGlobalProcedure() const
|
---|
| 420 | {
|
---|
| 421 | return ( pParentClass == NULL );
|
---|
| 422 | }
|
---|
[353] | 423 | void SetInterface( const Interface *pInterface )
|
---|
| 424 | {
|
---|
| 425 | this->pInterface = pInterface;
|
---|
| 426 | }
|
---|
[206] | 427 | void SetMethod( CMethod *pMethod ){
|
---|
| 428 | this->pMethod = pMethod;
|
---|
| 429 | }
|
---|
[336] | 430 | const CMethod &GetMethod() const;
|
---|
[206] | 431 |
|
---|
[640] | 432 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
[206] | 433 |
|
---|
[364] | 434 | static const UserProc *pGlobalProc;
|
---|
[816] | 435 |
|
---|
| 436 | private:
|
---|
| 437 | UserProc(UserProc const&);
|
---|
| 438 | UserProc& operator =(UserProc const&);
|
---|
[184] | 439 | };
|
---|
| 440 |
|
---|
[206] | 441 | class UserProcs : public Jenga::Common::Hashmap<UserProc>
|
---|
[184] | 442 | {
|
---|
[206] | 443 | // XMLシリアライズ用
|
---|
| 444 | private:
|
---|
| 445 | friend class boost::serialization::access;
|
---|
| 446 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 447 | {
|
---|
| 448 | trace_for_serialize( "serializing - UserProcs" );
|
---|
| 449 |
|
---|
| 450 | ar & boost::serialization::make_nvp("Hashmap_UserProcImpl",
|
---|
| 451 | boost::serialization::base_object<Jenga::Common::Hashmap<UserProc>>(*this));
|
---|
| 452 | }
|
---|
| 453 |
|
---|
| 454 |
|
---|
[184] | 455 | public:
|
---|
[206] | 456 | UserProcs()
|
---|
[184] | 457 | {
|
---|
| 458 | }
|
---|
[206] | 459 | ~UserProcs()
|
---|
| 460 | {
|
---|
| 461 | }
|
---|
[184] | 462 |
|
---|
[576] | 463 | void EnumGlobalProcs( const char *simpleName, const Symbol &localSymbol, std::vector<const UserProc *> &subs );
|
---|
[816] | 464 |
|
---|
| 465 | private:
|
---|
| 466 | UserProcs(UserProcs const&);
|
---|
| 467 | UserProcs& operator =(UserProcs const&);
|
---|
[206] | 468 | };
|
---|
| 469 |
|
---|
[637] | 470 | class DllProc
|
---|
| 471 | : public Procedure
|
---|
| 472 | , public Jenga::Common::ObjectInHashmap<DllProc>
|
---|
[206] | 473 | {
|
---|
[523] | 474 | std::string dllFileName;
|
---|
| 475 | std::string alias;
|
---|
[206] | 476 | int lookupAddress;
|
---|
| 477 |
|
---|
| 478 | // XMLシリアライズ用
|
---|
| 479 | private:
|
---|
| 480 | friend class boost::serialization::access;
|
---|
| 481 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 482 | {
|
---|
| 483 | trace_for_serialize( "serializing - DllProc" );
|
---|
| 484 |
|
---|
| 485 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
|
---|
[637] | 486 |
|
---|
| 487 | if( ActiveBasic::Common::Environment::IsRemoveExternal() )
|
---|
| 488 | {
|
---|
| 489 | if( this->IsExternal() )
|
---|
| 490 | {
|
---|
| 491 | this->NeedResolve();
|
---|
| 492 | return;
|
---|
| 493 | }
|
---|
| 494 | }
|
---|
| 495 |
|
---|
[206] | 496 | ar & BOOST_SERIALIZATION_NVP( dllFileName );
|
---|
| 497 | ar & BOOST_SERIALIZATION_NVP( alias );
|
---|
| 498 | ar & BOOST_SERIALIZATION_NVP( lookupAddress );
|
---|
| 499 | }
|
---|
| 500 |
|
---|
| 501 | public:
|
---|
[637] | 502 | DllProc( const Symbol &symbol, Kind kind, bool isCdecl, const std::string &dllFileName, const std::string &alias )
|
---|
| 503 | : Procedure( symbol, kind, isCdecl )
|
---|
[210] | 504 | , dllFileName( dllFileName )
|
---|
| 505 | , alias( alias )
|
---|
| 506 | , lookupAddress( 0 )
|
---|
[206] | 507 | {
|
---|
| 508 | }
|
---|
[210] | 509 | DllProc()
|
---|
| 510 | {
|
---|
| 511 | }
|
---|
[209] | 512 | ~DllProc()
|
---|
| 513 | {
|
---|
| 514 | }
|
---|
[206] | 515 |
|
---|
[209] | 516 | virtual const std::string &GetKeyName() const
|
---|
| 517 | {
|
---|
| 518 | return GetName();
|
---|
| 519 | }
|
---|
| 520 |
|
---|
| 521 | virtual bool IsDuplication( const DllProc *pDllProc ) const
|
---|
| 522 | {
|
---|
| 523 | if( pDllProc->IsEqualSymbol( *this )
|
---|
| 524 | && this->Params().Equals( pDllProc->Params() ) )
|
---|
| 525 | {
|
---|
| 526 | return true;
|
---|
| 527 | }
|
---|
| 528 | return false;
|
---|
| 529 | }
|
---|
| 530 |
|
---|
[523] | 531 | const std::string &GetDllFileName() const
|
---|
[206] | 532 | {
|
---|
| 533 | return dllFileName;
|
---|
| 534 | }
|
---|
[523] | 535 | const std::string &GetAlias() const
|
---|
[206] | 536 | {
|
---|
| 537 | return alias;
|
---|
| 538 | }
|
---|
| 539 |
|
---|
| 540 | void SetLookupAddress( int lookupAddress ){
|
---|
| 541 | this->lookupAddress = lookupAddress;
|
---|
| 542 | }
|
---|
| 543 | int GetLookupAddress() const
|
---|
| 544 | {
|
---|
| 545 | return lookupAddress;
|
---|
| 546 | }
|
---|
[637] | 547 |
|
---|
[640] | 548 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
[816] | 549 |
|
---|
| 550 | private:
|
---|
| 551 | DllProc(DllProc const&);
|
---|
| 552 | DllProc& operator =(DllProc const&);
|
---|
[184] | 553 | };
|
---|
[209] | 554 | class DllProcs : public Jenga::Common::Hashmap<DllProc>
|
---|
| 555 | {
|
---|
[816] | 556 | public:
|
---|
| 557 | DllProcs() {}
|
---|
| 558 |
|
---|
[209] | 559 | // XMLシリアライズ用
|
---|
| 560 | private:
|
---|
| 561 | friend class boost::serialization::access;
|
---|
| 562 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 563 | {
|
---|
| 564 | trace_for_serialize( "serializing - DllProcs" );
|
---|
[184] | 565 |
|
---|
[209] | 566 | ar & boost::serialization::make_nvp("Hashmap_DllProc",
|
---|
| 567 | boost::serialization::base_object<Jenga::Common::Hashmap<DllProc>>(*this));
|
---|
| 568 | }
|
---|
[816] | 569 |
|
---|
| 570 | DllProcs(DllProcs const&);
|
---|
| 571 | DllProcs& operator =(DllProcs const&);
|
---|
[209] | 572 | };
|
---|
| 573 |
|
---|
[637] | 574 | class ProcPointer
|
---|
| 575 | : public Procedure
|
---|
[184] | 576 | {
|
---|
[206] | 577 | // XMLシリアライズ用
|
---|
| 578 | private:
|
---|
| 579 | friend class boost::serialization::access;
|
---|
| 580 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 581 | {
|
---|
| 582 | trace_for_serialize( "serializing - ProcPointer" );
|
---|
| 583 |
|
---|
| 584 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
|
---|
| 585 | }
|
---|
| 586 |
|
---|
[184] | 587 | public:
|
---|
[206] | 588 | ProcPointer( Kind kind )
|
---|
[637] | 589 | : Procedure( Symbol( NamespaceScopes(), std::string() ), kind, false )
|
---|
[184] | 590 | {
|
---|
| 591 | }
|
---|
[206] | 592 | ProcPointer()
|
---|
| 593 | {
|
---|
| 594 | }
|
---|
[637] | 595 | ~ProcPointer()
|
---|
| 596 | {
|
---|
| 597 | }
|
---|
| 598 |
|
---|
[640] | 599 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
[816] | 600 |
|
---|
| 601 | ProcPointer(ProcPointer const&);
|
---|
| 602 | ProcPointer& operator =(ProcPointer const&);
|
---|
[184] | 603 | };
|
---|
| 604 |
|
---|
[523] | 605 | class ProcPointers : public std::vector<ProcPointer *>
|
---|
[184] | 606 | {
|
---|
[206] | 607 | // XMLシリアライズ用
|
---|
| 608 | private:
|
---|
| 609 | friend class boost::serialization::access;
|
---|
| 610 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 611 | {
|
---|
| 612 | trace_for_serialize( "serializing - ProcPointers" );
|
---|
| 613 |
|
---|
| 614 | ar & boost::serialization::make_nvp("vector_ProcPointer",
|
---|
| 615 | boost::serialization::base_object<vector<ProcPointer *>>(*this));
|
---|
| 616 | }
|
---|
| 617 |
|
---|
[184] | 618 | public:
|
---|
[206] | 619 | ProcPointers()
|
---|
[184] | 620 | {
|
---|
| 621 | }
|
---|
[206] | 622 | ~ProcPointers()
|
---|
[184] | 623 | {
|
---|
| 624 | Clear();
|
---|
| 625 | }
|
---|
| 626 |
|
---|
[271] | 627 | void Clear();
|
---|
| 628 | void PullOutAll()
|
---|
| 629 | {
|
---|
| 630 | clear();
|
---|
| 631 | }
|
---|
[816] | 632 |
|
---|
| 633 | ProcPointers(ProcPointers const&);
|
---|
| 634 | ProcPointers& operator =(ProcPointers const&);
|
---|
[184] | 635 | };
|
---|