Ejemplo n.º 1
0
void c4_Property::operator = (const c4_Property &prop_) {
  c4_ThreadLock::Hold lock;

  prop_.Refs( + 1);
  Refs( - 1);

  _id = prop_.GetId();
  _type = prop_.Type();
}
Ejemplo n.º 2
0
c4_Property::c4_Property(const c4_Property &prop_): _id(prop_.GetId()), _type
  (prop_.Type()) {
  c4_ThreadLock::Hold lock;

  d4_assert(sPropCounts != 0);
  d4_assert(sPropCounts->GetAt(_id) > 0);

  Refs( + 1);
}
Ejemplo n.º 3
0
c4_RenameViewer::c4_RenameViewer(c4_Sequence &seq_, const c4_Property &old_,
  const c4_Property &new_): _parent(&seq_) {
  for (int i = 0; i < _parent.NumProperties(); ++i) {
    const c4_Property &prop = _parent.NthProperty(i);
    _template.AddProperty(prop.GetId() == old_.GetId() ? new_ : prop);
  }
}
Ejemplo n.º 4
0
bool c4_GroupByViewer::GetItem(int row_, int col_, c4_Bytes& buf_)
{
  if (col_ < _keys.NumProperties())
    return _sorted.GetItem(_map.GetAt(row_), col_, buf_);

  d4_assert(col_ == _keys.NumProperties());
  
  t4_i32 count;
  switch (_result.Type())
  {
    case 'I': count = _map.GetAt(row_ + 1) - _map.GetAt(row_);
          buf_ = c4_Bytes (&count, sizeof count, true);
          break;
    case 'V': _temp = _sorted.Slice(_map.GetAt(row_), _map.GetAt(row_ + 1))
                .ProjectWithout(_keys);
          buf_ = c4_Bytes (&_temp, sizeof _temp, true);
          break;
    default:  d4_assert(0);
  }

  return true;
}