void Package::update_class_list(WrapperStr pack, UmlItem * container) { const Q3PtrVector<UmlItem> & ch = container->children(); for (unsigned i = 0; i != ch.size(); i += 1) { UmlItem * it = ch[i]; switch (it->kind()) { case aClass: user_classes.replace(pack + it->name(), (UmlClass *) it); update_class_list(pack + it->name() + ".", (UmlClass *) it); break; case aClassView: update_class_list(pack, it); default: break; } } }
ISMergeSample::ISMergeSample (ssi_size_t n_lists, ISamples **lists) : _n_lists (n_lists), _has_missing_data (false) { _lists = new ISamples *[_n_lists]; for (ssi_size_t i = 0; i < _n_lists; i++) { _lists[i] = lists[i]; } _ref = _lists[0]; _n_streams = _ref->getStreamSize (); // calculate #users in new list and store user names _n_users = 0; ssi_size_t n_user_max = 0; for (ssi_size_t i = 0; i < _n_lists; i++) { n_user_max += _lists[i]->getUserSize (); } _user_names = new ssi_char_t *[n_user_max]; for (ssi_size_t i = 0; i < n_user_max; i++) { _user_names[i] = 0; } _user_map = new ssi_size_t *[_n_lists]; for (ssi_size_t i = 0; i < _n_lists; i++) { _user_map[i] = new ssi_size_t[_lists[i]->getUserSize ()]; for (ssi_size_t j = 0; j < _lists[i]->getUserSize (); j++) { const ssi_char_t *user = _lists[i]->getUserName (j); _user_map[i][j] = update_user_list (user); } } // calculate #classes in new list and store class names _n_classes = 0; ssi_size_t n_class_max = 0; for (ssi_size_t i = 0; i < _n_lists; i++) { n_class_max += _lists[i]->getClassSize (); } _class_names = new ssi_char_t *[n_class_max]; for (ssi_size_t i = 0; i < n_class_max; i++) { _class_names[i] = 0; } _class_map = new ssi_size_t *[_n_lists]; for (ssi_size_t i = 0; i < _n_lists; i++) { _class_map[i] = new ssi_size_t[_lists[i]->getClassSize ()]; for (ssi_size_t j = 0; j < _lists[i]->getClassSize (); j++) { const ssi_char_t *classname = _lists[i]->getClassName (j); _class_map[i][j] = update_class_list (classname); } } // calculate #samples in new list _n_samples = 0; _n_samples_per_class = new ssi_size_t[_n_classes]; _n_samples_per_list = new ssi_size_t[_n_lists]; for (ssi_size_t i = 0; i < _n_classes; i++) { _n_samples_per_class[i] = 0; } for (ssi_size_t i = 0; i < _n_lists; i++) { _n_samples_per_list[i] = _lists[i]->getSize (); _n_samples += _n_samples_per_list[i]; for (ssi_size_t j = 0; j < _lists[i]->getClassSize (); j++) { _n_samples_per_class[_class_map[i][j]] += _lists[i]->getSize (j); } } // check consistency of remaining properties for (ssi_size_t i = 1; i < _n_lists; i++) { if (_lists[i]->getStreamSize () != _n_streams) { ssi_err ("#streams not consistent"); } for (ssi_size_t j = 0; j < _n_streams; j++) { if (_lists[i]->getStream (j).dim != _ref->getStream (j).dim) { ssi_err ("#dimensions in stream %u not consistent", j); } } if (_lists[i]->hasMissingData ()) { _has_missing_data = true; } } _current_list = 0; }