VirtualBox

Ignore:
Timestamp:
Sep 4, 2012 1:53:59 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
80544
Message:

Main/Guest Control 2.0: Cleanup, separated guest error handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h

    r43061 r43162  
    7171
    7272/**
    73  * Generic class for a all guest control callbacks/events.
     73 * Base class for a all guest control callbacks/events.
    7474 */
    7575class GuestCtrlEvent
     
    121121{
    122122public:
     123
    123124    GuestCtrlCallback(void);
    124125
     
    165166typedef std::map < uint32_t, GuestCtrlCallback* > GuestCtrlCallbacks;
    166167
    167 struct GuestProcessWaitResult
    168 {
    169     GuestProcessWaitResult(void)
    170         : mResult(ProcessWaitResult_None),
    171           mRC(VINF_SUCCESS) { }
    172 
    173     /** The wait result when returning from the wait call. */
     168
     169/*
     170 * Class representing a guest control process waiting
     171 * event.
     172 */
     173class GuestProcessWaitEvent : public GuestCtrlEvent
     174{
     175public:
     176
     177    GuestProcessWaitEvent(void);
     178
     179    GuestProcessWaitEvent(uint32_t uWaitFlags);
     180
     181    virtual ~GuestProcessWaitEvent(void);
     182
     183public:
     184
     185    void Destroy(void);
     186
     187    int Init(uint32_t uWaitFlags);
     188
     189    uint32_t GetWaitFlags(void) { return ASMAtomicReadU32(&mFlags); }
     190
     191    ProcessWaitResult_T GetWaitResult(void) { return mResult; }
     192
     193    int GetWaitRc(void) { return mRC; }
     194
     195    int Signal(ProcessWaitResult_T enmResult, int rc = VINF_SUCCESS);
     196
     197protected:
     198
     199    /** The waiting flag(s). The specifies what to
     200     *  wait for. See ProcessWaitFlag_T. */
     201    uint32_t                    mFlags;
     202    /** Structure containing the overall result. */
    174203    ProcessWaitResult_T         mResult;
    175     /** Optional rc to this result. */
    176     int                         mRC;
    177 };
    178 
    179 
    180 /*
    181  * Class representing a guest control process event.
    182  */
    183 class GuestProcessEvent : public GuestCtrlEvent
    184 {
    185 public:
    186     GuestProcessEvent(void);
    187 
    188     GuestProcessEvent(uint32_t uWaitFlags);
    189 
    190     virtual ~GuestProcessEvent(void);
    191 
    192 public:
    193 
    194     void Destroy(void);
    195 
    196     int Init(uint32_t uWaitFlags);
    197 
    198     uint32_t GetWaitFlags(void) { return ASMAtomicReadU32(&mWaitFlags); }
    199 
    200     GuestProcessWaitResult GetResult(void) { return mWaitResult; }
    201 
    202     int Signal(ProcessWaitResult_T enmResult, int rc = VINF_SUCCESS);
    203 
    204 protected:
    205 
    206     /** The waiting flag(s). The specifies what to
    207      *  wait for. */
    208     uint32_t                    mWaitFlags;
    209     /** Structure containing the overall result. */
    210     GuestProcessWaitResult      mWaitResult;
    211204};
    212205
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette