Changeset 750 in dev for trunk/ab5.0/abdev/ab_common/src


Ignore:
Timestamp:
Sep 24, 2008, 2:02:16 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

BOOST_FOREACHを可能なものはVC++ 2005 for eachへ置換(やや速くなる)。

Location:
trunk/ab5.0/abdev/ab_common/src/Lexical
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/ab_common/src/Lexical/Class.cpp

    r735 r750  
    9999    // 仮想関数になるメソッドに使用チェックをつける
    100100    const CClass &_class = *this;
    101     BOOST_FOREACH( const CMethod *pMethod, _class.GetDynamicMethods() )
     101    foreach( const CMethod *pMethod, _class.GetDynamicMethods() )
    102102    {
    103103        if( pMethod->IsVirtual() )
     
    108108
    109109    // インターフェイスメソッドに使用チェックをつける
    110     BOOST_FOREACH( const ::Interface *pInterface, _class.GetInterfaces() )
    111     {
    112         BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() )
     110    foreach( const ::Interface *pInterface, _class.GetInterfaces() )
     111    {
     112        foreach( const CMethod *pMethod, pInterface->GetDynamicMethods() )
    113113        {
    114114            pMethod->GetUserProc().Using();
     
    210210bool CClass::IsInheritsInterface( const CClass *pInterfaceClass ) const
    211211{
    212     BOOST_FOREACH( const ::Interface *pInterface, interfaces ){
     212    foreach( const ::Interface *pInterface, interfaces ){
    213213        if( pInterfaceClass == &pInterface->GetClass() ){
    214214            return true;
     
    223223    const Methods& inheritsClassMethods = inheritsClass.GetDynamicMethods();
    224224    GetDynamicMethods().reserve( inheritsClassMethods.size() );
    225     BOOST_FOREACH( const CMethod *pBaseMethod, inheritsClassMethods ){
     225    foreach( const CMethod *pBaseMethod, inheritsClassMethods ){
    226226        CMethod *pMethod = new DynamicMethod( *pBaseMethod );
    227227
     
    256256    const Interfaces& inheritsClassInterfaces = inheritsClass.GetInterfaces();
    257257    interfaces.reserve( inheritsClassInterfaces.size() );
    258     BOOST_FOREACH( const ::Interface *pInterface, inheritsClassInterfaces )
     258    foreach( const ::Interface *pInterface, inheritsClassInterfaces )
    259259    {
    260260        interfaces.push_back( new ::Interface( *pInterface ) );
     
    298298
    299299    //メソッド
    300     BOOST_FOREACH( const CMethod *pMethod, GetDynamicMethods() ){
     300    foreach( const CMethod *pMethod, GetDynamicMethods() ){
    301301        if(  name == pMethod->GetUserProc().GetName() ){
    302302            return 1;
     
    320320
    321321    // 動的メンバ
    322     BOOST_FOREACH( const Member *pMember, dynamicMembers )
     322    foreach( const Member *pMember, dynamicMembers )
    323323    {
    324324        if( GetName() == pMember->GetName() )
     
    329329
    330330    // 静的メンバ
    331     BOOST_FOREACH( Member *pMember, staticMembers ){
     331    foreach( Member *pMember, staticMembers ){
    332332        if( GetName() == pMember->GetName() ){
    333333            return true;
     
    350350    }
    351351
    352     BOOST_FOREACH( Member *pMember, GetDynamicMembers() )
     352    foreach( Member *pMember, GetDynamicMembers() )
    353353    {
    354354        if( pMember->GetName() == memberName )
     
    366366
    367367    // インターフェイス メソッド
    368     BOOST_FOREACH( ::Interface *pInterface, GetInterfaces() )
     368    foreach( ::Interface *pInterface, GetInterfaces() )
    369369    {
    370370        pInterface->GetDynamicMethods().Enum( methodName, subs );
     
    379379    {
    380380        // インターフェイス メソッド
    381         BOOST_FOREACH( ::Interface *pInterface, GetInterfaces() )
     381        foreach( ::Interface *pInterface, GetInterfaces() )
    382382        {
    383383            result = pInterface->GetDynamicMethods().GetMethodPtr( pUserProc );
     
    446446    }
    447447
    448     BOOST_FOREACH( Member *pMember, dynamicMembers )
     448    foreach( Member *pMember, dynamicMembers )
    449449    {
    450450        const Type& memberType = pMember->GetType();
     
    553553    }
    554554
    555     BOOST_FOREACH( Member *pMember, dynamicMembers )
     555    foreach( Member *pMember, dynamicMembers )
    556556    {
    557557        // メンバサイズ
     
    654654    }
    655655
    656     BOOST_FOREACH( Member *pMember, dynamicMembers )
     656    foreach( Member *pMember, dynamicMembers )
    657657    {
    658658        int tempAlignment = pMember->GetType().GetSize();
     
    678678
    679679    vtblIndex = 0;
    680     BOOST_FOREACH( const CMethod *pMethod, GetDynamicMethods() ){
     680    foreach( const CMethod *pMethod, GetDynamicMethods() ){
    681681        if( &pMethod->GetUserProc() == pUserProc )
    682682        {
     
    690690    }
    691691
    692     BOOST_FOREACH( const ::Interface *pInterface, interfaces )
     692    foreach( const ::Interface *pInterface, interfaces )
    693693    {
    694694        vtblMasterListIndex++;
    695695
    696696        vtblIndex = 0;
    697         BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() ){
     697        foreach( const CMethod *pMethod, pInterface->GetDynamicMethods() ){
    698698            if( &pMethod->GetUserProc() == pUserProc )
    699699            {
     
    715715    int result = 0;
    716716
    717     BOOST_FOREACH( const ::Interface *pInterface, interfaces )
     717    foreach( const ::Interface *pInterface, interfaces )
    718718    {
    719719        result++;
     
    742742    // 未実装(abstract)の仮想関数を持つ場合はtrueを返す
    743743
    744     BOOST_FOREACH( const CMethod *pMethod, GetDynamicMethods() ){
     744    foreach( const CMethod *pMethod, GetDynamicMethods() ){
    745745        if(pMethod->IsVirtual()){
    746746            if(pMethod->IsAbstract()){
     
    751751
    752752    // インターフェイスのvtbl
    753     BOOST_FOREACH( const ::Interface *pInterface, interfaces )
    754     {
    755         BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() ){
     753    foreach( const ::Interface *pInterface, interfaces )
     754    {
     755        foreach( const CMethod *pMethod, pInterface->GetDynamicMethods() ){
    756756            if(pMethod->IsVirtual()){
    757757                if(pMethod->IsAbstract()){
     
    791791        pClass = classes.front();
    792792
    793         BOOST_FOREACH( const CClass *pTempClass, classes )
     793        foreach( const CClass *pTempClass, classes )
    794794        {
    795795            if( pClass->GetNamespaceScopes().size() < pTempClass->GetNamespaceScopes().size() )
     
    837837    std::string result;
    838838
    839     BOOST_FOREACH( const Member *pMember, dynamicMembers )
     839    foreach( const Member *pMember, dynamicMembers )
    840840    {
    841841        if( result.size() )
     
    853853    std::string result;
    854854
    855     BOOST_FOREACH( const Member *pMember, dynamicMembers )
     855    foreach( const Member *pMember, dynamicMembers )
    856856    {
    857857        if( result.size() )
     
    874874{
    875875    const CClass &thisClass = *this;
    876     BOOST_FOREACH( const Member *pMember, thisClass.GetDynamicMembers() )
     876    foreach( const Member *pMember, thisClass.GetDynamicMembers() )
    877877    {
    878878        if( pMember->GetType().IsObject() || pMember->GetType().IsPointer() )
     
    935935
    936936    // 実装するインターフェイス
    937     BOOST_FOREACH( ::Interface *pInterface, interfaces )
     937    foreach( ::Interface *pInterface, interfaces )
    938938    {
    939939        pInterface->Resolve( resolver, resolveErrors );
     
    941941
    942942    // 動的メンバ
    943     BOOST_FOREACH( Member *pMember, dynamicMembers )
     943    foreach( Member *pMember, dynamicMembers )
    944944    {
    945945        pMember->Resolve( resolver, resolveErrors );
     
    947947
    948948    // 静的メンバ
    949     BOOST_FOREACH( Member *pMember, staticMembers )
     949    foreach( Member *pMember, staticMembers )
    950950    {
    951951        pMember->Resolve( resolver, resolveErrors );
     
    953953
    954954    // 動的メソッド
    955     BOOST_FOREACH( CMethod *pMethod, GetDynamicMethods() )
     955    foreach( CMethod *pMethod, GetDynamicMethods() )
    956956    {
    957957        pMethod->Resolve( resolver, resolveErrors );
     
    959959
    960960    // 静的メソッド
    961     BOOST_FOREACH( CMethod *pMethod, staticMethods )
     961    foreach( CMethod *pMethod, staticMethods )
    962962    {
    963963        pMethod->Resolve( resolver, resolveErrors );
     
    965965
    966966    // テンプレート展開後のクラス
    967     BOOST_FOREACH( ActiveBasic::Common::Lexical::ExpandedTemplateClass *pExpandedTemplateClass, expandedTemplateClasses )
     967    foreach( ActiveBasic::Common::Lexical::ExpandedTemplateClass *pExpandedTemplateClass, expandedTemplateClasses )
    968968    {
    969969        pExpandedTemplateClass->Resolve( resolver, resolveErrors );
  • trunk/ab5.0/abdev/ab_common/src/Lexical/DataTable.cpp

    r747 r750  
    5959void DataTable::ResetDataSectionBaseOffset( long dataSectionBaseOffset )
    6060{
    61     BOOST_FOREACH( const Schedule &schedule, schedules )
     61    foreach( const Schedule &schedule, schedules )
    6262    {
    6363        if( schedule.GetType() == Schedule::DataTable )
  • trunk/ab5.0/abdev/ab_common/src/Lexical/Delegate.cpp

    r640 r750  
    2323    Procedure::Resolve( resolver, resolveErrors );
    2424
    25     BOOST_FOREACH( Parameter *pParameter, dynamicParams )
     25    foreach( Parameter *pParameter, dynamicParams )
    2626    {
    2727        pParameter->Resolve( resolver, resolveErrors );
  • trunk/ab5.0/abdev/ab_common/src/Lexical/Interface.cpp

    r640 r750  
    88{
    99    //メソッドをコピー
    10     BOOST_FOREACH( const CMethod *pBaseMethod, pInterfaceClass->GetDynamicMethods() )
     10    foreach( const CMethod *pBaseMethod, pInterfaceClass->GetDynamicMethods() )
    1111    {
    1212        CMethod *pMethod = new DynamicMethod( *pBaseMethod );
     
    5757    {
    5858        std::string actualGenericTypesName;
    59         BOOST_FOREACH( const Type &typeParameter, actualTypeParameters )
     59        foreach( const Type &typeParameter, actualTypeParameters )
    6060        {
    6161            if( actualGenericTypesName.size() )
     
    7474{
    7575    // 動的メソッド
    76     BOOST_FOREACH( CMethod *pMethod, GetDynamicMethods() )
     76    foreach( CMethod *pMethod, GetDynamicMethods() )
    7777    {
    7878        pMethod->Resolve( resolver, resolveErrors );
  • trunk/ab5.0/abdev/ab_common/src/Lexical/Meta.cpp

    r640 r750  
    9999    // グローバル変数
    100100    long initAreaBaseOffset = this->globalVars.initAreaBuffer.GetSize();
    101     BOOST_FOREACH( Variable *pVar, meta.globalVars )
     101    foreach( Variable *pVar, meta.globalVars )
    102102    {
    103103        if( pVar->IsExternal() )
     
    186186
    187187    // 関数ポインタ
    188     BOOST_FOREACH( ProcPointer *pProcPointer, meta.procPointers )
     188    foreach( ProcPointer *pProcPointer, meta.procPointers )
    189189    {
    190190        if( pProcPointer->IsExternal() )
     
    283283
    284284    // グローバル変数
    285     BOOST_FOREACH( Variable *pVar, globalVars )
     285    foreach( Variable *pVar, globalVars )
    286286    {
    287287        pVar->Resolve( resolver, resolveErrors );
     
    319319
    320320    // 関数ポインタ
    321     BOOST_FOREACH( ProcPointer *pProcPointer, procPointers )
     321    foreach( ProcPointer *pProcPointer, procPointers )
    322322    {
    323323        pProcPointer->Resolve( resolver, resolveErrors );
  • trunk/ab5.0/abdev/ab_common/src/Lexical/Method.cpp

    r640 r750  
    9292Methods::Methods( const Methods &methods )
    9393{
    94     BOOST_FOREACH( CMethod *pMethod, methods )
     94    foreach( CMethod *pMethod, methods )
    9595    {
    9696        this->push_back( new DynamicMethod( dynamic_cast<DynamicMethod &>(*pMethod) ) );
     
    101101{
    102102    Methods &methods = *this;
    103     BOOST_FOREACH( CMethod *pMethod, methods )
     103    foreach( CMethod *pMethod, methods )
    104104    {
    105105        delete pMethod;
     
    122122    //メソッドのオーバーライド
    123123    Methods &methods = *this;
    124     BOOST_FOREACH( CMethod *pMethod, methods )
     124    foreach( CMethod *pMethod, methods )
    125125    {
    126126        if( !pMethod->IsNotUse() && pMethod->GetUserProc().IsEqualForOverride( actualTypeParametersForThisMethods, pUserProc ) )
     
    145145{
    146146    const Methods &methods = *this;
    147     BOOST_FOREACH( const CMethod *pMethod, methods ){
     147    foreach( const CMethod *pMethod, methods ){
    148148        if( pMethod->GetUserProc().GetName() == name ) return true;
    149149    }
     
    181181    int count = 0;
    182182    const Methods &methods = *this;
    183     BOOST_FOREACH( const CMethod *pMethod, methods )
     183    foreach( const CMethod *pMethod, methods )
    184184    {
    185185        if( pMethod->IsVirtual() )
  • trunk/ab5.0/abdev/ab_common/src/Lexical/NamespaceSupporter.cpp

    r736 r750  
    4747
    4848    // Importsされている名前空間とのマッチングを試みる
    49     BOOST_FOREACH( const NamespaceScopes &importedNamespaceScopes, GetImportedNamespaces() )
     49    foreach( const NamespaceScopes &importedNamespaceScopes, GetImportedNamespaces() )
    5050    {
    5151        if( base.IsEqual( importedNamespaceScopes + entry ) )
  • trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp

    r645 r750  
    8484
    8585    // スケジュールを追加
    86     BOOST_FOREACH( const Schedule &schedule, nativeCode.schedules )
     86    foreach( const Schedule &schedule, nativeCode.schedules )
    8787    {
    8888        this->schedules.push_back(
     
    9696
    9797    // ソースコード行番号とネイティブコード位置の対応情報を追加
    98     BOOST_FOREACH( const SourceLine &sourceLine, nativeCode.sourceLines )
     98    foreach( const SourceLine &sourceLine, nativeCode.sourceLines )
    9999    {
    100100        this->sourceLines.push_back(
     
    191191void NativeCode::ResetDataSectionBaseOffset( long dataSectionBaseOffset )
    192192{
    193     BOOST_FOREACH( const Schedule &schedule, schedules )
     193    foreach( const Schedule &schedule, schedules )
    194194    {
    195195        if( schedule.GetType() == Schedule::DataTable )
  • trunk/ab5.0/abdev/ab_common/src/Lexical/ObjectModule.cpp

    r640 r750  
    1111#include <sstream>
    1212
     13#define WIN32_LEAN_AND_MEAN
    1314#include <windows.h>
    1415#include <stdio.h>
    1516#include <string.h>
    1617#include <math.h>
    17 #include <commctrl.h>
    1818#include <time.h>
    1919#include <limits.h>
    2020#include <shlobj.h>
    21 #include <process.h>
    22 #include <fcntl.h>
    23 #include <io.h>
    24 #include <shlwapi.h>
    2521#include <tchar.h>
    26 #include <stdarg.h>
    2722
    2823//boost libraries
     
    5247#include <boost/serialization/export.hpp>
    5348
     49#define foreach(v, c) for each (v in c)
     50
    5451#include <jenga/include/jenga.h>
    5552#include <abdev/ab_common/include/ab_common.h>
     
    9996
    10097    // リレーションテーブルを構築
    101     BOOST_FOREACH( const std::string &oldRelationalObjectModuleName, oldRelationalObjectModuleNames )
     98    foreach( const std::string &oldRelationalObjectModuleName, oldRelationalObjectModuleNames )
    10299    {
    103100        bool isMatch = false;
     
    141138        isSuccessful = true;
    142139    }
    143     catch( boost::archive::archive_exception e )
     140    catch( boost::archive::archive_exception& e )
    144141    {
    145142        MessageBox( NULL, e.what(), "XMLシリアライズの例外", MB_OK );
     
    174171        isSuccessful = true;
    175172    }
    176     catch( boost::archive::archive_exception e )
     173    catch( boost::archive::archive_exception& e )
    177174    {
    178175        MessageBox( NULL, e.what(), "XMLシリアライズの例外", MB_OK );
     
    209206        isSuccessful = true;
    210207    }
    211     catch( boost::archive::archive_exception e )
     208    catch( boost::archive::archive_exception& e )
    212209    {
    213210        MessageBox( NULL, e.what(), "XMLシリアライズの例外", MB_OK );
     
    245242        isSuccessful = true;
    246243    }
    247     catch( boost::archive::archive_exception e )
     244    catch( boost::archive::archive_exception &e )
    248245    {
    249246        MessageBox( NULL, e.what(), "XMLシリアライズの例外", MB_OK );
  • trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp

    r641 r750  
    1414bool Procedure::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors )
    1515{
    16     BOOST_FOREACH( Parameter *pParameter, params )
     16    foreach( Parameter *pParameter, params )
    1717    {
    1818        pParameter->Resolve( resolver, resolveErrors );
     
    8282UserProc::~UserProc()
    8383{
    84     BOOST_FOREACH( Parameter *pParam, realParams ){
     84    foreach( Parameter *pParam, realParams ){
    8585        delete pParam;
    8686    }
     
    219219    }
    220220
    221     BOOST_FOREACH( Parameter *pParameter, realParams )
     221    foreach( Parameter *pParameter, realParams )
    222222    {
    223223        pParameter->Resolve( resolver, resolveErrors );
    224224    }
    225225
    226     BOOST_FOREACH( Variable *pLocalVar, localVars )
     226    foreach( Variable *pLocalVar, localVars )
    227227    {
    228228        pLocalVar->Resolve( resolver, resolveErrors );
     
    270270{
    271271    ProcPointers &procPointers = *this;
    272     BOOST_FOREACH( ProcPointer *pProcPointer, procPointers ){
     272    foreach( ProcPointer *pProcPointer, procPointers ){
    273273        delete pProcPointer;
    274274    }
  • trunk/ab5.0/abdev/ab_common/src/Lexical/Type.cpp

    r640 r750  
    524524    {
    525525        std::string actualGenericTypesName;
    526         BOOST_FOREACH( const GenericType &actualGenericType, actualGenericTypes )
     526        foreach( const GenericType &actualGenericType, actualGenericTypes )
    527527        {
    528528            if( actualGenericTypesName.size() )
  • trunk/ab5.0/abdev/ab_common/src/Lexical/TypeDef.cpp

    r640 r750  
    2626{
    2727    const TypeDefCollection &typeDefs = *this;
    28     BOOST_FOREACH( const TypeDef &typeDef, typeDefs )
     28    foreach( const TypeDef &typeDef, typeDefs )
    2929    {
    3030        if( typeDef.IsEqualSymbol( symbol ) )
Note: See TracChangeset for help on using the changeset viewer.