// file: $isip/doc/examples/class/mmedia/mmedia_example_02/example.cc
//

// isip include files
//
#include <Accumulator.h>
#include <Console.h>

// this example demonstrates how to use the Accumulator object
//
int main(int argc, const char** argv) {

  // declare accumulator objects
  //
  Accumulator accum_00;
  Accumulator accum_01;  
 
  // assign start and stop indices
  //
  accum_00.assign(4, 3);

  // verify the values just assigned
  //
  if (accum_00.getStart() != 4) {
    Console::put(L"invalid start value\n");
  }
  if (accum_00.getStop() != 3) {
    Console::put(L"invalid stop value\n");
  }  

  // set the start and stop indices
  //  
  accum_01.setStart(6);
  accum_01.setStop(9);

  // verify the values just set
  //  
  if (accum_01.getStart() != 6) {
    Console::put(L"invalid start value\n");
  }

  if (accum_01.getStop() != 9) {
    Console::put(L"invalid stop value\n");
  }
  
  // exit gracefully
  //
  Integral::exit();
}
