Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Mezzanine::Interval< NumType > Class Template Reference

This class will generate keep track of a pool of unique 32-bit ID's that can be used for distinct object instances. More...

#include <interval.h>

Public Types

typedef Interval< NumType > SelfType
 Convenience type for the implemented type.
 

Public Member Functions

 Interval ()
 Blank constructor.
 
 Interval (const SelfType &Other)
 Copy constructor. More...
 
 Interval (const NumType &Lower, const NumType &Upper)
 Descriptive constructor. More...
 
 ~Interval ()
 Class destructor.
 
NumType GetIntervalSize () const
 Gets the numeric distance between the lower and upper bounds of this interval. More...
 
NumType & GetLowerBound ()
 Gets the lower boundry of this Interval. More...
 
const NumType & GetLowerBound () const
 Gets the lower boundry of this Interval. More...
 
NumType & GetUpperBound ()
 Gets the upper boundry of this Interval. More...
 
const NumType & GetUpperBound () const
 Gets the upper boundry of this Interval. More...
 
Boole IsWithinBounds (const NumType &Num) const
 Gets whether or not a number is inside the bounds of this Interval. More...
 
Boole operator!= (const SelfType &Other) const
 Inequality comparison operator. More...
 
Boole operator< (const NumType &Num) const
 Less-than comparison with NumType. More...
 
Boole operator< (const SelfType &Other) const
 Less-than operator. More...
 
Boole operator<= (const NumType &Num) const
 Less-than or equal comparison with NumType. More...
 
Intervaloperator= (const SelfType &Other)
 Assignment operator. More...
 
Boole operator== (const SelfType &Other) const
 Equality comparison operator. More...
 
Boole operator> (const NumType &Num) const
 Greater-than comparison with NumType. More...
 
Boole operator> (const SelfType &Other) const
 Greater-than operator. More...
 
Boole operator>= (const NumType &Num) const
 Greater-than or equal comparison with NumType. More...
 
void ProtoDeSerialize (const XML::Node &SelfRoot)
 Take the data stored in an XML Node and overwrite this object with it. More...
 
void ProtoSerialize (XML::Node &ParentNode) const
 Convert this class to an XML::Node ready for serialization. More...
 
void SetBounds (const NumType &Lower, const NumType &Upper)
 Sets both values of this Interval. More...
 

Static Public Member Functions

static String GetSerializableName ()
 Get the name of the the XML tag the Interval class will leave behind as its instances are serialized. More...
 

Public Attributes

NumType LowerBound
 The lower numeric boundry of the interval.
 
NumType UpperBound
 The upper numeric boundry of the interval.
 

Detailed Description

template<class NumType>
class Mezzanine::Interval< NumType >

This class will generate keep track of a pool of unique 32-bit ID's that can be used for distinct object instances.

Definition at line 55 of file interval.h.

Constructor & Destructor Documentation

template<class NumType >
Mezzanine::Interval< NumType >::Interval ( const SelfType Other)
inline

Copy constructor.

Parameters
OtherThe other Interval to be copied.

Definition at line 79 of file interval.h.

template<class NumType >
Mezzanine::Interval< NumType >::Interval ( const NumType &  Lower,
const NumType &  Upper 
)
inline

Descriptive constructor.

Parameters
LowerThe lower numeric boundry of the interval.
UpperThe upper numeric boundry of the interval.

Definition at line 86 of file interval.h.

Member Function Documentation

template<class NumType >
NumType Mezzanine::Interval< NumType >::GetIntervalSize ( ) const
inline

Gets the numeric distance between the lower and upper bounds of this interval.

Returns
Returns a NumType representing the difference between both bounds of this interval.

Definition at line 131 of file interval.h.

template<class NumType >
NumType& Mezzanine::Interval< NumType >::GetLowerBound ( )
inline

Gets the lower boundry of this Interval.

Returns
Returns a reference to the lower boundry of this Interval.

Definition at line 114 of file interval.h.

template<class NumType >
const NumType& Mezzanine::Interval< NumType >::GetLowerBound ( ) const
inline

Gets the lower boundry of this Interval.

Returns
Returns a const reference to the lower boundry of this Interval.

Definition at line 118 of file interval.h.

template<class NumType >
static String Mezzanine::Interval< NumType >::GetSerializableName ( )
inlinestatic

Get the name of the the XML tag the Interval class will leave behind as its instances are serialized.

Returns
A string containing the name of this class.

Definition at line 242 of file interval.h.

template<class NumType >
NumType& Mezzanine::Interval< NumType >::GetUpperBound ( )
inline

Gets the upper boundry of this Interval.

Returns
Returns a reference to the upper boundry of this Interval.

Definition at line 122 of file interval.h.

template<class NumType >
const NumType& Mezzanine::Interval< NumType >::GetUpperBound ( ) const
inline

Gets the upper boundry of this Interval.

Returns
Returns a const reference to the upper boundry of this Interval.

Definition at line 126 of file interval.h.

template<class NumType >
Boole Mezzanine::Interval< NumType >::IsWithinBounds ( const NumType &  Num) const
inline

Gets whether or not a number is inside the bounds of this Interval.

Parameters
NumThe number to check against this Interval.
Returns
Returns true if the provided number is within the bounds of this interval, false otherwise.

Definition at line 109 of file interval.h.

template<class NumType >
Boole Mezzanine::Interval< NumType >::operator!= ( const SelfType Other) const
inline

Inequality comparison operator.

Parameters
OtherThe other Interval to be compared with.
Returns
Returns true if both Intervals are not equal, false otherwise.

Definition at line 155 of file interval.h.

template<class NumType >
Boole Mezzanine::Interval< NumType >::operator< ( const NumType &  Num) const
inline

Less-than comparison with NumType.

Parameters
NumThe number to be compared with.
Returns
Returns true if the highest bounds of this Interval is less than the specified number.

Definition at line 161 of file interval.h.

template<class NumType >
Boole Mezzanine::Interval< NumType >::operator< ( const SelfType Other) const
inline

Less-than operator.

Parameters
OtherThe other Interval to compare to.
Returns
Returns true if this Interval is to be sorted before the other Interval, false otherwise.

Definition at line 186 of file interval.h.

template<class NumType >
Boole Mezzanine::Interval< NumType >::operator<= ( const NumType &  Num) const
inline

Less-than or equal comparison with NumType.

Parameters
NumThe number to be compared with.
Returns
Returns true if the highest bounds of this Interval is less than or equal to the specified number.

Definition at line 172 of file interval.h.

template<class NumType >
Interval& Mezzanine::Interval< NumType >::operator= ( const SelfType Other)
inline

Assignment operator.

Parameters
OtherThe other Interval to being assigned to this.
Returns
Returns a reference to this.

Definition at line 140 of file interval.h.

template<class NumType >
Boole Mezzanine::Interval< NumType >::operator== ( const SelfType Other) const
inline

Equality comparison operator.

Parameters
OtherThe other Interval to be compared with.
Returns
Returns true if both Intervals are the same, false otherwise.

Definition at line 150 of file interval.h.

template<class NumType >
Boole Mezzanine::Interval< NumType >::operator> ( const NumType &  Num) const
inline

Greater-than comparison with NumType.

Parameters
NumThe number to be compared with.
Returns
Returns true if the lowest bounds of this Interval is greater than the specified number.

Definition at line 166 of file interval.h.

template<class NumType >
Boole Mezzanine::Interval< NumType >::operator> ( const SelfType Other) const
inline

Greater-than operator.

Parameters
OtherThe other Interval to compare to.
Returns
Returns true if this Interval is to be sorted after the other Interval, false otherwise.

Definition at line 191 of file interval.h.

template<class NumType >
Boole Mezzanine::Interval< NumType >::operator>= ( const NumType &  Num) const
inline

Greater-than or equal comparison with NumType.

Parameters
NumThe number to be compared with.
Returns
Returns true if the lowest bounds of this Interval is greater than or equal to the specified number.

Definition at line 177 of file interval.h.

template<class NumType >
void Mezzanine::Interval< NumType >::ProtoDeSerialize ( const XML::Node SelfRoot)
inline

Take the data stored in an XML Node and overwrite this object with it.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.

Definition at line 214 of file interval.h.

template<class NumType >
void Mezzanine::Interval< NumType >::ProtoSerialize ( XML::Node ParentNode) const
inline

Convert this class to an XML::Node ready for serialization.

Parameters
ParentNodeThe point in the XML hierarchy that this Interval should be appended to.

Definition at line 199 of file interval.h.

template<class NumType >
void Mezzanine::Interval< NumType >::SetBounds ( const NumType &  Lower,
const NumType &  Upper 
)
inline

Sets both values of this Interval.

Parameters
LowerThe lower numeric boundry of the interval.
UpperThe upper numeric boundry of the interval.

Definition at line 100 of file interval.h.


The documentation for this class was generated from the following file: