#ifndef _VALUE_H_ #define _VALUE_H_ // // $Id$ //----------------------------------------------------------------------- // // (c) Copyright 2006 by GATS, Inc., // 11864 Canon Blvd, Suite 101, Newport News VA 23606 // // All Rights Reserved. No part of this software or publication may be // reproduced, stored in a retrieval system, or transmitted, in any form // or by any means, electronic, mechanical, photocopying, recording, or // otherwise without the prior written permission of GATS, Inc. // //----------------------------------------------------------------------- // // Module: Value.h // // Author: John Burton // // Date: Tue Apr 18 15:12:02 2006 // //----------------------------------------------------------------------- // // Modification History: // // $Log$ // //----------------------------------------------------------------------- // //----------------------------------------------------------------------- // Include Files: //----------------------------------------------------------------------- // #include #include // //----------------------------------------------------------------------- // Defines, Macros and Type Definitions: //----------------------------------------------------------------------- // #define NONE 0x0000 #define INT 0x0001 #define REAL 0x0002 #define STRING 0x0004 // //----------------------------------------------------------------------- // Global Variables: //----------------------------------------------------------------------- // using namespace std; // //----------------------------------------------------------------------- // Class Definition: //----------------------------------------------------------------------- // /// /// The class ValueClass is a generic container for ConfigFile. The values /// read from the configuration file are stored in either a \c vector, /// a \c vector, or a \c vector depending upon the data type /// determined by the parser. /// class ValueClass{ private: int type; vector i; vector f; vector s; public: ValueClass() {type=NONE;} ValueClass(string val) { type = STRING; s.push_back(val); } ValueClass(int val) { type = INT; i.push_back(val); } ValueClass(float val) { type = REAL; f.push_back(val); } int GetType() {return type;} vector GetIntValue() {return i;} vector GetStringValue() {return s;} vector GetRealValue() {return f;} void AddValue(string val); void AddValue(int val); void AddValue(float val); void AddValueList(vector vlist); void AddValueList(vector vlist); void AddValueList(vector vlist); void AddValueList(ValueClass *val); void PrintValues(); }; #endif