#ifndef _POWERNAMEGENERATOR_H
#define _POWERNAMEGENERATOR_H

extern "C"
{
#  include "vxWorks.h"
#  include "memLib.h"
/* ******
#  include "msgQLib.h"
#  include "semLib.h"
#  include "taskLib.h"
#  include "lstLib.h"
#  include "datamgr.h"
#  include "sio32.h"
#  include "sio32Server.h"
#  include "sio32Client.h"
#  include "microCmd.h"
#  include "microcmd.h"
#  include "applic.h"
****** */
};

#include "DynamicArray.h"

/*
CLASS 
PowerNameGenerator

DESCRIPTION
Generates "#define" statements for DataManager item names associated with
SwitchChannel objects, in a format consistent with "Power Manager".
The statements are written to a log file.

AUTHOR
Tom O'Reilly
*/
class PowerNameGenerator { 

public:

  ///////////////////////////////////////////////////////////////////
  // [input] systemName: Name of system (e.g. "TIBURON")
  // [input] appName: Name of application (e.g. "MWSLED")
  // [input] logFile: Name of log file (which contains #define statements),
  // if logFile is NULL, use stdout.
  PowerNameGenerator(const char *systemName,
		     const char *appName,
		     const char *logFile = 0);

  ~PowerNameGenerator();

  ///////////////////////////////////////////////////////////////////
  // Add name of SwitchChannel 
  // [input] name: Name of SwitchChannel
  void addChannel(const char *name);

  ///////////////////////////////////////////////////////////////////
  // Print #define statements to log file
  void printNames();

protected:

  DynamicArray _channelNames;
  char *_systemName;
  char *_appName;
  char *_outputFile;
};

#endif

