Ignore:
Timestamp:
Mar 19, 2012, 1:59:48 AM (12 years ago)
Author:
イグトランス (egtra)
Message:

egtraブランチの内容をマージ。

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ab5.0/abdev

    • Property svn:ignore set to
      *.opensdf
      *.sdf
      *.suo
      *.user
      int
      ipch
      out
  • trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h

    r750 r828  
     1#include <boost/foreach.hpp>
    12#pragma once
    23
     
    6667      index( (LONG_PTR)&objClass ){}
    6768
    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 )
     69    Type(Type&& type)
     70        : basicType(std::move(type.basicType))
     71        , index(std::move(type.index))
     72        , actualGenericTypes(std::move(type.actualGenericTypes))
     73        , formalTypeName(std::move(type.formalTypeName))
     74        , formalTypeIndex(std::move(type.formalTypeIndex))
     75    {
     76    }
     77
     78    Type(Type const& type)
     79        : basicType(type.basicType)
     80        , index(type.index)
     81        , actualGenericTypes(type.actualGenericTypes)
     82        , formalTypeName(type.formalTypeName)
     83        , formalTypeIndex(type.formalTypeIndex)
    7484    {
    7585    }
     
    7787    ~Type();
    7888
    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
     89    Type& operator =(Type&& type)
     90    {
     91        basicType = std::move(type.basicType);
     92        index = std::move(type.index);
     93        actualGenericTypes = std::move(type.actualGenericTypes);
     94        formalTypeName = std::move(type.formalTypeName);
     95        formalTypeIndex = std::move(type.formalTypeIndex);
     96        return *this;
     97    }
     98
     99    Type& operator =(Type const& type)
     100    {
     101        return *this = Type(type);
     102    }
     103
     104    int GetBasicType() const
    89105    {
    90106        return basicType;
     
    253269
    254270public:
     271    Types() {}
     272    Types(Types&& y) : std::vector<Type>(std::move(y)) {}
     273    Types(Types const& y) : std::vector<Type>(y) {}
     274
     275    Types& operator =(Types&& y)
     276    {
     277        std::vector<Type>::operator =(std::move(y));
     278        return *this;
     279    }
     280
     281    Types& operator =(Types const& y)
     282    {
     283        return *this = std::move(Types(y));
     284    }
     285
    255286    bool IsEquals( const Types &Types ) const;
    256287};
     
    281312
    282313public:
    283     GenericType( const std::string &name, const Type &type )
    284         : name( name )
    285         , type( type )
    286     {
    287     }
     314    GenericType( std::string name, Type type )
     315        : name(std::move(name))
     316        , type(std::move(type))
     317    {
     318    }
     319
    288320    GenericType()
    289321    {
    290322    }
     323
     324    GenericType(GenericType&& y)
     325        : name(std::move(y.name))
     326        , type(std::move(y.type))
     327    {
     328    }
     329
     330    GenericType(GenericType const& y)
     331        : name(y.name)
     332        , type(y.type)
     333    {
     334    }
     335
     336    GenericType& operator =(GenericType&& y)
     337    {
     338        name = std::move(y.name);
     339        type = std::move(y.type);
     340        return *this;
     341    }
     342
     343    GenericType& operator =(GenericType const& y)
     344    {
     345        return *this = std::move(GenericType(y));
     346    }
     347
    291348    ~GenericType()
    292349    {
     
    329386    {
    330387    }
     388
    331389    BlittableType()
    332     {
    333     }
     390        : basicType()
     391        , pClass()
     392    {
     393    }
     394
     395    BlittableType(BlittableType&& y)
     396        : basicType(std::move(y.basicType))
     397        , pClass(std::move(y.pClass))
     398    {
     399    }
     400
     401    BlittableType(BlittableType const& y)
     402        : basicType(y.basicType)
     403        , pClass(y.pClass)
     404    {
     405    }
     406
     407    BlittableType& operator =(BlittableType&& y)
     408    {
     409        basicType = std::move(y.basicType);
     410        pClass = std::move(y.pClass);
     411        return *this;
     412    }
     413
     414    BlittableType& operator =(BlittableType const& y)
     415    {
     416        return *this = std::move(BlittableType(y));
     417    }
     418
    334419    const Type &GetBasicType() const
    335420    {
     
    344429    virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
    345430};
     431
    346432class BlittableTypes : public std::vector<BlittableType>
    347433{
     
    358444
    359445public:
     446    BlittableTypes() {}
     447    BlittableTypes(BlittableTypes&& y) : std::vector<BlittableType>(std::move(y)) {}
     448    BlittableTypes(BlittableTypes const& y) : std::vector<BlittableType>(y) {}
     449    BlittableTypes& operator =(BlittableTypes&& y)
     450    {
     451        std::vector<BlittableType>::operator =(std::move(y));
     452        return *this;
     453    }
     454    BlittableTypes& operator =(BlittableTypes const& y)
     455    {
     456        return *this = std::move(BlittableTypes(y));
     457    }
     458
    360459    bool IsExist( Type type ) const
    361460    {
Note: See TracChangeset for help on using the changeset viewer.