comet::safearray_t< T > Class Template Reference
[Com type wrappers.]
#include <safearray.h>
Inheritance diagram for comet::safearray_t< T >:

Public Types | |
| typedef impl::sa_traits< T > | traits |
| typedef size_t | size_type |
| type for sizes (bounds etc). | |
| typedef long | index_type |
| Type for indexing into the array. | |
| typedef ptrdiff_t | difference_type |
| Type for pointer differences. | |
| typedef traits::value_type | value_type |
| The type of the contained value . | |
| typedef traits::reference | reference |
| Safearray reference type. | |
| typedef traits::const_reference | const_reference |
| Safearray const reference type. | |
|
typedef std::reverse_iterator< iterator, T > | reverse_iterator |
|
typedef std::reverse_iterator< const_iterator, T > | const_reverse_iterator |
Public Member Functions | |
| typedef | COMET_SAIT_ITER (safearray_t, traits::iterator, impl::sa_debug_traits< traits >) iterator |
| Iterator type. | |
| typedef | COMET_SAIT_ITER (safearray_t, traits::const_iterator, impl::sa_const_debug_traits< traits >) const _iterator |
| Const iterator type. | |
| size_type | size () const |
| The number of elements in the array. | |
| bool | is_empty () const |
| Returns whether the array is empty. | |
| reference | operator[] (index_type n) |
| Returns element n relative to lower_bound(). | |
| const_reference | operator[] (index_type n) const |
| Returns const element n relative to lower_bound(). | |
| reference | at (index_type n) |
| Returns element n relative to lower_bound(). | |
| const_reference | at (index_type n) const |
| Returns const element n relative to lower_bound(). | |
| reference | front () |
| The front element. | |
| const_reference | front () const |
| The front element - const. | |
| reference | back () |
| The back element. | |
| const_reference | back () const |
| The back element - const. | |
| void | resize (size_type n) |
| Resize the array, preserving lower_bound. | |
| void | resize_bound (size_type n, size_type lb) |
| Resize the array, specifying the lower_bound. | |
| void | resize (size_type n, const T &val) |
| void | resize_bound (size_type n, size_type lb, const T &val) |
| void | assign (size_type n, const T &val) |
Assign the safearray to be v elements of val. | |
| template<typename InputIterator> void | assign (InputIterator first, InputIterator last) |
Assign the safearray from a f first and last iterators. | |
| com_ptr< IRecordInfo > | get_record_info () |
| VARTYPE | get_vt () |
| uuid_t | get_iid () |
| void | insert (iterator pos, size_type n, const T &val) |
Insert n elements of val at position pos. | |
| template<typename InputIterator> void | insert (iterator pos, InputIterator first, InputIterator last) |
Insert elements coppied from iterator first to last at position pos. | |
| void | push_back (const T &val, index_type lb) |
| Push an element to the back of the list (ensure lower-bound);. | |
| void | push_back (const T &val) |
| Push an element to the back of the list. | |
| void | pop_back () |
| Pop an element from the back of the list. | |
| void | push_front (const T &val, index_type lb) |
| Push an element to the front of the list (ensure lower-bound). | |
| void | push_front (const T &val) |
| Push an element to the front of the list. | |
| void | pop_front () |
| Pop an element from the front of the list. | |
| iterator | erase (iterator it) |
| Erase a specified item. | |
| iterator | erase (iterator first, iterator second) |
| Erase a range of items. | |
| SAFEARRAY * | detach () |
| Unlock and detach a raw SAFEARRAY. | |
| void | detach_to (variant_t &var) |
| void | detach_from (variant_t &var) |
| index_type | lower_bound () const |
| The lower bound of the array. | |
| void | lower_bound (index_type lb) |
| Change the lower_bound of the array. | |
| void | swap (safearray_t &sa) throw () |
Iterator functions | |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| reverse_iterator | rbegin () |
| reverse_iterator | rend () |
| const_reverse_iterator | rbegin () const |
| const_reverse_iterator | rend () const |
Constructors | |
| safearray_t () | |
| Construct a null array. | |
| safearray_t (const impl::auto_attach_t< SAFEARRAY * > &psa) | |
| safearray_t (const variant_t &var) | |
| Copy from a variant, making converting if necessary. | |
| safearray_t (const safearray_t &sa) | |
| Copy construction. | |
| safearray_t (size_type sz, index_type lb) | |
| Construct a new safearray vector. | |
| safearray_t (size_type sz, index_type lb, const T &val) | |
| Construct a new safearray vector. | |
| template<typename InputIterator> | safearray_t (InputIterator first, InputIterator last, index_type lb) |
| Construct a safearray from an iterator, specifying the lower bound. | |
Assignment Operators | |
| safearray_t & | operator= (const safearray_t &sa) |
| safearray_t & | operator= (const variant_t &v) |
| safearray_t & | operator= (const impl::auto_attach_t< SAFEARRAY * > &sa) |
Access converters | |
| SAFEARRAY * | in () const throw () |
| SAFEARRAY ** | in_ptr () const throw () |
| sa_auto_lock_t | inout () throw () |
| sa_auto_lock_t | out () throw () |
Static Public Member Functions | |
| SAFEARRAY * | detach (safearray_t &sa) |
| const impl::safearray_auto_const_ref_t< T > | create_const_reference (SAFEARRAY *const &sa) |
|
impl::safearray_auto_ref_t< T > | create_reference (SAFEARRAY *&sa) |
| const impl::safearray_auto_const_ref_t< T > | create_const_reference (const variant_t &var) |
| impl::safearray_auto_ref_t< T > | create_reference (variant_t &var) |
Static Protected Member Functions | |
| void | sanity_check (SAFEARRAY *psa) |
| Make sure the passed in safearray agrees with the type of the safearray_t. | |
Protected Attributes | |
| SAFEARRAY * | psa_ |
Detailed Description
template<typename T>
class comet::safearray_t< T >
STL container compatible wrapper for a safearray. Provides forwards and reverse iterators.
Constructor & Destructor Documentation
|
||||||||||
|
Attach to (and take ownership of) an existing array. SAFEARRAY *psa = SafeArrayCreateVectorEx(VT_BSTR, 0, 5, NULL);
safearray_t<bstr_t> sa(auto_attach(psa));
|
|
||||||||||||||||
|
Construct a new safearray vector.
|
|
||||||||||||||||||||
|
Construct a new safearray vector.
|
|
||||||||||||||||||||||||
|
Construct a safearray from an iterator, specifying the lower bound.
|
Member Function Documentation
|
||||||||||
|
Returns const element n relative to lower_bound().
|
|
||||||||||
|
Returns element n relative to lower_bound().
|
|
||||||||||
|
Create a reference to a safearray from a variant. function( const variant_t &var) { const safe_array<bstr_t> &stringarray = safe_array<bstr_t>::create_reference( var ); } |
|
||||||||||
|
Create a reference to a safearray from a raw SAFEARRAY pointer. Mainly used by the implementation wrappers. |
|
||||||||||
|
Create c const reference to a safearray from a variant. |
|
||||||||||
|
Detach a raw SAFEARRAY pointer from a safearray_t. |
|
||||||||||
|
Detach a safearray from the variant |
|
||||||||||
|
Detach the safearray to the variant safe_array_t<int> ints(2,0);
variant_t var;
ints.detach_to(var);
|
|
||||||||||||||||
|
Erase a range of items.
|
|
||||||||||
|
Erase a specified item.
|
|
|||||||||
|
Return interface-id of the members of the array. |
|
|||||||||
|
Return the IRecordInfo struct for the array for VT_RECORD. |
|
|||||||||
|
Get the Variant Type of the members of the array. |
|
|||||||||
|
The lower bound of the array.
|
|
||||||||||||||||
|
Resize the array, preserving lower_bound and specifying an initial value for uninitialised values. |
|
||||||||||
|
Resize the array, preserving lower_bound. If the array is null, uses 0. |
|
||||||||||||||||||||
|
Resize the array, specifying lower_bound and specifying an initial value for uninitialised values. |
The documentation for this class was generated from the following file: