usbengines/usbotgwatcher/inc/cusbstate.h
changeset 1 705ec7b86991
parent 0 1e05558e2206
child 13 7068aba64af5
child 25 8c311f9acc5e
--- a/usbengines/usbotgwatcher/inc/cusbstate.h	Thu Dec 17 09:14:30 2009 +0200
+++ b/usbengines/usbotgwatcher/inc/cusbstate.h	Thu Jan 07 13:25:34 2010 +0200
@@ -66,9 +66,22 @@
 public:
 
     /**
+     * This function is needed to find a real state by id
+     * This might be used in switching states in watcher. New state object searched by its id
+     * @return Id
+     */
+    virtual TUsbStateIds Id();
+    
+    /**
      * Destruction
      */
     virtual ~CUsbState();
+    
+    /**
+     * Two-phased constructor.
+     * @param aWatcher owner
+     */
+    static CUsbState* NewL(CUsbOtgWatcher* aWatcher);
 
 protected:
     /**
@@ -90,13 +103,11 @@
     void ChangeHostStateL(TUsbStateIds aNewStateId);
 
 private:
-
+    
     /**
-     * This function is needed to find a real state by id
-     * This might be used in switching states in watcher. New state object searched by its id
-     * @return Id
+     * 2nd phase construction
      */
-    virtual TUsbStateIds Id() = 0;
+    void ConstructL();
 
     /**
      * State machine calls this, state object to perform any initial