RRegion Class Reference

#include <e32std.h>

class RRegion : public TRegion

Inherits from

Detailed Description

Expandable region.

This class provides for the construction and destruction of a TRegion, including a granularity for expanding the region. A region;s granularity represents the number of memory slots allocated when the object is created, and the number of new memory slots allocated each time an RRegion is expanded beyond the number of free slots. The default granularity is five.

Constructor & Destructor Documentation

RRegion ( TInt, TInt )


RRegion ( )


Default constructor.

Initialises its granularity to five.

RRegion ( TInt )


Constructs the object with the specified granularity.

aGranThe initial value for the region's granularity. This value must not be negative.

RRegion ( const RRegion & )

IMPORT_CRRegion(const RRegion &aRegion)

Copy constructor.

Constructs a new region from an existing one by performing a bit-wise copy. Both the new and existing regions are left containing pointers to the same data, so Close() must only be called on one of them.

Use of this method is not recommended.

aRegionThe region to be copied.

RRegion ( const TRect &, TInt )

IMPORT_CRRegion(const TRect &aRect,
TIntaGran = EDefaultGranularity

Constructs the object with the specified rectangle and granularity.

The resulting region consists of the specified single rectangle.

aRectThe single rectangle with which to initialise the region
aGranThe initial value for the region's granularity. By default, this is five.

RRegion ( TInt, TRect *, TInt )

TRect *aRectangleList,
TIntaGran = EDefaultGranularity

Constructor that takes ownership of an already created rectangle list.

aCountThe number of rectangles in the region.
aRectangleListA pointer to the set of rectangles.
aGranThe region's granularity.

Member Function Documentation

CheckSpare ( )

TInt CheckSpare()const [inline]

Gets the number of free memory slots in the region.

This is the number of slots which have been allocated, minus the number in use.

Returns: The number of free memory slots in the region.

Close ( )

IMPORT_C voidClose()

Closes the region.

Frees up any memory which has been allocated, and unsets the error flag, if set.

The region can be re-used after calling this method. Its granularity is preserved.

Destroy ( )

IMPORT_C voidDestroy()

Deletes the region.

Frees all memory.

Note this method will delete the RRegion object and therefore it should not be invoked on RRegion objects that are not allocated on the heap. RRegion::Close() should be used for RRegion objects stored on the stack.

USER 42 if the RRegion object is stored on the stack.