Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <e32std.h>
Link against: euser.lib

Class RRegion

class RRegion : public TRegion;

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.

Derivation

Members

Defined in RRegion:

Inherited from TRegion:


Construction and destruction


RRegion(TInt,TInt)

protected: IMPORT_C RRegion(TInt aBuf, TInt aGran);

Description

Parameters

TInt aBuf

TInt aGran


RRegion()

IMPORT_C RRegion();

Description

Default constructor.

Initialises its granularity to five.


RRegion(TInt)

IMPORT_C RRegion(TInt aGran);

Description

Constructs the object with the specified granularity.

Parameters

TInt aGran

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


RRegion(const RRegion &)

IMPORT_C RRegion(const RRegion &aRegion);

Description

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 RRegion::Close() must only be called on one of them.

Use of this method is not reccomended.

Parameters

const RRegion &aRegion

The region to be copied.


RRegion(const TRect &,TInt)

IMPORT_C RRegion(const TRect &aRect, TInt aGran=EDefaultGranularity);

Description

Constructs the object with the specified rectangle and granularity.

The resulting region consists of the specified single rectangle.

Parameters

const TRect &aRect

The single rectangle with which to initialise the region

TInt aGran

The initial value for the region's granularity. By default, this is five.


RRegion(TInt,TRect *,TInt)

IMPORT_C RRegion(TInt aCount, TRect *aRectangleList, TInt aGran=EDefaultGranularity);

Description

Constructor that takes ownership of an already created rectangle list.

Parameters

TInt aCount

The number of rectangles in the region.

TRect *aRectangleList

A pointer to the set of rectangles.

TInt aGran

The region's granularity.

[Top]


Member functions


Close()

IMPORT_C void Close();

Description

Closes the region.

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

The region is not deleted, so that it can be re-used. Its granularity is preserved.


Destroy()

IMPORT_C void Destroy();

Description

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.

Panic codes

USER

42 if the RRegion object is stored on the stack.


CheckSpare()const

inline TInt CheckSpare() const;

Description

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.

Return value

TInt

The number of free memory slots in the region.