ICnrAllocator

The ICnrAllocator class allocates and manages multiple IContainerObject objects that can be added to an IContainerControl. ICnrAllocator allows you to create an unlimited number of objects at once and then add all of them to a container with one call. This method of allocating and inserting multiple container objects greatly reduces the time it takes to load a large number of items into a container.

As items from the ICnrAllocator are added to an IContainerControl via IContainerControl::addObjects or IContainerControl::addObjectsAfter, the ICnrAllocator keeps track of all used and unused items it is managing.

The ICnrAllocator destructor frees the memory occupied by any unused objects allocated by the constructor but not added to any IContainerControl.

AIX Considerations

The Motif container widget does not allow multiple insertion of container objects with one call. The ICnrAllocator is supported but adds each object separately.

Windows Considerations

A native Windows container (that is, a container constructed without the pmCompatible style) does not allow multiple insertion of container objects with one call. The ICnrAllocator is supported but adds each object separately in this case. The pmCompatible container does insert all the objects at once.


ICnrAllocator - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~ICnrAllocator
public:
virtual ~ICnrAllocator()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
ICnrAllocator
public:
ICnrAllocator(unsigned long num, unsigned long size)

Construct the ICnrAllocator by providing the number of objects you want to allocate and the size of the object you will be adding to an IContainerControl.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Object Information

These members give access to the objects allocated by ICnrAllocator.


[view class]
first
protected:
void* first() const

Returns the first object of the list.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
initialized
protected:
unsigned long initialized() const

Returns the number of items initialized.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
next
protected:
void* next(void* pRec)

Returns the object in the list which follows the object passed in.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
nextAvailable
protected:
void* nextAvailable()

Returns the next available object that has not been initialized.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
updateForInsert
protected:
ICnrAllocator& updateForInsert()

Updates the state of an ICnrAllocator object after IContainerControl::addObjects or IContainerControl::addObjectsAfter is called.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


ICnrAllocator - Inherited Member Functions and Data

Inherited Public Functions

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data