Changeset 816 in dev for branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Type.h
- Timestamp:
- Mar 19, 2011, 9:13:12 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Type.h
r750 r816 66 66 index( (LONG_PTR)&objClass ){} 67 67 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) 74 83 { 75 84 } … … 77 86 ~Type(); 78 87 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 89 104 { 90 105 return basicType; … … 253 268 254 269 public: 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 255 285 bool IsEquals( const Types &Types ) const; 256 286 }; … … 281 311 282 312 public: 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 288 319 GenericType() 289 320 { 290 321 } 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 291 347 ~GenericType() 292 348 { … … 329 385 { 330 386 } 387 331 388 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 334 418 const Type &GetBasicType() const 335 419 { … … 344 428 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 345 429 }; 430 346 431 class BlittableTypes : public std::vector<BlittableType> 347 432 { … … 358 443 359 444 public: 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 360 458 bool IsExist( Type type ) const 361 459 {
Note:
See TracChangeset
for help on using the changeset viewer.