TRefPointerCollection class (refptrco.h)

[The TRefPointerCollection class is part of the WMI Provider Framework which is now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development.]

The TRefPointerCollection class is a container class that collects pointers to objects. These pointers can be enumerated.

TRefPointerCollection has these types of members:

Method Description
Add Adds an item to a collection and calls the AddRef method to increment the reference count.
BeginEnum Begins an enumeration of a collection. Call this method with the cursor to be initialized as a parameter before enumerating the collection (REFPTRCOLLECTION_POSITION).
Empty Empties out the list, releasing all held pointers.
EndEnum Ends enumeration of a collection. Call this method when the enumerating operation is finished.
GetNext Gets next item from the list and calls the AddRef method to increment the reference count. (The user must release the pointer when done and pass in the same cursor each time.)
GetSize Returns the number of items in the list.
TRefPointerCollection Constructs a new TRefPointerCollection object.

Inheritance

The TRefPointerCollection class implements CThreadBase.

Methods

The TRefPointerCollection class has these methods.

 
TRefPointerCollection::Add

The Add method adds a reference to the collection.
TRefPointerCollection::BeginEnum

The BeginEnum method starts enumerating the collection.
TRefPointerCollection::Empty

The Empty method removes all items from the collection.
TRefPointerCollection::EndEnum

The EndEnum method ends the enumeration of the collection.
TRefPointerCollection::GetNext

The GetNext method gets a pointer to the next instance in the collection.
TRefPointerCollection::GetSize

The GetSize method returns how many items are in the list.
TRefPointerCollection::TRefPointerCollection

This constructor initializes a new TRefPointerCollection object. (TRefPointerCollection.TRefPointerCollection)
TRefPointerCollection::TRefPointerCollection

This constructor initializes a new TRefPointerCollection object. (overload 1/2)

Remarks

The destructor for this class is TRefPointerCollection::~TRefPointerCollection.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header refptrco.h (include FwCommon.h)