All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

gcallbacks.cc 1.33 KB
Newer Older
Timothy Stack's avatar
Timothy Stack committed
1 2 3 4 5 6
/*
 * EMULAB-COPYRIGHT
 * Copyright (c) 2005 University of Utah and the Flux Group.
 * All rights reserved.
 */

7 8 9 10 11
/* Garcia robot callback class methods
 *
 * Dan Flickinger
 *
 * 2004/11/16
Timothy Stack's avatar
Timothy Stack committed
12
 * 2004/11/19
13 14 15 16 17
 *
 */
 
#include "gcallbacks.h"

Timothy Stack's avatar
 
Timothy Stack committed
18
CallbackComplete::CallbackComplete(acpObject *b, grobot *g, cb_type_t cbt) {
19 20 21 22 23 24 25
  behavior = b;
  pgrobot = g;

  blast_status = 0x000;
  
  // get ID of current behavior
  blast_id = behavior->getNamedValue("unique-id")->getIntVal();
Timothy Stack's avatar
 
Timothy Stack committed
26 27

  this->cbt = cbt;
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
  
  //strcpy(lastMSG, "no messages");
  // cout << "Created Callback" << endl;
}



CallbackComplete::~CallbackComplete() {
  // cout << "Deleting callback" << endl;
  
  // send back the status message
  
  // for now, dump callback messages to stdout:
  //cout << "CB: " << blast_status << endl; 
  

}


aErr CallbackComplete::call() {
  // call completion callback
  
  blast_status = behavior->getNamedValue("completion-status")->getIntVal();
Timothy Stack's avatar
 
Timothy Stack committed
51
  pgrobot->setCBstatus(blast_id, blast_status, this->cbt);
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
}





CallbackExecute::CallbackExecute(acpObject *b, grobot *g) {
  // constructor
  
  behavior = b;
  pgrobot = g;
}



CallbackExecute::~CallbackExecute() {
  // destructor
  
  // DO WHAT?
}



aErr CallbackExecute::call() {
  // call execution callback
  blast_id = behavior->getNamedValue("unique-id")->getIntVal();
  pgrobot->setCBexec(blast_id);
  
}