gala_clients/DIS_group/src/GROUPswApp.cxx
// Show the Unrelated groups for the selected source groups.
Show the Unrelated groups for the selected source groups.
Show the Unrelated groups for the selected source groups .
vbool GROUPswApp::showUnrelatedGroups(const symbolArr sources, symbolArr& results)
{
    Initialize(GROUPswApp::showUnrelatedGroups);
    symbolArr unrelated;
    findAllGroups(unrelated);
    symbolPtr groupSym;
    ForEachS(groupSym, sources) {
        groupHdrPtr group = groupHdr::sym_to_groupHdr(groupSym);
        if (group) {
            unrelated.remove(groupSym);
            symbolArr clientSyms;
            group->get_clients(clientSyms);
            symbolPtr client;
            ForEachS(client, clientSyms) {
                unrelated.remove(client);
            }
            symbolArr serverSyms;
            group->get_servers(serverSyms);
            symbolPtr server;
            ForEachS(server, serverSyms) {
                unrelated.remove(server);
            }
            symbolArr peerSyms;
            group->get_peers(peerSyms);
            symbolPtr peer;
            ForEachS(peer, peerSyms) {
                unrelated.remove(peer);
            }
        } else {
            dis_message(0, MSG_ERROR, "Symbol '%s' isn't a groupHdr!!!\n",
                    groupSym.get_name() );
        }
    }
    symbolSet resultSet;
    resultSet.insert(results);
    symbolPtr sym;
    ForEachS(sym, unrelated) {
        if (!resultSet.includes(sym) )
            resultSet.insert(sym);
    }
    results = resultSet;
    return (vTRUE);
}
vbool GROUPswApp :: showUnrelatedGroups ( const symbolArr sources , symbolArr & results ) { Initialize ( GROUPswApp :: showUnrelatedGroups ) ; symbolArr unrelated ; findAllGroups ( unrelated ) ; symbolPtr groupSym ; ForEachS ( groupSym , sources ) { groupHdrPtr group = groupHdr :: sym_to_groupHdr ( groupSym ) ; if ( group ) { unrelated . remove ( groupSym ) ; symbolArr clientSyms ; group -> get_clients ( clientSyms ) ; symbolPtr client ; ForEachS ( client , clientSyms ) { unrelated . remove ( client ) ; } symbolArr serverSyms ; group -> get_servers ( serverSyms ) ; symbolPtr server ; ForEachS ( server , serverSyms ) { unrelated . remove ( server ) ; } symbolArr peerSyms ; group -> get_peers ( peerSyms ) ; symbolPtr peer ; ForEachS ( peer , peerSyms ) { unrelated . remove ( peer ) ; } } else { dis_message ( 0 , MSG_ERROR , " \n " , groupSym . get_name ( ) ) ; } } symbolSet resultSet ; resultSet . insert ( results ) ; symbolPtr sym ; ForEachS ( sym , unrelated ) { if ( ! resultSet . includes ( sym ) ) resultSet . insert ( sym ) ; } results = resultSet ; return ( vTRUE ) ; }
Show the Unrelated groups for the selected source groups.
Show the Unrelated groups for the selected source groups .
// Init unrelated array with all possible groups. // Loop through source groups, removing related groups. // Remove the source group. // A group cannot be related or unrelated to itself. // Remove client groups. // Remove server groups. // Remove peer groups. // insert unrelated groups into the results array. //     (Unless they are already there.)