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

VirtualBoxBaseWithTypedChildrenNEXT< C > Class Template Reference

#include <VirtualBoxBase.h>

Inheritance diagram for VirtualBoxBaseWithTypedChildrenNEXT< C >:

VirtualBoxBaseNEXT VirtualBoxBase VirtualBoxBaseProto util::Lockable

List of all members.

Detailed Description

template<class C>
class VirtualBoxBaseWithTypedChildrenNEXT< C >

Base class to track component's children of the particular type.

This class is similar to VirtualBoxBaseWithChildrenNEXT with the exception that all children must be of the same type. For this reason, it's not necessary to use a map to store children -- a list is used instead.

Also, as opposed to VirtualBoxBaseWithChildren, children added by addDependentChild() are strongly referenced, so that they cannot be deleted (even by a third party) until removeDependentChild() is called on them. This also means that a failure to call removeDependentChild() and uninitDependentChildren() at appropriate times as described in VirtualBoxBaseWithChildrenNEXT may cause stuck references that won't be able uninitialize themselves.

See individual method descriptions for further information.

C Type of child objects (must inherit VirtualBoxBase AND implement some interface).
This is a VirtualBoxBaseWithChildren equivalent that uses the VirtualBoxBaseNEXT implementation. Will completely supersede VirtualBoxBaseWithChildren after the old VirtualBoxBase implementation has gone.

Definition at line 2385 of file VirtualBoxBase.h.

Public Types

typedef AutoCallerBase< false > AutoCaller
typedef AutoCallerBase< true > AutoLimitedCaller
typedef std::list< ComObjPtr< C > > DependentChildren
enum  State {
  NotReady, Ready, InInit, InUninit,
  InitFailed, Limited, MayUninit, WillUninit

Public Member Functions

virtual HRESULT addCaller (State *aState=NULL, bool aLimited=false)
void addDependentChild (C *aChild)
HRESULT addLimitedCaller (State *aState=NULL)
virtual RWLockHandlechildrenLock ()
bool isLockedOnCurrentThread ()
bool isWriteLockOnCurrentThread ()
virtual RWLockHandlelockHandle () const
virtual void releaseCaller ()
void removeDependentChild (C *aChild)
LockOps * rlock ()
virtual void uninit ()
virtual void uninit ()
LockOps * wlock ()

Static Public Member Functions

static const char * translate (const char *context, const char *sourceText, const char *comment=0)
static const char * translate (const char *context, const char *sourceText, const char *comment=0)

Protected Member Functions

const DependentChildren & dependentChildren () const
void removeDependentChildren ()
WriteLockHandlestateLockHandle ()
void uninitDependentChildren ()

Private Attributes

DependentChildren mDependentChildren

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

Generated by  Doxygen 1.6.0   Back to index