|
|
|
|
|
|
|
|
|
|
|
|||||||
#include <comstl_coll_sequence.h>
Public Types | |
| typedef CI | collection_interface_type |
| Colleciton interface type. | |
| typedef EI | enumerator_interface_type |
| Enumerator 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 collection_sequence< CI, EI, V, VP, R, CP, Q > | class_type |
| Type of the current parameterisation. | |
| typedef class_type | sequence_type |
| Type of the current parameterisation. | |
| typedef cs_size_t | size_type |
| The size type. | |
| enum | |
| Quanta. More... | |
Public Methods | |
| collection_sequence (collection_interface_type *i, cs_bool_t bAddRef, cs_size_t quant=0) | |
| Constructor. | |
| ~collection_sequence () | |
| Releases the adapted interface pointer. | |
| iterator | begin () const |
| Begins the iteration. | |
| iterator | end () const |
| Ends the iteration. | |
| size_type | size () const |
| Returns the number of items in the collection. | |
| 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 a notional IGUIDCollection collection instance.
typedef collection_sequence | < IGUIDCollection | |
| , IEnumGUID | |
| , GUID | |
| , GUID_policy | |
| , GUID const & | |
| , forward_cloning_policy<IEnumGUID> | |
| , 5 | |
| > collection_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 &);
IGUIDCollection *penGUIDs = . . .; // Create an instance from wherever
collection_sequence_t guids(penGUIDs, false); // Eat the reference
std::for_each(guids.begin(), guids.end(), dump_GUID);
|
|
Type of the current parameterisation.
|
|
|
Cloning policy type.
|
|
|
Colleciton interface type.
|
|
|
Enumerator interface type.
|
|
|
Iterator tag type.
|
|
|
Reference type.
|
|
|
Type of the current parameterisation.
|
|
|
The size type.
|
|
|
Value policy type.
|
|
|
Value type.
|
|
|
Quanta.
|
|
||||||||||||||||
|
Constructor.
|
|
|
Releases the adapted interface pointer.
|
|
|
Begins the iteration.
|
|
|
Ends the iteration.
|
|
|
Returns the number of items in the collection.
|
|
|
| STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004 |