Changeset 816 in dev


Ignore:
Timestamp:
Mar 19, 2011, 9:13:12 PM (13 years ago)
Author:
イグトランス (egtra)
Message:

ab_commonにおいて、各クラスのコピー禁止を明確化、ならびにコピー可能なものにムーブコンストラクタ・ムーブ代入演算子を追加

Location:
branches/egtra/ab5.0
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • branches/egtra/ab5.0/abdev/BasicCompiler_Common/hash.cpp

    r806 r816  
    2222    ///////////////////////////
    2323
     24    auto const s = LexicalAnalyzer::FullNameToSymbol( fullName );
     25
    2426    // ハッシュ値を取得
    2527    foreach (auto pDllProc, compiler.GetObjectModule().meta.GetDllProcs().GetHashArrayElement(simpleName))
    2628    {
    27         if( pDllProc->IsEqualSymbol( LexicalAnalyzer::FullNameToSymbol( fullName ) ) ){
     29        if( pDllProc->IsEqualSymbol( s ) )
     30        {
    2831            return pDllProc;
    2932        }
  • branches/egtra/ab5.0/abdev/ab_common/include/Environment.h

    r773 r816  
    5050        Environment::isRemoveExternal = isRemoveExternalMark;
    5151    }
     52
     53private:
     54    Environment();
     55    Environment(Environment const&);
     56    Environment& operator =(Environment const&);
     57    ~Environment();
    5258};
    5359
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Class.h

    r750 r816  
    2828    {
    2929    }
     30
     31private:
     32    ClassPrototype(ClassPrototype const&);
     33    ClassPrototype& operator =(ClassPrototype const&);
    3034};
    3135
     
    497501
    498502    virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
     503
     504private:
     505    CClass(CClass const&);
     506    CClass& operator =(CClass const&);
    499507};
    500508
     
    528536    const CClass *GetObjectClassPtr() const;
    529537    const CClass *GetInterfaceInfoClassPtr() const;
     538
     539private:
     540    Classes(Classes const&);
     541    Classes& operator =(Classes const&);
    530542};
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Const.h

    r647 r816  
    4343    {
    4444    }
     45private:
    4546    CConst()
     47        : RelationalObjectModuleItem()
     48        , type()
     49        , i64data()
    4650    {
    4751    }
     52public:
    4853    ~CConst()
    4954    {
     
    6671
    6772    virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
     73
     74private:
     75    CConst(CConst const&);
     76    CConst& operator =(CConst const&);
    6877};
    6978class Consts : public Jenga::Common::Hashmap<CConst>
     
    8190
    8291public:
     92    Consts() {}
    8393
    8494    void Add( const Symbol &symbol, _int64 i64data, const Type &type );
     
    93103    double GetDoubleData( const Symbol &symbol );
    94104    bool IsStringPtr( const Symbol &symbol, bool isUnicode );
     105
     106private:
     107    Consts(Consts const&);
     108    Consts& operator =(Consts const&);
    95109};
    96110
     
    153167
    154168    virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
     169
     170private:
     171    ConstMacro(ConstMacro const&);
     172    ConstMacro& operator =(ConstMacro const&);
    155173};
    156174class ConstMacros
     
    169187
    170188public:
     189    ConstMacros() {}
     190
    171191    bool Add( const Symbol &symbol, const char *parameterStr );
    172192    ConstMacro *Find( const Symbol &name );
     193
     194private:
     195    ConstMacros(ConstMacros const&);
     196    ConstMacros& operator =(ConstMacros const&);
    173197};
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Delegate.h

    r640 r816  
    9696
    9797    virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
     98
     99private:
     100    Delegate(Delegate const&);
     101    Delegate& operator =(Delegate const&);
    98102};
    99103typedef Jenga::Common::Hashmap<Delegate> Delegates;
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Interface.h

    r728 r816  
    1717
    1818public:
    19     DynamicMethodsPrototype(){}
    20     DynamicMethodsPrototype( const DynamicMethodsPrototype &dynamicMethodsPrototype )
    21         : dynamicMethods( dynamicMethodsPrototype.dynamicMethods )
     19    DynamicMethodsPrototype() {}
     20    DynamicMethodsPrototype(DynamicMethodsPrototype&& dynamicMethodsPrototype)
     21        : dynamicMethods(std::move(dynamicMethodsPrototype.dynamicMethods))
    2222    {
    2323    }
     24    DynamicMethodsPrototype(const DynamicMethodsPrototype &dynamicMethodsPrototype)
     25        : dynamicMethods(dynamicMethodsPrototype.dynamicMethods)
     26    {
     27    }
     28
     29    DynamicMethodsPrototype& operator =(DynamicMethodsPrototype&& y)
     30    {
     31        dynamicMethods = std::move(y.dynamicMethods);
     32        return *this;
     33    }
     34
     35    DynamicMethodsPrototype& operator =(DynamicMethodsPrototype const& y)
     36    {
     37        return *this = std::move(DynamicMethodsPrototype(y));
     38    }
     39
    2440    ~DynamicMethodsPrototype(){}
    2541
     
    6278public:
    6379    Interface( const CClass *pInterfaceClass, const Types &actualTypeParameters );
     80    Interface(Interface&& objInterface)
     81        : DynamicMethodsPrototype(std::move(objInterface))
     82        , pInterfaceClass(std::move(objInterface.pInterfaceClass))
     83        , vtblOffset(std::move(objInterface.vtblOffset))
     84    {
     85    }
    6486    Interface( const Interface &objInterface )
    6587        : DynamicMethodsPrototype( objInterface )
     
    7294        , vtblOffset( NULL )
    7395    {
     96    }
     97
     98    Interface& operator =(Interface&& y)
     99    {
     100        DynamicMethodsPrototype::operator =(std::move(y));
     101        pInterfaceClass = std::move(y.pInterfaceClass);
     102        vtblOffset = std::move(y.vtblOffset);
     103        return *this;
     104    }
     105
     106    Interface& operator =(Interface const& y)
     107    {
     108        return *this = std::move(Interface(y));
    74109    }
    75110
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Meta.h

    r640 r816  
    163163
    164164    void Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
     165
     166private:
     167    Meta(Meta const&);
     168    Meta& operator =(Meta const&);
    165169};
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Method.h

    r776 r816  
    2525    {
    2626    }
     27
    2728    CMethod()
    28     {
    29     }
    30 
     29        : MemberPrototype()
     30        , pUserProc()
     31    {
     32    }
     33
     34protected:
     35    CMethod(CMethod const& y)
     36        : MemberPrototype(y)
     37        , pUserProc(y.pUserProc)
     38    {
     39    }
     40
     41public:
    3142    const UserProc &GetUserProc() const
    3243    {
     
    5061
    5162    virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
     63
     64private:
     65    CMethod& operator =(CMethod const&);
    5266};
    5367
     
    103117    {
    104118    }
    105     DynamicMethod( const CMethod &method )
     119    explicit DynamicMethod( const CMethod &method )
    106120        : CMethod( &method.GetUserProc(), method.GetAccessibility() )
    107121        , isAbstract( method.IsAbstract() )
     
    116130    }
    117131
     132    DynamicMethod(DynamicMethod&& y)
     133        : CMethod(std::move(y))
     134        , isAbstract(std::move(y.isAbstract))
     135        , isVirtual(std::move(y.isVirtual))
     136        , isConst(std::move(y.isConst))
     137        , pInheritsClass(std::move(y.pInheritsClass))
     138        , isNotUse(std::move(y.isNotUse))
     139    {
     140    }
     141
     142    DynamicMethod(DynamicMethod const& y)
     143        : CMethod(y)
     144        , isAbstract(y.isAbstract)
     145        , isVirtual(y.isVirtual)
     146        , isConst(y.isConst)
     147        , pInheritsClass(y.pInheritsClass)
     148        , isNotUse(y.isNotUse)
     149    {
     150    }
     151
     152    DynamicMethod& operator =(DynamicMethod const&);
     153
    118154    DynamicMethod::OverrideResult::EnumType Override( const UserProc *pUserProc, Prototype::Accessibility accessibility, bool isOverrideModifier );
    119155
     
    182218    }
    183219
     220    // ムーブコンストラクタ
     221    StaticMethod(StaticMethod&& y);
     222
    184223    // コピーコンストラクタ
    185224    StaticMethod( const StaticMethod &staticMethod );
     
    255294    Methods();
    256295
     296    // ムーブコンストラクタ
     297    Methods(Methods&& methods);
     298
    257299    // コピーコンストラクタ
    258     Methods( const Methods &methods );
     300    Methods(const Methods &methods);
     301
     302    Methods& operator =(Methods&& methods)
     303    {
     304        std::vector<CMethod *>::operator =(std::move(methods));
     305        return *this;
     306    }
     307
     308    Methods& operator =(const Methods &methods)
     309    {
     310        return *this = Methods(methods);
     311    }
    259312
    260313    // デストラクタ
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/NamespaceSupporter.h

    r670 r816  
    6565    // 指定された名前空間が同一エリアと見なされるかどうかをチェック
    6666    bool IsSameAreaNamespace( const NamespaceScopes &baseNamespaceScopes, const NamespaceScopes &entryNamespaceScopes ) const;
     67
     68private:
     69    NamespaceSupporter(NamespaceSupporter const&);
     70    NamespaceSupporter& operator =(NamespaceSupporter const&);
    6771};
    6872
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h

    r641 r816  
    9797        }
    9898    }
     99    Schedule(Schedule&& y)
     100        : type(std::move(y.type))
     101        , offset(std::move(y.offset))
     102        , lpValue(std::move(y.lpValue))
     103    {
     104    }
     105    Schedule(Schedule const& y)
     106        : type(y.type)
     107        , offset(y.offset)
     108        , lpValue(y.lpValue)
     109    {
     110    }
     111    Schedule& operator =(Schedule&& y)
     112    {
     113        type = std::move(y.type);
     114        offset = std::move(y.offset);
     115        lpValue = std::move(y.lpValue);
     116        return *this;
     117    }
     118    Schedule& operator =(Schedule const& y)
     119    {
     120        return *this = std::move(Schedule(y));
     121    }
    99122    ~Schedule()
    100123    {
     
    151174    {
    152175    }
     176    SourceLine(SourceLine const& y)
     177        : nativeCodePos(y.nativeCodePos)
     178        , codeType(y.codeType)
     179        , sourceCodePosition(y.sourceCodePosition)
     180    {
     181    }
     182    SourceLine(SourceLine&& y)
     183        : nativeCodePos(std::move(y.nativeCodePos))
     184        , codeType(std::move(y.codeType))
     185        , sourceCodePosition(std::move(y.sourceCodePosition))
     186    {
     187    }
     188    SourceLine& operator =(SourceLine&& y)
     189    {
     190        nativeCodePos = std::move(y.nativeCodePos);
     191        codeType = std::move(y.codeType);
     192        sourceCodePosition = std::move(y.sourceCodePosition);
     193        return *this;
     194    }
     195    SourceLine& operator =(SourceLine const& y)
     196    {
     197        return *this = std::move(SourceLine(y));
     198    }
    153199
    154200    long GetNativeCodePos() const
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h

    r640 r816  
    4343
    4444public:
     45    ObjectModule() {}
    4546
    4647    const std::string &GetName() const
     
    7576    bool ReadString( const std::string &str );
    7677    bool WriteString( std::string &str ) const;
     78
     79private:
     80    ObjectModule(ObjectModule const&);
     81    ObjectModule& operator =(ObjectModule const&);
    7782};
    7883typedef std::vector<ObjectModule *> ObjectModules;
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Parameter.h

    r632 r816  
    2929    Parameter( const Parameter &param, const Type &type );
    3030    Parameter( const Parameter &param );
     31    Parameter(Parameter&& param)
     32        : varName(std::move(param.varName))
     33        , isRef(std::move(param.isRef))
     34        , isArray(std::move(param.isArray))
     35        , subscripts(std::move(param.subscripts))
     36        , initValue(std::move(param.initValue)) {}
    3137    Parameter();
    3238    ~Parameter();
    3339
     40    Parameter& operator =(Parameter&& y)
     41    {
     42        varName = std::move(y.varName);
     43        isRef = std::move(y.isRef);
     44        isArray = std::move(y.isArray);
     45        subscripts = std::move(y.subscripts);
     46        initValue = std::move(y.initValue);
     47        return *this;
     48    }
     49
     50    Parameter& operator =(Parameter const& y)
     51    {
     52        return *this = std::move(Parameter(y));
     53    }
     54   
    3455    void SetArray( const Subscripts &subscripts ){
    3556        isArray = true;
     
    4667        return isRef;
    4768    }
    48     bool IsArray(){
     69    bool IsArray() const
     70    {
    4971        return isArray;
    5072    }
     
    7698
    7799public:
     100    Parameters() : std::vector<Parameter *>() {}
     101    Parameters(Parameters&& y) : std::vector<Parameter *>(std::move(y)) {}
     102    Parameters(Parameters const& y) : std::vector<Parameter *>(y) {}
     103
     104    Parameters& operator =(Parameters&& y)
     105    {
     106        std::vector<Parameter *>::operator =(std::move(y));
     107        return *this;
     108    }
     109
     110    Parameters& operator =(Parameters const& y)
     111    {
     112        return *this = std::move(Parameters(y));
     113    }
    78114
    79115    bool Equals( const Parameters &params, bool isContravariant = false ) const;
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Procedure.h

    r750 r816  
    5656    {
    5757    }
     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
    5898    ~Procedure(){
    5999        foreach( Parameter *pParam, params ){
     
    393433
    394434    static const UserProc *pGlobalProc;
     435
     436private:
     437    UserProc(UserProc const&);
     438    UserProc& operator =(UserProc const&);
    395439};
    396440
     
    418462
    419463    void EnumGlobalProcs( const char *simpleName, const Symbol &localSymbol, std::vector<const UserProc *> &subs );
     464
     465private:
     466    UserProcs(UserProcs const&);
     467    UserProcs& operator =(UserProcs const&);
    420468};
    421469
     
    499547
    500548    virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
     549
     550private:
     551    DllProc(DllProc const&);
     552    DllProc& operator =(DllProc const&);
    501553};
    502554class DllProcs : public Jenga::Common::Hashmap<DllProc>
    503555{
     556public:
     557    DllProcs() {}
     558
    504559    // XMLシリアライズ用
    505560private:
     
    512567            boost::serialization::base_object<Jenga::Common::Hashmap<DllProc>>(*this));
    513568    }
     569
     570    DllProcs(DllProcs const&);
     571    DllProcs& operator =(DllProcs const&);
    514572};
    515573
     
    540598
    541599    virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
     600
     601    ProcPointer(ProcPointer const&);
     602    ProcPointer& operator =(ProcPointer const&);
    542603};
    543604
     
    569630        clear();
    570631    }
     632
     633    ProcPointers(ProcPointers const&);
     634    ProcPointers& operator =(ProcPointers const&);
    571635};
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Prototype.h

    r637 r816  
    6161        isUsing = true;
    6262    }
     63
     64private:
     65    Prototype(Prototype const&);
     66    Prototype& operator =(Prototype const&);
    6367};
    6468
     
    8084    {
    8185    }
     86
    8287    MemberPrototype()
    8388        : accessibility( Prototype::None )
     
    8590    }
    8691
     92protected:
     93    MemberPrototype(MemberPrototype const& y)
     94        : accessibility(y.accessibility)
     95    {
     96    }
     97
     98public:
    8799    Prototype::Accessibility GetAccessibility() const
    88100    {
     
    109121        return ( accessibility == Prototype::Public );
    110122    }
     123
     124private:
     125    MemberPrototype& operator =(MemberPrototype const &);
    111126};
    112127
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/RelationalObjectModuleItem.h

    r640 r816  
    2020    }
    2121
    22 public:
     22protected:
     23    RelationalObjectModuleItem(RelationalObjectModuleItem&& relationalObjectModuleItem)
     24        : Symbol(std::move(relationalObjectModuleItem))
     25        , relationalObjectModuleIndex(std::move(relationalObjectModuleItem.relationalObjectModuleIndex))
     26        , isNeedResolve(std::move(false))
     27    {
     28    }
     29
    2330    RelationalObjectModuleItem( const RelationalObjectModuleItem &relationalObjectModuleItem )
    2431        : Symbol( relationalObjectModuleItem )
     
    2734    {
    2835    }
     36
    2937    RelationalObjectModuleItem( const Symbol &symbol )
    3038        : Symbol( symbol )
     
    3341    {
    3442    }
     43
    3544    RelationalObjectModuleItem()
    3645        : relationalObjectModuleIndex( -1 )
     
    3948    }
    4049
     50    RelationalObjectModuleItem& operator =(RelationalObjectModuleItem&& y)
     51    {
     52        Symbol::operator =(std::move(y));
     53        relationalObjectModuleIndex = std::move(y.relationalObjectModuleIndex);
     54        isNeedResolve = std::move(y.isNeedResolve);
     55        return *this;
     56    }
     57
     58    RelationalObjectModuleItem& operator =(RelationalObjectModuleItem const& y)
     59    {
     60        Symbol::operator =(y);
     61        relationalObjectModuleIndex = y.relationalObjectModuleIndex;
     62        isNeedResolve = y.isNeedResolve;
     63        return *this;
     64    }
     65
     66public:
    4167    int GetRelationalObjectModuleIndex() const
    4268    {
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Resolver.h

    r640 r816  
    1515    }
    1616
     17    ResolveError(ResolveError&& y)
     18        : relationalObjectModuleIndex(std::move(y.relationalObjectModuleIndex))
     19        , targetItemName(std::move(y.targetItemName))
     20    {
     21    }
     22
     23    ResolveError(ResolveError const& y)
     24        : relationalObjectModuleIndex(y.relationalObjectModuleIndex)
     25        , targetItemName(y.targetItemName)
     26    {
     27    }
     28
     29    ResolveError& operator =(ResolveError&& y)
     30    {
     31        relationalObjectModuleIndex = std::move(y.relationalObjectModuleIndex);
     32        targetItemName = std::move(y.targetItemName);
     33        return *this;
     34    }
     35
     36    ResolveError& operator =(ResolveError const& y)
     37    {
     38        return *this = std::move(ResolveError(y));
     39    }
     40
    1741    int GetRelationalObjectModuleIndex() const
    1842    {
     
    2852{
    2953public:
     54    ResolveErrors() {}
     55    ResolveErrors(ResolveErrors&& y) : std::vector<ResolveError>(std::move(y)) {}
     56    ResolveErrors(ResolveErrors const& y) : std::vector<ResolveError>(y) {}
     57    ResolveErrors& operator =(ResolveErrors&& y)
     58    {
     59        std::vector<ResolveError>::operator =(std::move(y));
     60        return *this;
     61    }
     62    ResolveErrors& operator =(ResolveErrors const& y)
     63    {
     64        return *this = std::move(ResolveErrors(y));
     65    }
     66
    3067    void Add( const ResolveError &resolveError )
    3168    {
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Source.h

    r810 r816  
    103103        text.buffer = static_cast<char*>(calloc(1, 1));
    104104        text.length = 0;
     105    }
     106    Text& operator =(Text&& y)
     107    {
     108        SwapImpl(*this, y);
     109        return *this;
     110    }
     111    Text& operator =(Text const& y)
     112    {
     113        return *this = std::move(Text(y));
    105114    }
    106115    ~Text(){
     
    309318        ar & boost::serialization::make_nvp("vector_BasicSource", boost::serialization::base_object<std::vector<BasicSource>>(*this));
    310319    }
     320
     321public:
     322    BasicSources() {}
     323    BasicSources(BasicSources&& y) : std::vector<BasicSource>(std::move(y)) {}
     324    BasicSources(BasicSources const& y) : std::vector<BasicSource>(y) {}
     325    BasicSources operator =(BasicSources&& y)
     326    {
     327        std::vector<BasicSource>::operator =(std::move(y));
     328        return *this;
     329    }
     330    BasicSources operator =(BasicSources const& y)
     331    {
     332        return *this = std::move(BasicSources(y));
     333    }
    311334};
    312335
     
    336359    {
    337360    }
     361    SourceCodePosition(SourceCodePosition const& y)
     362        : relationalObjectModuleIndex(y.relationalObjectModuleIndex)
     363        , pos(y.pos)
     364    {
     365    }
     366
     367    SourceCodePosition& operator =(SourceCodePosition const& y)
     368    {
     369        relationalObjectModuleIndex = y.relationalObjectModuleIndex;
     370        pos = y.pos;
     371        return *this;
     372    }
    338373
    339374    int GetRelationalObjectModuleIndex() const;
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Template.h

    r640 r816  
    4848
    4949    virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
     50
     51private:
     52    ExpandedTemplateClass(ExpandedTemplateClass const&);
     53    ExpandedTemplateClass& operator =(ExpandedTemplateClass const&);
    5054};
    5155
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Type.h

    r750 r816  
    6666      index( (LONG_PTR)&objClass ){}
    6767
    68     Type( const Type &type )
    69         : basicType( type.basicType )
    70         , index( type.index )
    71         , actualGenericTypes( type.actualGenericTypes )
    72         , formalTypeName( type.formalTypeName )
    73         , formalTypeIndex( type.formalTypeIndex )
     68    Type(Type&& type)
     69        : basicType(std::move(type.basicType))
     70        , index(std::move(type.index))
     71        , actualGenericTypes(std::move(type.actualGenericTypes))
     72        , formalTypeName(std::move(type.formalTypeName))
     73        , formalTypeIndex(std::move(type.formalTypeIndex))
     74    {
     75    }
     76
     77    Type(Type const& type)
     78        : basicType(type.basicType)
     79        , index(type.index)
     80        , actualGenericTypes(type.actualGenericTypes)
     81        , formalTypeName(type.formalTypeName)
     82        , formalTypeIndex(type.formalTypeIndex)
    7483    {
    7584    }
     
    7786    ~Type();
    7887
    79     void operator= ( const Type &type )
    80     {
    81         basicType = type.basicType;
    82         index = type.index;
    83         actualGenericTypes = type.actualGenericTypes;
    84         formalTypeName = type.formalTypeName;
    85         formalTypeIndex = type.formalTypeIndex;
    86     }
    87 
    88     __inline int GetBasicType() const
     88    Type& operator =(Type&& type)
     89    {
     90        basicType = std::move(type.basicType);
     91        index = std::move(type.index);
     92        actualGenericTypes = std::move(type.actualGenericTypes);
     93        formalTypeName = std::move(type.formalTypeName);
     94        formalTypeIndex = std::move(type.formalTypeIndex);
     95        return *this;
     96    }
     97
     98    Type& operator =(Type const& type)
     99    {
     100        return *this = Type(type);
     101    }
     102
     103    inline int GetBasicType() const
    89104    {
    90105        return basicType;
     
    253268
    254269public:
     270    Types() {}
     271    Types(Types&& y) : std::vector<Type>(std::move(y)) {}
     272    Types(Types const& y) : std::vector<Type>(y) {}
     273
     274    Types& operator =(Types&& y)
     275    {
     276        std::vector<Type>::operator =(std::move(y));
     277        return *this;
     278    }
     279
     280    Types& operator =(Types const& y)
     281    {
     282        return *this = std::move(Types(y));
     283    }
     284
    255285    bool IsEquals( const Types &Types ) const;
    256286};
     
    281311
    282312public:
    283     GenericType( const std::string &name, const Type &type )
    284         : name( name )
    285         , type( type )
    286     {
    287     }
     313    GenericType( std::string name, Type type )
     314        : name(std::move(name))
     315        , type(std::move(type))
     316    {
     317    }
     318
    288319    GenericType()
    289320    {
    290321    }
     322
     323    GenericType(GenericType&& y)
     324        : name(std::move(y.name))
     325        , type(std::move(y.type))
     326    {
     327    }
     328
     329    GenericType(GenericType const& y)
     330        : name(y.name)
     331        , type(y.type)
     332    {
     333    }
     334
     335    GenericType& operator =(GenericType&& y)
     336    {
     337        name = std::move(y.name);
     338        type = std::move(y.type);
     339        return *this;
     340    }
     341
     342    GenericType& operator =(GenericType const& y)
     343    {
     344        return *this = std::move(GenericType(y));
     345    }
     346
    291347    ~GenericType()
    292348    {
     
    329385    {
    330386    }
     387
    331388    BlittableType()
    332     {
    333     }
     389        : basicType()
     390        , pClass()
     391    {
     392    }
     393
     394    BlittableType(BlittableType&& y)
     395        : basicType(std::move(y.basicType))
     396        , pClass(std::move(y.pClass))
     397    {
     398    }
     399
     400    BlittableType(BlittableType const& y)
     401        : basicType(y.basicType)
     402        , pClass(y.pClass)
     403    {
     404    }
     405
     406    BlittableType& operator =(BlittableType&& y)
     407    {
     408        basicType = std::move(y.basicType);
     409        pClass = std::move(y.pClass);
     410        return *this;
     411    }
     412
     413    BlittableType& operator =(BlittableType const& y)
     414    {
     415        return *this = std::move(BlittableType(y));
     416    }
     417
    334418    const Type &GetBasicType() const
    335419    {
     
    344428    virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
    345429};
     430
    346431class BlittableTypes : public std::vector<BlittableType>
    347432{
     
    358443
    359444public:
     445    BlittableTypes() {}
     446    BlittableTypes(BlittableTypes&& y) : std::vector<BlittableType>(std::move(y)) {}
     447    BlittableTypes(BlittableTypes const& y) : std::vector<BlittableType>(y) {}
     448    BlittableTypes& operator =(BlittableTypes&& y)
     449    {
     450        std::vector<BlittableType>::operator =(std::move(y));
     451        return *this;
     452    }
     453    BlittableTypes& operator =(BlittableTypes const& y)
     454    {
     455        return *this = std::move(BlittableTypes(y));
     456    }
     457
    360458    bool IsExist( Type type ) const
    361459    {
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h

    r640 r816  
    4242    }
    4343
     44    TypeDef(TypeDef&& y)
     45        : RelationalObjectModuleItem(std::move(y))
     46        , baseName(std::move(y.baseName))
     47        , baseType(std::move(y.baseType))
     48    {
     49    }
     50
     51    TypeDef(TypeDef const& y)
     52        : RelationalObjectModuleItem(y)
     53        , baseName(y.baseName)
     54        , baseType(y.baseType)
     55    {
     56    }
     57
     58    TypeDef& operator =(TypeDef&& y)
     59    {
     60        RelationalObjectModuleItem::operator =(std::move(y));
     61        baseName = std::move(y.baseName);
     62        baseType = std::move(y.baseType);
     63        return *this;
     64    }
     65
     66    TypeDef& operator =(TypeDef const& y)
     67    {
     68        return *this = std::move(TypeDef(y));
     69    }
     70
    4471    const std::string &GetBaseName() const
    4572    {
     
    6996public:
    7097    TypeDefCollection();
     98    TypeDefCollection(TypeDefCollection&& y) : std::vector<TypeDef>(std::move(y)) {}
     99    TypeDefCollection(TypeDefCollection const& y) : std::vector<TypeDef>(y) {}
     100    TypeDefCollection& operator =(TypeDefCollection&& y)
     101    {
     102        std::vector<TypeDef>::operator =(std::move(y));
     103        return *this;
     104    }
     105    TypeDefCollection& operator =(TypeDefCollection const& y)
     106    {
     107        return *this = std::move(TypeDefCollection(y));
     108    }
    71109    ~TypeDefCollection();
    72110
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Variable.h

    r677 r816  
    6464public:
    6565    Variable( const Symbol &symbol, const Type &type, bool isConst, bool isRef, const std::string &paramStrForConstructor, bool hasInitData );
     66    Variable(Variable&& var);
    6667    Variable( const Variable &var );
    6768    Variable();
     69    Variable& operator =(Variable&& y);
     70    Variable& operator =(Variable const& y)
     71    {
     72        return *this = std::move(Variable(y));
     73    }
    6874
    6975    void SetArray( const Subscripts &subscripts ){
  • branches/egtra/ab5.0/abdev/ab_common/include/ResourceManager/ResourceManager.h

    r622 r816  
    1111    // IDEのみで使う
    1212    HTREEITEM hTreeItem;
     13
     14    ResourceItem()
     15        : idName()
     16        , filepath()
     17        , hTreeItem() {}
     18
     19    ResourceItem(ResourceItem&& y)
     20        : idName(std::move(y.idName))
     21        , filepath(std::move(y.filepath))
     22        , hTreeItem(std::move(y.hTreeItem)) {}
     23
     24    ResourceItem(ResourceItem const& y)
     25        : idName(y.idName)
     26        , filepath(y.filepath)
     27        , hTreeItem(y.hTreeItem) {}
     28
     29    ResourceItem& operator =(ResourceItem&& y)
     30    {
     31        idName = std::move(y.idName);
     32        filepath= std::move(y.filepath);
     33        hTreeItem = std::move(y.hTreeItem);
     34        return *this;
     35    }
     36
     37    ResourceItem& operator =(ResourceItem const& y)
     38    {
     39        return *this = std::move(ResourceItem(y));
     40    }
    1341};
     42
    1443typedef std::vector<ResourceItem> ResourceItems;
    1544
     
    1847{
    1948public:
     49    ResourceManager() {}
     50
    2051    void Clear();
    2152    bool Load( const std::string &resourceFilePath );
     
    2859    ResourceItems iconResources;
    2960    std::string manifestFilePath;
     61
     62private:
     63    ResourceManager(ResourceManager const&);
     64    ResourceManager operator =(ResourceManager const&);
    3065};
    3166
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Method.cpp

    r750 r816  
    11#include "stdafx.h"
     2#include <stdexcept>
    23
    34bool CMethod::Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors )
     
    7576{
    7677    // 静的メソッドがコピーコンストラトされることは想定しない
    77     throw;
     78    throw std::domain_error("静的メソッドのコピー構築に対応していない");
    7879}
    7980
  • branches/egtra/ab5.0/abdev/ab_common/src/Lexical/Variable.cpp

    r640 r816  
    1212{
    1313}
     14
    1415Variable::Variable( const Variable &var )
    1516    : RelationalObjectModuleItem( var )
     
    2425{
    2526}
     27
     28Variable::Variable(Variable&& var)
     29    : RelationalObjectModuleItem(std::move(var))
     30    , type(std::move(var.type))
     31    , isConst(std::move(var.isConst))
     32    , isRef(std::move(var.isRef))
     33    , isArray(std::move(var.isArray))
     34    , subscripts(std::move(var.subscripts))
     35    , isParameter(std::move(var.isParameter))
     36    , paramStrForConstructor(std::move(var.paramStrForConstructor))
     37    , hasInitData(std::move(var.hasInitData))
     38{
     39}
     40
    2641Variable::Variable()
    2742{
     43}
     44
     45Variable& Variable::operator =(Variable&& var)
     46{
     47    RelationalObjectModuleItem::operator =(std::move(var));
     48    type = std::move(var.type);
     49    isConst = std::move(var.isConst);
     50    isRef = std::move(var.isRef);
     51    isArray = std::move(var.isArray);
     52    subscripts = std::move(var.subscripts);
     53    isParameter = std::move(var.isParameter);
     54    paramStrForConstructor = std::move(var.paramStrForConstructor);
     55    hasInitData = std::move(var.hasInitData);
     56    return *this;
    2857}
    2958
  • branches/egtra/ab5.0/jenga/include/common/Hashmap.h

    r808 r816  
    154154class ObjectInHashmap
    155155{
     156protected:
     157    ObjectInHashmap()
     158    {
     159    }
     160    ~ObjectInHashmap()
     161    {
     162    }
     163
    156164public:
    157 
    158     ObjectInHashmap()
    159     {
    160     }
    161     ~ObjectInHashmap()
    162     {
    163     }
    164 
    165165    virtual const std::string &GetKeyName() const = 0;
    166166    virtual bool IsDuplication( const T *value ) const
Note: See TracChangeset for help on using the changeset viewer.