Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Quantity.h

00001 /*
00002  * Quantity.h -- class interface for numeric quantities
00003  * Copyright (C) 2002  Eric Lemings <elemings@users.sourceforge.net>
00004  *
00005  * This software is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This software is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this software; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00018  * 02111-1307, USA
00019  *
00020  * RCS: $Id: Quantity.h,v 1.3 2003/04/18 01:41:03 elemings Exp $
00021  */
00022 
00023 #ifdef __cplusplus
00024 
00025 #  ifndef OGS_CORE_DETAILS_QUANTITY_H
00026 #    define OGS_CORE_DETAILS_QUANTITY_H
00027 
00028 #    include <ogs/core/Detail.h>
00029 #    include <ogs/core/details/Namespace.h>
00030 
00031 OGS_BEGIN_CORE_DETAILS_NAMESPACE
00032 
00038 class Quantity: public Detail {
00039   public:
00041     enum Aspect {
00042       AGE,
00043       HEIGHT,
00044       WEIGHT
00045     };
00046 
00047     Quantity (Aspect aspect, float value);
00048 
00049     Aspect getAspect () const;
00050     float getValue () const;
00051     void setValue (float value);
00052 
00053   private:
00054     Aspect _aspect;
00055     float _value;
00056 };
00057 
00064 inline Quantity::Quantity (Aspect aspect, float value):
00065   _aspect (aspect), _value (value) { }
00066 
00072 inline Quantity::Aspect Quantity::getAspect () const {
00073   return (this->_aspect);
00074 }
00075 
00081 inline float Quantity::getValue () const {
00082   return (this->_value);
00083 }
00084 
00090 inline void Quantity::setValue (float value) {
00091   this->_value = value;
00092 }
00093 
00094 OGS_END_CORE_DETAILS_NAMESPACE
00095 
00096 #  endif /* !defined OGS_CORE_DETAILS_QUANTITY_H */
00097 
00098 #endif /* defined __cplusplus */
00099 

Generated on Sun Apr 20 03:36:24 2003 for Open Gaming System (OGS) by doxygen1.3