| 430 | |
| 431 | template<class VX> |
| 432 | forceinline bool |
| 433 | NqBoolInt<VX>::resubscribe(Space& home, VX& y) { |
| 434 | if (y.one()) |
| 435 | c--; |
| 436 | int n = x.size(); |
| 437 | for (int i=n; i--; ) |
| 438 | if (x[i].one()) { |
| 439 | c--; x[i]=x[--n]; |
| 440 | } else if (x[i].zero()) { |
| 441 | x[i] = x[--n]; |
| 442 | } else { |
| 443 | // New unassigned view found |
| 444 | assert(!x[i].zero() && !x[i].one()); |
| 445 | // Move to y and subscribe |
| 446 | y=x[i]; x[i]=x[--n]; |
| 447 | x.size(n); |
| 448 | y.subscribe(home,*this,PC_INT_VAL,false); |
| 449 | return true; |
| 450 | } |
| 451 | // All views have been assigned! |
| 452 | x.size(0); |
| 453 | return false; |
| 454 | } |
| 455 | |
| 456 | template<class VX> |
| 457 | ExecStatus |