/* LICENSE:
  =========================================================================
    CMPack'04 Source Code Release for OPEN-R SDK 1.1.5-r2 for ERS7
    Copyright (C) 2004 Multirobot Lab [Project Head: Manuela Veloso]
    School of Computer Science, Carnegie Mellon University
    All rights reserved.
  ========================================================================= */

#ifndef LogWrite_h
#define LogWrite_h

#include "state_machine.h"
#include "Behavior.h"
#include "FeatureSet.h"
#include "../Main/Events.h"
#include "../Motion/MotionInterface.h"
#include "../headers/Sensors.h"
#include "../Logger/LoggerInterface.h"

class LogWrite : public IndependentBehavior {

 public:

  static const int beh_id;
  
  static char const * const beh_name;

private:

  bool wrote_log;
  MotionCommand out_command;

  // the id of the FeatureSet event processor from the event system
  uint fs_id;

  // a pointer to the FeatureSet even processor itself
  FeatureSet *fs;

public:

  static EventProcessor *create() { return new LogWrite; }

  LogWrite();
  virtual ~LogWrite();

  void reset(ulong time);

  virtual bool initConnections();
  virtual bool setupEventMgr();
  virtual bool update(ulong time,const EventList *events);
  virtual const MotionCommand *get(ulong time);
};

#endif
