Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

TFilter Class Reference

TFilter represents the amout of information a stellar object is able to percept of an other stellar object. More...

#include <filter.h>

List of all members.

Public Types

typedef tFilterValueType int2

Public Methods

 TFilter ()
 TFilter (string &FilterDescription, tFilterValueType filterValue)
 TFilter (const TFilter &otherFilter)
virtual ~TFilter ()
virtual void setFilterValue (tFilterVauleType filterValue)
virtual tFilterType getFilterValue ()
virtual void setFilterDescription (string &filterDescription)
virtual string & getFilterDescription () const
virtual TFilter & operator+ (const TFilter &filterToAdd) const
virtual TFilter & operator= (const TFilter &otherFilter)
virtual bool operator== (const TFilter &otherFilter) const

Protected Attributes

FilterValueType fFilterValue
string fFilterDescription


Detailed Description

TFilter represents the amout of information a stellar object is able to percept of an other stellar object.

Author:
Ralf Laue
Version:
Id:
filter.h,v 1.2 2001/11/27 00:16:42 prolator Exp

The class TFilter represents the amout of information a stellar object is able to percept of an other stellar object. At the moment the value for the amount is an integer value. The value can be between -1 and 100. The value 0 means no information at all, 100 means the observer gets absolutely correct informations and all value between mean the observer gets values which are not exact, but can differ by (100 - filter value)% from the real value. The value -1 represents completely random values and the observer is not aware that these values are completly random. Furthermore the contains a dtring with a description of the object which is percepted. For example it could be "population" if the filter is conected with the population of a planet.


Member Typedef Documentation

typedef tFilterValueType TFilter::int2
 

Type definition for the filter value, so it's easier to change the type if needed.


Constructor & Destructor Documentation

TFilter::TFilter  
 

This constructor creates a new Filter object. The filter will be initialized with zero perception and an empty filter description.

TFilter::TFilter string &    FilterDescription,
tFilterValueType    filterValue
 

This constructor creates a new Filter object. You can specify the value of the filter and its description as parameters.

Parameters:
FilterDescription  the description of the percepted object
FilterValue  the value of the filter

TFilter::TFilter const TFilter &    otherFilter
 

The copy constructor creates a new Filter object using the values of filter given as parameter as initialization values.

Parameters:
OtherFilter  the filter from which the values are copied

virtual TFilter::~TFilter   [virtual]
 

The destructor frees the used memeory (at the moment it's nothing).


Member Function Documentation

virtual string& TFilter::getFilterDescription   const [virtual]
 

The method getFilterDescription returns the filter description (that's the description of the object which is observed).

Returns:
the current filter description

virtual tFilterType TFilter::getFilterValue   [virtual]
 

With the method getFilterValue you can get the value of the filter. For further information about the meaning of the filter values look in the description of the class or the method setFilterValue.

Returns:
the current value of the filter

virtual TFilter& TFilter::operator+ const TFilter &    filterToAdd const [virtual]
 

This method implements the operator+ method. It returns a filter object, which has the value set to the addition/combination of the filter values of both filters. For now that is simply the greater one of both values. Neither of the filters is changed. The filter descriptions HAVE to be equal. If they are different, they cannot be connected to the same perceived object and they cannot be added. Thus, if they ae different, a fatal error is reported and the program is exits.

Parameters:
FilterToAdd  the filter to be "added" to this filter
Returns:
a filter which is a combination/addition of both filters

virtual TFilter& TFilter::operator= const TFilter &    otherFilter [virtual]
 

This method implements the operator= method. It just assigns the new value to the filter.

Parameters:
OtherFilter  the filter which is to be assigned to this filter
Returns:
this filter with the new values assigned to it

virtual bool TFilter::operator== const TFilter &    otherFilter const [virtual]
 

This method implements the operator== method. It returns true if both filter values are equal and false if not.

Parameters:
OtherFilter  the filter which is to be compared ro this filter
Returns:
@true if both filters have the same values and @false if not

virtual void TFilter::setFilterDescription string &    filterDescription [virtual]
 

The method setFilterDescription sets the filter description (that is the description of the object which is observed) to the value given as parameter.

Parameters:
FilterDescription  the new filter description

virtual void TFilter::setFilterValue tFilterVauleType    filterValue [virtual]
 

With the method setFilterValue you can set the value of the filter. Values can be integers between -1 and 100, where 100 is correct perception, -1 is complete random values and numbers between 0 and 99 stand for probability range. That means, the percepted values can differ by (100 - filter value)%.

Parameters:
FilterValue  the new value of the filter


Member Data Documentation

string TFilter::fFilterDescription [protected]
 

the internal variable to save the description of the object, which is observed and to which the filter is linked to

FilterValueType TFilter::fFilterValue [protected]
 

the internal variable for the filter value; for further information about the meaning of the filter values look in the description of the class or the method setFilterValue.


The documentation for this class was generated from the following file:
Generated on Thu Jun 20 18:13:20 2002 for Stellar Legacy by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001