|
|
|
|
|
|
|
|
|
|
|
|||||||
#include <comstl_enum_sequence.h>
Inheritance diagram for enumerator_sequence:

Public Types | |
| typedef I | interface_type |
| Interface type. | |
| typedef V | value_type |
| Value type. | |
| typedef policy_adaptor< VP > | value_policy_type |
| Value policy type. | |
| typedef R | reference_type |
| Reference type. | |
| typedef CP | cloning_policy_type |
| Cloning policy type. | |
| typedef cloning_policy_type::iterator_tag_type | iterator_tag_type |
| Iterator tag type. | |
| typedef enumerator_sequence< I, V, VP, R, CP, Q > | class_type |
| Type of the current parameterisation. | |
| enum | |
| Quanta. More... | |
Public Methods | |
| enumerator_sequence (interface_type *i, cs_bool_t bAddRef, cs_size_t quant=0) | |
| Constructor. | |
| ~enumerator_sequence () | |
| Releases the adapted interface pointer. | |
| iterator | begin () const |
| Begins the iteration. | |
| iterator | end () const |
| Ends the iteration. | |
| I | Interface |
| V | Value type |
| VP | Value policy type |
| R | Reference type |
| CP | Cloning policy type |
| Q | Quanta |
For example, the following parameterisation defines a sequence operating over an IEnumGUID enumerator instance.
typedef enumerator_sequence | < IEnumGUID | |
| , GUID | |
| , GUID_policy | |
| , GUID const & | |
| , forward_cloning_policy<IEnumGUID> | |
| , 5 | |
| > enum_sequence_t; |
The value type is GUID and it is returned as a reference, as the GUID const & in fact.
The COMSTL type GUID_policy controls how the GUID instances are initialised, copied and destroyed.
The COMSTL type forward_cloning_policy allows the sequence to provide Forward Iterator semantics.
And the 5 indicates that the sequence should grab 5 values at a time, to save round trips to the enumerator.
So this would be used like the following:
void dump_GUID(GUID const &);
LPENUMGUID *penGUIDs = . . .; // Create an instance from wherever
enum_sequence_t guids(penGUIDs, false); // Eat the reference
std::for_each(guids.begin(), guids.end(), dump_GUID);
|
|
Type of the current parameterisation.
Reimplemented in enum_simple_sequence. |
|
|
Cloning policy type.
Reimplemented in enum_simple_sequence. |
|
|
Interface type.
Reimplemented in enum_simple_sequence. |
|
|
Iterator tag type.
Reimplemented in enum_simple_sequence. |
|
|
Reference type.
Reimplemented in enum_simple_sequence. |
|
|
Value policy type.
Reimplemented in enum_simple_sequence. |
|
|
Value type.
Reimplemented in enum_simple_sequence. |
|
|
Quanta.
|
|
||||||||||||||||
|
Constructor.
|
|
|
Releases the adapted interface pointer.
|
|
|
Begins the iteration.
|
|
|
Ends the iteration.
|
|
|
| STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004 |