Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

com::SafeArray< T, Traits > Class Template Reference

#include <array.h>

Inheritance diagram for com::SafeArray< T, Traits >:

com::SafeIfaceArray< I >

List of all members.

Detailed Description

template<typename T, class Traits = SafeArrayTraits <T>>
class com::SafeArray< T, Traits >

The SafeArray class represents the safe array type used in COM to pass arrays to/from interface methods.

This helper class hides all MSCOM/XPCOM specific implementation details and, together with ComSafeArrayIn, ComSafeArrayOut and ComSafeArrayRet macros, provides a platform-neutral way to handle safe arrays in the method implementation.

When an instance of this class is destroyed, it automatically frees all resources occupied by individual elements of the array as well as by the array itself. However, when the value of an element is manually changed using operator[] or by accessing array data through the raw() pointer, it is the caller's responsibility to free resources occupied by the previous element's value.

Also, objects of this class do not support copy and assignment operations and therefore cannot be returned from functions by value. In other words, this class is just a temporary storage for handling interface method calls and not intended to be used to store arrays as data members and such -- you should use normal list/vector classes for that.

The current implementation supports only one-dimensional arrays.

This class is not thread-safe.

Definition at line 574 of file array.h.

Public Member Functions

SAFEARRAY ** __asInParam ()
OutSafeArrayDipper __asOutParam ()
T * appendedRaw ()
virtual const SafeArraycloneTo (ComSafeArrayOut(T, aArg)) const
virtual SafeArraydetachTo (ComSafeArrayOut(T, aArg))
bool isNotNull () const
bool isNull () const
bool isWeak () const
T & operator[] (size_t aIdx)
const T operator[] (size_t aIdx) const
T & operator[] (size_t aIdx)
bool push_back (const T &aElement)
T * raw ()
const T * raw () const
T * raw ()
bool reset (size_t aNewSize)
bool resize (size_t aNewSize)
 SafeArray (ComSafeArrayIn(T, aArg))
 SafeArray (size_t aSize)
template<template< typename, typename, typename, typename > class C, class L, class A, class K>
 SafeArray (const C< K, T, L, A > &aMap)
template<template< typename, typename > class C, class A>
 SafeArray (const C< T, A > &aCntr)
 SafeArray (ComSafeArrayIn(T, aArg))
 SafeArray (size_t aSize)
 SafeArray ()
virtual void setNull ()
size_t size () const
size_t size () const
virtual ~SafeArray ()

Static Public Attributes

static const SafeArray Null

Protected Member Functions

bool ensureCapacity (size_t aNewSize)

Protected Attributes

Data m

Private Attributes



struct  Data

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index