|
From: Frank V. C. <fr...@us...> - 2001-02-24 16:26:59
|
Update of /cvsroot/corelinux/clfw/clfw
In directory usw-pr-cvs1:/tmp/cvs-serv4932/clfw
Modified Files:
Array.hpp
Log Message:
133863 Added behavior (partial) to Array
Index: Array.hpp
===================================================================
RCS file: /cvsroot/corelinux/clfw/clfw/Array.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Array.hpp 2001/02/24 04:32:31 1.1
--- Array.hpp 2001/02/24 16:28:07 1.2
***************
*** 34,37 ****
--- 34,41 ----
#endif
+ #if !defined(__BOUNDSEXCEPTION_HPP)
+ #include <corelinux/BoundsException.hpp>
+ #endif
+
namespace corelinux
{
***************
*** 44,48 ****
*/
! class Array : public Collection
{
DECLARE_METATYPEMEMBERS( Array );
--- 48,52 ----
*/
! class Array : public Collection, Synchronized
{
DECLARE_METATYPEMEMBERS( Array );
***************
*** 75,78 ****
--- 79,84 ----
//
+ /// Equality operator
+
bool operator==( ArrayCref ) const;
//
***************
*** 86,99 ****
/// Fetch entity at index
! FrameworkEntityPtr operator[]( int index ) const;
/// Fetch entity at index
! FrameworkEntityPtr getElementAt( Index ) const;
/// Fetch entity class index
! MetaClassPtr getElementClassAt( Index ) const;
//
// Mutators
--- 92,109 ----
/// Fetch entity at index
! FrameworkEntityPtr operator[]( Index ) const
! throw (BoundsException);
/// Fetch entity at index
! FrameworkEntityPtr getElementAt( Index ) const
! throw (BoundsException);
/// Fetch entity class index
! MetaClassPtr getElementClassAt( Index ) const
! throw (BoundsException);
+
//
// Mutators
***************
*** 102,106 ****
/// Entity put operator
! ArrayRef operator=( FrameworkEntityPtr );
/// Deep copy (replace)
--- 112,117 ----
/// Entity put operator
! ArrayRef operator=( FrameworkEntityPtr )
! throw (NullPointerException,BoundsException);
/// Deep copy (replace)
***************
*** 110,141 ****
/// Deep copy (replace)
! ArrayRef operator=( ArrayCptr );
/// Deep copy (append)
! ArrayRef operator+=( ArrayCref );
/// Deep copy (append)
! ArrayRef operator+=( ArrayCptr );
! void put( FrameworkEntityPtr );
! void putFront( FrameworkEntityPtr );
! void putBack( FrameworkEntityPtr );
! void putElementAt( Index, FrameworkEntityPtr );
//
// Member Declarations
//
DECLARE_INSTANCEDATA( UnsignedInteger, SizeRestriction );
protected:
private:
! FrameworkEntity **theEntites;
Count theCount;
Count theRemaining;
--- 121,207 ----
/// Deep copy (replace)
! ArrayRef operator=( ArrayCptr )
! throw (NullPointerException);
/// Deep copy (append)
! ArrayRef operator+=( ArrayCref )
! throw (BoundsException);
/// Deep copy (append)
+
+ ArrayRef operator+=( ArrayCptr )
+ throw (BoundsException);
+
+ /// Add to end (putBack)
+
+ virtual void put( FrameworkEntityPtr )
+ throw (NullPointerException, BoundsException);
+
+ /// Add to front of array, shifting all back one
! virtual void putFront( FrameworkEntityPtr )
! throw (NullPointerException, BoundsException);
! /// Add to end
! virtual void putBack( FrameworkEntityPtr )
! throw (NullPointerException, BoundsException);
! /// Add at point, shifting others back one
! virtual void putAt( Index, FrameworkEntityPtr )
! throw (NullPointerException, BoundsException);
+ /// Remove at index
+
+ FrameworkEntityPtr removeAt( Index )
+ throw (BoundsException);
+
+ /// Remove first entity in array
+
+ FrameworkEntityPtr removeAtFront( void );
+
+ /// Remove last entity in array
+
+ FrameworkEntityPtr removeAtEnd( void );
+
//
// Member Declarations
//
+ /// Semantic for bounding array
+
DECLARE_INSTANCEDATA( UnsignedInteger, SizeRestriction );
protected:
+ //
+ // Implementation methods
+ //
+ /// Adjusts occupancy
+
+ void increaseOccupancy( Count additions = 1 );
+ void decreaseOccupancy( Count removals = 1 );
+
+ /// Confirms ability to grow, or available room
+
+ bool checkBoundsForAdd( Count increment = 1 );
+
+ /// Grows and copies elements
+
+ void increaseArraySize( Count increment = 1 );
+
+ /// Shifts array for indexed inserts
+
+ void shiftForInsert( Index position, Count increment=1 );
+
+ /// Shifts array for indexed removals
+
+ void shiftForRemove( Index position, Count increment=1 );
+
+
private:
! FrameworkEntity **theEntities;
Count theCount;
Count theRemaining;
|