Show
Ignore:
Timestamp:
05/01/07 14:55:06 (2 years ago)
Author:
aronb
Message:

Use shared_ptrs for gadget::Proxy and derived classes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/gadgeteer/gadget/ProxyFactory.h

    r19729 r20061  
    6868    * @return NULL if the proxy failed creation or configuration. 
    6969    */ 
    70    virtual Proxy* createProxy(jccl::ConfigElementPtr element) const = 0; 
     70   virtual ProxyPtr createProxy(jccl::ConfigElementPtr element) const = 0; 
    7171 
    7272   /** Gets the string definition of the type of element we can create. */ 
     
    9494    * @return NULL if proxy failed creation or configuration. 
    9595    */ 
    96    Proxy* createProxy(jccl::ConfigElementPtr element) const 
    97    { 
    98       PROXY* new_proxy = new PROXY;             // Create new proxy 
     96   ProxyPtr createProxy(jccl::ConfigElementPtr element) const 
     97   { 
     98      // Create new proxy 
     99      boost::shared_ptr<PROXY> new_proxy = boost::shared_ptr<PROXY>(new PROXY); 
    99100      bool success = new_proxy->config(element);  // Attempt to configure it 
    100101                                                  // config calls inputmgr registrator 
     
    106107      else                 // Failed 
    107108      { 
    108   //XXX//       delete new_proxy; 
    109          return NULL; 
     109         return ProxyPtr(); 
    110110      } 
    111111   } 
     
    176176    *         Otherwise, a pointer to the loaded proxy is returned. 
    177177    */ 
    178    Proxy* loadProxy(jccl::ConfigElementPtr element); 
     178   ProxyPtr loadProxy(jccl::ConfigElementPtr element); 
    179179 
    180180private: