Changeset 828 in dev for trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h
- Timestamp:
- Mar 19, 2012, 1:59:48 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/egtra merged eligible
-
Property svn:mergeinfo
set to
-
trunk/ab5.0/abdev
-
Property svn:ignore
set to
*.opensdf
*.sdf
*.suo
*.user
int
ipch
out
-
Property svn:ignore
set to
-
trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h
r750 r828 1 #include <boost/foreach.hpp> 1 2 #pragma once 2 3 … … 66 67 index( (LONG_PTR)&objClass ){} 67 68 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) 74 84 { 75 85 } … … 77 87 ~Type(); 78 88 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 89 105 { 90 106 return basicType; … … 253 269 254 270 public: 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 255 286 bool IsEquals( const Types &Types ) const; 256 287 }; … … 281 312 282 313 public: 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 288 320 GenericType() 289 321 { 290 322 } 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 291 348 ~GenericType() 292 349 { … … 329 386 { 330 387 } 388 331 389 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 334 419 const Type &GetBasicType() const 335 420 { … … 344 429 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ); 345 430 }; 431 346 432 class BlittableTypes : public std::vector<BlittableType> 347 433 { … … 358 444 359 445 public: 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 360 459 bool IsExist( Type type ) const 361 460 {
Note:
See TracChangeset
for help on using the changeset viewer.