Beispiel #1
0
int main()
{
    init_pp();
    init_qq();
    print_pp();
    print_qq();

    return 0;

}
Beispiel #2
0
int 
main(int, char **)
{
  KsString serverloc("//terra/tserver");
  KsString path1("/vendor");
  
  KsGetPPParams gpp;
  gpp.path = path1;
  gpp.type_mask = KS_OT_ANY;
  gpp.name_mask = "*";

  KsGetPPResult gpr;

  // connect to server in order to create a proxy object
  //
  KscVariable var(serverloc + "/vendor/server_name");
  if(!var.getProjPropsUpdate()) {
    cout << "cannot read variable" << endl;
  }
  KscServerBase *pserver = var.getServer();

  // now test requestService() with getPP
  //
  if( pserver->requestService("ks_core", 1, 0, &gpp, &gpr) ) {
    cout << "request succeeded" << endl;
    cout << "results: " << gpr.result << endl;
    PltListIterator<KsProjPropsHandle> *pit = gpr.items.newIterator();
    while(*pit) {
      KsProjPropsHandle temp(**pit);
      print_pp(temp);
      ++(*pit);
    }
    delete pit;
  } else {
    cout << "request failed" << endl;
    cout << "error code : " << pserver->getLastResult() << endl;
  }
  
  // test requestService() with extension "ks_test"
  //
  KsCreateParams cop;
  cop.name = "new_var";
  KsCreateResult cor;

  if( pserver->requestService("ks_test", KS_CREATEOBJECT_MINOR_OPCODE,
                              0, &cop, &cor) ) {
    cout << "request succeeded" << endl;
    cout << "result: " << cor.result << endl;
  } else {
    cout << "request failed" << endl;
    cout << "error code : " << pserver->getLastResult() << endl;
  }

  return 0;
}