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

VirtualBoxBaseWithTypedChildren< C > Class Template Reference

#include <VirtualBoxBase.h>

Inheritance diagram for VirtualBoxBaseWithTypedChildren< C >:

VirtualBoxBase VirtualBoxBaseProto util::Lockable

List of all members.


Detailed Description

template<class C>
class VirtualBoxBaseWithTypedChildren< C >

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

This class is similar to VirtualBoxBaseWithChildren, 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, so a list is used instead.

As opposed to VirtualBoxBaseWithChildren, children added by addDependentChild() are strongly referenced, so that they cannot be externally destructed until removeDependentChild() is called.

Also, this class doesn't have the VirtualBoxBaseWithChildrenNEXT::getDependentChild() method because it would be not fast for long lists.

Parameters:
C type of child objects (must inherit VirtualBoxBase AND implement some interface)
Deprecated:
Use VirtualBoxBaseWithTypedChildrenNEXT for new classes.

Definition at line 2226 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 *child)
HRESULT addLimitedCaller (State *aState=NULL)
bool isLockedOnCurrentThread ()
bool isReady ()
bool isReady ()
bool isWriteLockOnCurrentThread ()
void lock ()
virtual RWLockHandlelockHandle () const
virtual void releaseCaller ()
void removeDependentChild (C *child)
LockOps * rlock ()
void setReady (bool isReady)
void setReady (bool isReady)
virtual void uninit ()
virtual void uninit ()
void unlock ()
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
RWLockHandledependentChildrenLock () const
void removeDependentChildren ()
WriteLockHandlestateLockHandle ()
void uninitDependentChildren ()

Private Attributes

DependentChildren mDependentChildren
bool mInUninit
RWLockHandle mMapLock

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

Generated by  Doxygen 1.6.0   Back to index