Beispiel #1
0
int main() {
    unsigned n;
    while (std::cin >> n) {
        if (n == 0)
            break;
        find_missing(n);
    }
    return 0;
}
Beispiel #2
0
int main(int argc, char** argv) {
	settings* setting;
	
	g_set_prgname(argv[0]);
	setting = parse_cmdline(argc, argv);
	if (find_missing(&setting)) {
		fprintf(stderr, "missing required information\n");
		fprintf(stdout, "%s", usage[0]);
		settings_free(&setting);
		return 1;
	}
	run_tests(setting);
	settings_free(&setting);
	return 0;
}
Beispiel #3
0
TAO::PG_Group_Factory::Group_Map &
TAO::PG_Group_Factory::get_group_map ()
{
  if (this->use_persistence_)
    {
      // List of groups in persistent store may
      // have changed since group_map_ was last
      // updated.

      if (!this->groups_read_ || this->list_store_->list_obsolete ())
        {
          // Extract IDs from group_map_ to set for comparison with IDs in persistent store
          // This is to avoid having to repopulate the map from scratch.
          PG_Group_List_Store::Group_Ids map_ids;
          for (Group_Map_Iterator it = group_map_.begin ();
                                  it != group_map_.end (); ++it)
            {
              map_ids.insert (it->key ());
            }

          // Get the latest groups from persistent store
          const PG_Group_List_Store::Group_Ids & persistent_ids =
            list_store_->get_group_ids ();

          // Find groups added since map was last updated
          PG_Group_List_Store::Group_Ids groups_added;
          find_missing (persistent_ids, map_ids, groups_added);

          // Find groups removed since map was last updated
          PG_Group_List_Store::Group_Ids groups_removed;
          find_missing (map_ids, persistent_ids, groups_removed);

          // Bind added groups
          for (PG_Group_List_Store::Group_Id_Const_Iterator it = groups_added.begin ();
              it != groups_added.end (); ++it)
            {
              PortableGroup::ObjectGroupId group_id = *it;
              TAO::PG_Object_Group * objectGroup = 0;
              objectGroup = this->restore_persistent_group (
                group_id,
                this->orb_.in (),
                this->factory_registry_.in (),
                this->manipulator_,
                *storable_factory_);

              if (this->group_map_.bind (group_id, objectGroup) != 0)
                {
                  delete objectGroup;
                  throw PortableGroup::ObjectNotCreated ();
                }
            }

          // Unbind removed groups
          for (PG_Group_List_Store::Group_Id_Const_Iterator it = groups_removed.begin ();
               it != groups_removed.end (); ++it)
            {
              PortableGroup::ObjectGroupId group_id = *it;
              PG_Object_Group * group = 0;
              int result = (this->get_group_map ().unbind (group_id, group) == 0);
              if (result)
                {
                  delete group;
                }
              else
                throw PortableGroup::ObjectGroupNotFound ();
            }

          this->groups_read_ = true;

        }

    }

  return group_map_;
}