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

ReadonlyIfaceVector< IColl, ICollItem, IEnum, CollItem, Enum, ComponentClass > Class Template Reference

#include <Collection.h>

Inheritance diagram for ReadonlyIfaceVector< IColl, ICollItem, IEnum, CollItem, Enum, ComponentClass >:

VirtualBoxSupportErrorInfoImpl< ReadonlyIfaceVector< IColl, ICollItem, IEnum, CollItem, Enum, ComponentClass >, IColl > VirtualBoxSupportErrorInfoImplBase

List of all members.


Detailed Description

template<class IColl, class ICollItem, class IEnum, class CollItem, class Enum, class ComponentClass>
class ReadonlyIfaceVector< IColl, ICollItem, IEnum, CollItem, Enum, ComponentClass >

Template class to create a non-thread safe implementation of the read-only collection that stores interface pointers. The collection is initialized from the std::list storing CollItem instances by copying (i.e. making a snapshot of) all list items to std::vector for optimized random access.

The template also inherits the VirtualBoxSupportErrorInfoImpl template and therefore provides the error info support.

Parameters:
IColl collection interface to implement. This interface must define Count(ULONG *), GetItemAt (ULONG, ICollItem**) and Enumerate (IEnum **).
ICollItem collection item interface. Pointers of this type are returned by GetItemAt().
IEnum enumerator interface. Pointers of this type are returned by Enumerate().
CollItem actual collection item class. Instances of this class are stored in the std::list passed as an argument to init() and in the internal std::vector. This class must be a ComPtrBase<> template instantiation or derived from such instantiation.
Enum enumerator implementation class used to construct a new enumerator. This class must be a IfaceVectorEnumerator<> template instantiation with IEnum and IEnumItem arguments exactly the same as in this template, and with EnumItem argument exactly the same as this template's CollItem argument.
ComponentClass the only role of this class is to have the following member: |public: static const wchar_t *getComponentName()|, that returns the component name (see VirtualBoxSupportErrorInfoImpl template for more info).

Definition at line 181 of file Collection.h.


Public Types

typedef std::list< CollItem > List
typedef std::vector< CollItem > Vector

Public Member Functions

STDMETHOD() Enumerate (IEnum **enumerator)
STDMETHOD() GetItemAt (ULONG index, ICollItem **item)
template<class Key>
void init (const std::map< Key, CollItem > &m)
void init (const List &l)
STDMETHOD() InterfaceSupportsErrorInfo (REFIID riid)
 STDMETHOD (COMGETTER(Count))(ULONG *count)

Static Public Member Functions

static const wchar_t * getComponentName ()

Static Protected Member Functions

static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const char *aText, va_list aArgs, bool aLogIt=true)
static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const Bstr &aText, bool aLogIt=true)
static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const char *aText,...)
static HRESULT setError (HRESULT aResultCode, const char *aText,...)
static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const wchar_t *aComponent, const char *aText,...)
static HRESULT setErrorBstr (HRESULT aResultCode, const Bstr &aText)
static HRESULT setErrorNoLog (HRESULT aResultCode, const char *aText,...)
static HRESULT setErrorV (HRESULT aResultCode, const char *aText, va_list aArgs)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const char *aText, va_list aArgs)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const Bstr &aText)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const char *aText,...)
static HRESULT setWarning (HRESULT aResultCode, const char *aText,...)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const wchar_t *aComponent, const char *aText,...)
static HRESULT setWarningBstr (HRESULT aResultCode, const Bstr &aText)
static HRESULT setWarningV (HRESULT aResultCode, const char *aText, va_list aArgs)

Protected Attributes

Vector vec

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

Generated by  Doxygen 1.6.0   Back to index