/*
Copyright (c) 2000                      RIPE NCC


All Rights Reserved

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the author not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.

THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

/*
-------------------------------------------------------------------------------
Module Header
Filename          : TestBoxConfig.h
Author            : Rene Wilhelm
Date              : 17-OCT-2000
Revised		  : 13-AUG-2001, TestBox struct turned into class 
Revised		  : 31-OCT-2001, Create config based on program options
Description       : Implementation of TestBoxConfig class
Language Version  : C++
OSs Tested        : Solaris 2.6, Solaris 8, Debian Linux 2.2

TODO		  : implement iterator for TestBoxConfig
	            proper copy & assignment for TestBox

This class provides an interface between analysis software and the
configuration of the TTM network. All relevant parameters for a box
are stored in a TestBox object (class defined in separate source files).
The constructor of the TestBoxConfig class executes a specified command
to retrieve configuration and stores the result in a (private) list
of TestBox objects.


When requested via program options, the list of boxes in a TestBoxConfig
object will be limited to a selected source or subset of sources.


$Id: TestBoxConfig.h,v 1.2 2003/01/16 17:31:10 wilhelm Exp $
-------------------------------------------------------------------------------
*/


#ifndef TestBoxConfig_included
#define TestBoxConfig_included

#include "TestBox.h"
#include "TTMOptions.h"
#include <sys/types.h>


// TestBoxConfig class - interface to TTM network configuration info

class TestBoxConfig {
private:
	int list_size;
	int number_of_boxes;
	uint maxBoxId;
	TestBox **tblist;		// array of pointers to TestBox objects
	void SetTargets(); 		// set active targes for all Boxes
public:
	int GetNumEntries()     {return number_of_boxes;}
	uint GetMaxBoxId()      {return maxBoxId;}
	TestBox **GetTBList()   {return tblist;}

	TestBoxConfig(TTMOptions &options);
	TestBox *GetBoxById(uint id);	       // return struct for given id
//	TestBox *GetBoxByName(char *name);     // return struct for given name
};

#endif
