/************************************************************************/
/* Copyright 1998 MBARI							*/
/************************************************************************/
#ifndef _VEHICLECONFIGURATION_H
#define _VEHICLECONFIGURATION_H
static char VehicleConfiguration_h_id[] = "$Header: /u/oreilly/rov/tmacs/RCS/VehicleConfiguration.h,v 1.5 1998/12/18 21:07:21 oreilly Exp $";

/*
$Log: VehicleConfiguration.h,v $
Revision 1.5  1998/12/18 21:07:21  oreilly
Added documentation

Revision 1.4  1998/02/23 16:12:15  oreilly
*** empty log message ***

Revision 1.3  1997/05/06 16:33:16  oreilly
Added 3x5 micros

 * Revision 1.2  97/03/20  12:38:49  12:38:49  oreilly (Thomas C. O'Reilly)
 * *** empty log message ***
 * 
 * Revision 1.1  96/10/28  09:14:16  09:14:16  oreilly (Thomas C. O'Reilly)
 * Initial revision
 * 
*/


#include "VehicleComponent.h"

/*
CLASS 
VehicleConfiguration

DESCRIPTION
Contains VehicleComponent tree for current vehicle configuration.
Includes VehicleBase, which is the "root" VehicleComponent object.
Includes method to read components from file.

AUTHOR
Tom O'Reilly
*/
class VehicleConfiguration : public ErrorHandler
{
  public:

  VehicleConfiguration(const char *configFilename);
  ~VehicleConfiguration();

  VehicleBase *vehicleBase;
  
  void print();
  
  ToolsledComponent *toolsled;
  

  protected:

  char *_configFilename;

  int parseComponents(FILE *fp, char *errorMsg);

  VehicleComponent *createComponent(VehicleComponent *parent, 
				    int nArgs, char **args,
				    char *errorMsg);

  struct ParentComponent {

    ParentComponent(VehicleComponent *component)
    {
      _component = component;
    }

    VehicleComponent *component()
    {
      return _component;
    }

    VehicleComponent *_component;
  };
};


#endif

