|
From: Frank V. C. <fr...@us...> - 2000-10-27 12:41:37
|
Update of /cvsroot/corelinux/clfw/src/libs/clfw In directory slayer.i.sourceforge.net:/tmp/cvs-serv2183/src/libs/clfw Modified Files: Integer.cpp ShortInteger.cpp UnsignedInteger.cpp UnsignedShortInteger.cpp Log Message: Complimented fundemental types with C++ standards Index: Integer.cpp =================================================================== RCS file: /cvsroot/corelinux/clfw/src/libs/clfw/Integer.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Integer.cpp 2000/10/23 04:05:53 1.3 --- Integer.cpp 2000/10/27 12:41:35 1.4 *************** *** 73,83 **** Integer::Integer( void ) : ! SignedNumber(), ! theValue(0) { ! ; // do nothing } // // Destructor // --- 73,104 ---- Integer::Integer( void ) : ! SignedNumber() { ! this->setValue(0); } // + // Copy constructor + // + + Integer::Integer( IntegerCref aIntegerRef ) + : + SignedNumber() + { + this->setValue( aIntegerRef.getValue() ); + } + + // + // Constructor with value + // + + Integer::Integer( IntCref aInt ) + : + SignedNumber() + { + this->setValue(aInt); + } + + // // Destructor // *************** *** 96,101 **** IntegerCref aInteger ) const { ! return ( this == & aInteger ); } --- 117,129 ---- IntegerCref aInteger ) const + { + return ( this == &aInteger ); + } + + // For value + + bool Integer::operator==( IntCref aIntRef ) const { ! return ( this->getValue() == aIntRef ); } *************** *** 111,115 **** if( this != &aIntRef ) { ! theValue = aIntRef.getValue(); } else --- 139,143 ---- if( this != &aIntRef ) { ! this->setValue( aIntRef.getValue() ); } else *************** *** 126,130 **** IntegerRef Integer::operator=( IntCref aInt ) { ! theValue = aInt; return ( *this ); } --- 154,158 ---- IntegerRef Integer::operator=( IntCref aInt ) { ! this->setValue( aInt ); return ( *this ); } Index: ShortInteger.cpp =================================================================== RCS file: /cvsroot/corelinux/clfw/src/libs/clfw/ShortInteger.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ShortInteger.cpp 2000/10/23 04:05:53 1.2 --- ShortInteger.cpp 2000/10/27 12:41:35 1.3 *************** *** 79,82 **** --- 79,104 ---- // + // Copy Constructor + // + + ShortInteger::ShortInteger( ShortIntegerCref aShortIntRef ) + : + Integer( aShortIntRef ) + { + ; // do nothing + } + + // + // Constructor with value + // + + ShortInteger::ShortInteger( ShortCref aShort ) + : + Integer() + { + this->setValue( aShort ); + } + + // // Destructor // *************** *** 84,88 **** ShortInteger::~ShortInteger( void ) { ! ; } --- 106,110 ---- ShortInteger::~ShortInteger( void ) { ! ; // do nothing } *************** *** 99,102 **** --- 121,131 ---- } + // For value + + bool ShortInteger::operator==( ShortCref aShortRef ) const + { + return ( this->getValue() == aShortRef ); + } + // // Assignment operator *************** *** 110,114 **** if( this != &aIntRef ) { ! setValue( aIntRef.getValue() ); } else --- 139,143 ---- if( this != &aIntRef ) { ! this->setValue( aIntRef.getValue() ); } else *************** *** 119,125 **** } ShortIntegerRef ShortInteger::operator=( ShortCref aShort ) { ! setValue( aShort ); return ( *this ); } --- 148,158 ---- } + // + // Value assignment + // + ShortIntegerRef ShortInteger::operator=( ShortCref aShort ) { ! this->setValue( aShort ); return ( *this ); } Index: UnsignedInteger.cpp =================================================================== RCS file: /cvsroot/corelinux/clfw/src/libs/clfw/UnsignedInteger.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** UnsignedInteger.cpp 2000/10/23 04:05:53 1.2 --- UnsignedInteger.cpp 2000/10/27 12:41:35 1.3 *************** *** 74,84 **** UnsignedInteger::UnsignedInteger( void ) : ! UnsignedNumber(), ! theValue( 0U ) { ! ; // do nothing } // // Destructor // --- 74,105 ---- UnsignedInteger::UnsignedInteger( void ) : ! UnsignedNumber() { ! this->setValue( 0U ); } // + // Copy constructor + // + + UnsignedInteger::UnsignedInteger( UnsignedIntegerCref aUIRef ) + : + UnsignedNumber() + { + this->setValue( aUIRef.getValue() ); + } + + // + // Value constructor + // + + UnsignedInteger::UnsignedInteger( UnsignedIntCref aUIRef ) + : + UnsignedNumber() + { + this->setValue( aUIRef ); + } + + // // Destructor // *************** *** 98,105 **** ) const { ! return ( this == & aUnsignedInteger ); } // // Assignment operator // --- 119,134 ---- ) const { ! return ( this == &aUnsignedInteger ); } // + // Equality operator + // + + bool UnsignedInteger::operator==( UnsignedIntCref aUIRef ) const + { + return ( this->getValue() == aUIRef ); + } + // // Assignment operator // *************** *** 112,116 **** if( this != &aUIntRef ) { ! setValue( aUIntRef.getValue() ); } else --- 141,145 ---- if( this != &aUIntRef ) { ! this->setValue( aUIntRef.getValue() ); } else *************** *** 121,127 **** } UnsignedIntegerRef UnsignedInteger::operator=( UnsignedIntCref aUnsigned ) { ! setValue( aUnsigned ); return ( *this ); } --- 150,160 ---- } + // + // Value assign + // + UnsignedIntegerRef UnsignedInteger::operator=( UnsignedIntCref aUnsigned ) { ! this->setValue( aUnsigned ); return ( *this ); } Index: UnsignedShortInteger.cpp =================================================================== RCS file: /cvsroot/corelinux/clfw/src/libs/clfw/UnsignedShortInteger.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** UnsignedShortInteger.cpp 2000/10/23 04:05:53 1.1 --- UnsignedShortInteger.cpp 2000/10/27 12:41:35 1.2 *************** *** 79,82 **** --- 79,107 ---- // + // Copy Constructor + // + + UnsignedShortInteger::UnsignedShortInteger + ( + UnsignedShortIntegerCref aUSRef + ) + : + UnsignedInteger( aUSRef ) + { + ; // do nothing + } + + // + // Value constructor + // + + UnsignedShortInteger::UnsignedShortInteger( WordCref aWRef ) + : + UnsignedInteger() + { + this->setValue( aWRef ); + } + + // // Destructor // *************** *** 100,103 **** --- 125,136 ---- // + // Equality operator + // + + bool UnsignedShortInteger::operator==( WordCref aWordRef ) const + { + return ( this->getValue() == aWordRef ); + } + // // Assignment operator // *************** *** 110,114 **** if( this != &aUSRef ) { ! setValue( aUSRef.getValue() ); } else --- 143,147 ---- if( this != &aUSRef ) { ! this->setValue( aUSRef.getValue() ); } else *************** *** 128,132 **** ) { ! setValue( aUnsignedShort ); return ( *this ); } --- 161,165 ---- ) { ! this->setValue( aUnsignedShort ); return ( *this ); } |