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

PsNumericTypeT< Type > Class Template Reference

redefining the base types as PsTypes. More...

#include <PsPolatorAndPsNumericType.h>

Inheritance diagram for PsNumericTypeT< Type >:

Inheritance graph
[legend]
Collaboration diagram for PsNumericTypeT< Type >:

Collaboration graph
[legend]
List of all members.

Public Methods

 PsNumericTypeT (void)
 default constructor, with value 0

 PsNumericTypeT (const int)
 construction from an int

 PsNumericTypeT (const long)
 construction from a long

 PsNumericTypeT (const float)
 construction from a float

 PsNumericTypeT (const double)
 construction from a double

 PsNumericTypeT (const PsNumericTypeT< Type > &)
 copy constructor

virtual ~PsNumericTypeT (void)
 destructor

virtual PsNumericTypeT & operator++ (void)
 pre-incrementation operator (++x)

virtual PsNumericTypeT operator++ (int)
 post-incrementation operator (x++)

virtual PsNumericTypeT & operator-- (void)
 pre-decrementation operator (--x)

virtual PsNumericTypeT operator-- (int)
 post-decrementation operator (x--)

virtual PsNumericTypeT & operator= (const PsNumericTypeT< Type > &)
 affectation operator

virtual PsNumericTypeT & operator= (int)
 affectation of an int

virtual PsNumericTypeT & operator= (long int)
 affectation from a long

virtual PsNumericTypeT & operator= (float)
 affectation of a float

virtual PsNumericTypeT & operator= (double)
 affectation of a double

virtual operator Type () const
 implicit cast operator

virtual double getValue (void) const
 get the value of the numeric as a double

virtual void insertInStream (ostream &=cout) const
 insert in a stream

virtual void extract (istream &=cin)
 extract from a stream

virtual void unpack (PsIncomingSynchronisationMessage &)
 unpack from a message

virtual void pack (PsOutgoingSynchronisationMessage &) const
 pack in a message

virtual PsPolatorNTcreatePolator (void)
 creator a polator (in conformance to PsType)


Private Attributes

Type _data
 real encapsulated numeric type


Detailed Description

template<class Type>
class PsNumericTypeT< Type >

redefining the base types as PsTypes.

Definition at line 165 of file PsPolatorAndPsNumericType.h.


Constructor & Destructor Documentation

template<typename Type>
PsNumericTypeT< Type >::PsNumericTypeT void   
 

default constructor, with value 0

Definition at line 390 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00391                                           {
00392 
00393 _data = 0 ;

template<typename Type>
PsNumericTypeT< Type >::PsNumericTypeT const    int
 

construction from an int

Definition at line 399 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00400                                                  {
00401   _data = Type (d) ;
00402   //_data = (Type)d ;

template<typename Type>
PsNumericTypeT< Type >::PsNumericTypeT const    long
 

construction from a long

Definition at line 408 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00409                                                   {
00410   _data = Type (d) ;
00411   //_data = (Type)d ;

template<typename Type>
PsNumericTypeT< Type >::PsNumericTypeT const    float
 

construction from a float

Definition at line 417 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00418                                                    {
00419   _data = Type (d) ;
00420   //_data = (Type)d ;

template<typename Type>
PsNumericTypeT< Type >::PsNumericTypeT const    double
 

construction from a double

Definition at line 426 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00427                                                     {
00428   _data = Type (d) ;
00429   //_data = (Type)d ;

template<typename Type>
PsNumericTypeT< Type >::PsNumericTypeT const PsNumericTypeT< Type > &   
 

copy constructor

Definition at line 435 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00436                                                                     {
00437   //_data = (Type)t.getValue () ;
00438   _data = t._data ;

template<typename Type>
PsNumericTypeT< Type >::~PsNumericTypeT void    [virtual]
 

destructor

Definition at line 445 of file PsPolatorAndPsNumericType.h.

00446                                            {
00447 


Member Function Documentation

template<typename Type>
PsPolatorNT * PsNumericTypeT< Type >::createPolator void    [virtual]
 

creator a polator (in conformance to PsType)

Implements PsType.

Definition at line 483 of file PsPolatorAndPsNumericType.h.

00485 {
00486   // C'est l'utilisateur qui doit desaloue l'interpolateur cree
00487    //DM : non c'est le destructeur de PsnTypeT qui s'en charge
00488   PsNumericPolatorT <Type> * interp ; 
00489   interp = new PsNumericPolatorT<Type>();
00490   return ((PsPolatorNT *)interp) ;

template<typename Type>
void PsNumericTypeT< Type >::extract istream &    = cin [virtual]
 

extract from a stream

Implements PsFlowable.

Definition at line 472 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00473                                                  {
00474   in >> _data ;

template<typename Type>
double PsNumericTypeT< Type >::getValue void    const [virtual]
 

get the value of the numeric as a double

Implements PsNumericType.

Definition at line 590 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

Referenced by operator-().

00591                                              {
00592   return (double)_data ;

template<typename Type>
void PsNumericTypeT< Type >::insertInStream ostream &    = cout const [virtual]
 

insert in a stream

Implements PsFlowable.

Definition at line 464 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00465                                                               {
00466    out << _data ;

template<typename Type>
PsNumericTypeT< Type >::operator Type   const [virtual]
 

implicit cast operator

Definition at line 598 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00599                                             {
00600   return _data ;

template<typename Type>
PsNumericTypeT< Type > PsNumericTypeT< Type >::operator++ int    [virtual]
 

post-incrementation operator (x++)

Definition at line 506 of file PsPolatorAndPsNumericType.h.

00507                                                            {
00508   PsNumericTypeT<Type> retour (*this) ;
00509   ++ (* this) ;
00510   return retour ;

template<typename Type>
PsNumericTypeT< Type > & PsNumericTypeT< Type >::operator++ void    [virtual]
 

pre-incrementation operator (++x)

Definition at line 497 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00498                                                               {
00499   ++ _data ;
00500   return *this ;

template<typename Type>
PsNumericTypeT< Type > PsNumericTypeT< Type >::operator-- int    [virtual]
 

post-decrementation operator (x--)

Definition at line 525 of file PsPolatorAndPsNumericType.h.

00526                                                            {
00527   PsNumericTypeT<Type> retour (*this) ;
00528   -- (* this) ;
00529   return retour ;

template<typename Type>
PsNumericTypeT< Type > & PsNumericTypeT< Type >::operator-- void    [virtual]
 

pre-decrementation operator (--x)

Definition at line 516 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00517                                                               {
00518   -- _data ;
00519   return *this ;

template<typename Type>
PsNumericTypeT< Type > & PsNumericTypeT< Type >::operator= double    [virtual]
 

affectation of a double

Definition at line 579 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00580                                                                  {
00581   _data = Type (n) ;
00582   //_data = (Type)n ;
00583   return *this ;

template<typename Type>
PsNumericTypeT< Type > & PsNumericTypeT< Type >::operator= float    [virtual]
 

affectation of a float

Definition at line 569 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00570                                                                 {
00571   _data = Type (n) ;
00572   //_data = (Type)n ;
00573   return *this ;

template<typename Type>
PsNumericTypeT< Type > & PsNumericTypeT< Type >::operator= long    int [virtual]
 

affectation from a long

Definition at line 559 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00560                                                                    {
00561   _data = Type (n) ;
00562   //_data = (Type)n ;
00563   return *this ;

template<typename Type>
PsNumericTypeT< Type > & PsNumericTypeT< Type >::operator= int    [virtual]
 

affectation of an int

Definition at line 549 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00550                                                               {
00551   _data = Type (n) ;
00552   //_data = (Type)n ;
00553   return *this ;

template<typename Type>
PsNumericTypeT< Type > & PsNumericTypeT< Type >::operator= const PsNumericTypeT< Type > &    [virtual]
 

affectation operator

Definition at line 535 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00536                                                                                        {
00537   //  cout << "**************NUMERIQUE****************" << endl ;
00538   // cout << " operateur = " << endl ;
00539   if (this != &n) {
00540     //    _data = n.getValue () ;
00541     _data = n._data ;
00542   }
00543   return *this ;

template<typename Type>
void PsNumericTypeT< Type >::pack PsOutgoingSynchronisationMessage   const [virtual]
 

pack in a message

Reimplemented from PsFlowable.

Definition at line 452 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00454 {
00455   out<<_data ;

template<typename Type>
void PsNumericTypeT< Type >::unpack PsIncomingSynchronisationMessage   [virtual]
 

unpack from a message

Reimplemented from PsFlowable.

Definition at line 458 of file PsPolatorAndPsNumericType.h.

References PsNumericTypeT< Type >::_data.

00460 {
00461   in>>_data ;


Member Data Documentation

template<class Type>
Type PsNumericTypeT< Type >::_data [private]
 

real encapsulated numeric type

Definition at line 242 of file PsPolatorAndPsNumericType.h.

Referenced by PsNumericTypeT< Type >::extract(), PsNumericTypeT< Type >::getValue(), PsNumericTypeT< Type >::insertInStream(), PsNumericTypeT< Type >::operator Type(), PsNumericTypeT< Type >::operator++(), PsNumericTypeT< Type >::operator--(), PsNumericTypeT< Type >::operator=(), PsNumericTypeT< Type >::pack(), PsNumericTypeT< Type >::PsNumericTypeT(), and PsNumericTypeT< Type >::unpack().


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

Documentation generated on Mon Nov 25 15:26:16 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001