Mercurial > projects > qtd
comparison qt/core/QList.d @ 294:bb37b0ed94c9 signals
some more QList
author | eldar |
---|---|
date | Fri, 13 Nov 2009 20:42:51 +0000 |
parents | 8627891e4556 |
children | 463563fc9e17 |
comparison
equal
deleted
inserted
replaced
293:8627891e4556 | 294:bb37b0ed94c9 |
---|---|
427 void node_construct(Node *n, const T t) | 427 void node_construct(Node *n, const T t) |
428 { | 428 { |
429 static if (isValueType!T) | 429 static if (isValueType!T) |
430 { | 430 { |
431 if (isLarge!T() || isStatic!T()) // TODO should be static if | 431 if (isLarge!T() || isStatic!T()) // TODO should be static if |
432 n.v = T.__constructNativeCopy(t.__nativeId); | 432 n.v = T.__constructNativeCopy(t.__nativeId); // n.v = new T(t); |
433 else if (isComplex!T()) | 433 else if (isComplex!T()) |
434 T.__constructPlacedNativeCopy(t.__nativeId, n); | 434 T.__constructPlacedNativeCopy(t.__nativeId, n); // new (n) T(t); |
435 else | 435 else |
436 T.__constructPlacedNativeCopy(t.__nativeId, n); // TODO should be *cast(T*)(n) = cast(T)(t); as it is a primitive type. not until they are implemented with structs | 436 T.__constructPlacedNativeCopy(t.__nativeId, n); // TODO should be *cast(T*)(n) = cast(T)(t); as it is a primitive type. fix when they are implemented with structs |
437 } | 437 } |
438 else // in case of QObject or Object Qt types we place a pointer to a native object in the node | 438 else // in case of QObject or Object Qt types we place a pointer to a native object in the node |
439 n = cast(Node*) t.__nativeId; | 439 n = cast(Node*) t.__nativeId; |
440 } | 440 } |
441 else // native types | 441 else // native types |
449 *cast(T*)(n) = cast(T)(t); | 449 *cast(T*)(n) = cast(T)(t); |
450 } | 450 } |
451 | 451 |
452 void node_copy(Node *from, Node *to, Node *src) | 452 void node_copy(Node *from, Node *to, Node *src) |
453 { | 453 { |
454 writeln("QList node_copy"); | |
454 /* TODO if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) | 455 /* TODO if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) |
455 while(from != to) | 456 while(from != to) |
456 (from++)->v = new T(*reinterpret_cast<T*>((src++)->v)); | 457 (from++)->v = new T(*reinterpret_cast<T*>((src++)->v)); |
457 else if (QTypeInfo<T>::isComplex) | 458 else if (QTypeInfo<T>::isComplex) |
458 while(from != to) | 459 while(from != to) |
475 {} // removing just pointers, do nothing | 476 {} // removing just pointers, do nothing |
476 static if (isValueType!T) //binded value types | 477 static if (isValueType!T) //binded value types |
477 { | 478 { |
478 if (isLarge!T() || isStatic!T()) // TODO should be static if | 479 if (isLarge!T() || isStatic!T()) // TODO should be static if |
479 while (from != to) | 480 while (from != to) |
480 --to, delete cast(T*)(to->v); | 481 --to, T.__deleteNativeObject(to.v); |
481 else if (QTypeInfo!T.isComplex) | 482 else if (isComplex!T()) |
482 while (from != to) --to, cast(T*)(to).~T(); | 483 while (from != to) |
484 --to, T.__callNativeDestructor(to); | |
483 } | 485 } |
484 else | 486 else |
485 { /* | 487 { /* |
486 if (QTypeInfo!T.isLarge || QTypeInfo!T.isStatic) | 488 if (QTypeInfo!T.isLarge || QTypeInfo!T.isStatic) |
487 while (from != to) --to, delete cast(T*)(to->v); | 489 while (from != to) --to, delete cast(T*)(to->v); |