
#ifndef _LayeredControlOutput_H
#define _LayeredControlOutput_H

#include "SharedData.h"
#include "LayeredControlIF.h"

#define LayeredControlOutputName "LayeredControlOutput_ShmemName"

/*
CLASS 
LayeredControlOutput

DESCRIPTION
SharedData; output from LayeredControl (read by LayeredControlServer)

AUTHOR
Tom O'Reilly
*/
class LayeredControlOutput : public SharedData {

public:

  struct Data {

    double elapsedSeconds;
    LayeredControlIF::MissionState missionState;
    LayeredControlIF::Name behaviorName;
    short behaviorIndex;

    Data() {
      elapsedSeconds = 0;
      missionState = LayeredControlIF::Normal;
      sprintf(behaviorName, "");
      behaviorIndex = -1;
    }
  };

  LayeredControlOutput(Access access = NoAccess, Boolean init = False);

  ~LayeredControlOutput();

  ////////////////////////////////////////////////////////////////////
  // Read from shared memory to this object's Data::data element
  void read();

  ////////////////////////////////////////////////////////////////////
  // Write from this object's Data::data element to shared memory
  void write();

  ////////////////////////////////////////////////////////////////////
  // Your application accesses the fields of this Data object, before 
  // calling write() or after calling read().
  Data data;

};

#endif
