sink.cc
Go to the documentation of this file.
1 #include "stage.hh"
2 using namespace Stg;
3 
4 unsigned int total = 0;
5 
6 // inspect the laser data and decide what to do
7 int Delivery( Model* mod, void* dummy )
8 {
9  (void)dummy;
10 
11  total++;
12 
13  printf( "Delivery: %.2f %d %.2f %.2f\n",
14  mod->GetWorld()->SimTimeNow() / 1e6,
15  //mod->GetFlagCount(),
16  total,
17  // dynamic_cast<WorldGui*>(mod->GetWorld())->EnergyString().c_str() );
18 
21 
22 
23  return 0; // run again
24 }
25 
26 
27 
28 // Stage calls this when the model starts up
29 extern "C" int Init( Model* mod )
30 {
31  // mod->AddCallback( Model::CB_UPDATE, (model_callback_t)Update, NULL );
32 
34  mod->Subscribe();
35  return 0; //ok
36 }
37 
Model class
Definition: stage.hh:1742
static joules_t global_input
Definition: stage.hh:1687
usec_t SimTimeNow(void) const
Definition: stage.hh:1119
The Stage library uses its own namespace.
Definition: canvas.hh:8
void Init(int *argc, char **argv[])
Definition: stage.cc:18
int(* model_callback_t)(Model *mod, void *user)
Definition: stage.hh:568
World * GetWorld() const
Definition: stage.hh:2302
int Delivery(Model *mod, void *dummy)
Definition: sink.cc:7
void AddCallback(callback_type_t type, model_callback_t cb, void *user)
unsigned int total
Definition: sink.cc:4
void Subscribe()
Definition: model.cc:646
static joules_t global_dissipated
Definition: stage.hh:1686


stage
Author(s): Richard Vaughan , Brian Gerkey , Reed Hedges , Andrew Howard , Toby Collett , Pooya Karimian , Jeremy Asher , Alex Couture-Beil , Geoff Biggs , Rich Mattes , Abbas Sadat
autogenerated on Mon Jun 10 2019 15:06:09