Changeset 20966

Show
Ignore:
Timestamp:
12/30/07 08:09:51 (10 months ago)
Author:
patrick
Message:

De-inline methods for which there is no benefit to use inlining (virtuals)
or for which inlining can be deceptively expensive (constructors and
destructors). No functional changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/gadgeteer/gadget/Type/AnalogProxy.cpp

    r20131 r20966  
    2727#include <gadget/gadgetConfig.h> 
    2828#include <jccl/Config/ConfigElement.h> 
    29 #include <gadget/Util/Debug.h> 
    3029#include <gadget/Type/AnalogProxy.h> 
     30 
    3131 
    3232namespace gadget 
    3333{ 
     34 
     35AnalogProxy::AnalogProxy(const std::string& deviceName, const int unitNum) 
     36   : TypedProxy<Analog>(deviceName) 
     37   , mUnitNum(unitNum) 
     38   , mData(-1.0f) 
     39{ 
     40   /* Do nothing. */ ; 
     41} 
     42 
    3443AnalogProxyPtr AnalogProxy::create(const std::string& deviceName, 
    3544                                   const int unitNum) 
     
    3847} 
    3948 
     49AnalogProxy::~AnalogProxy() 
     50{ 
     51   /* Do nothing. */ ; 
     52} 
     53 
     54void AnalogProxy::updateData() 
     55{ 
     56   if ( ! isStupefied() ) 
     57   { 
     58      // Make sure dependencies are updated. 
     59      getProxiedInputDevice()->updateDataIfNeeded(); 
     60      mData = mTypedDevice->getAnalogData(mUnitNum); 
     61   } 
     62} 
     63 
    4064std::string AnalogProxy::getElementType() 
    4165{ 
    4266   return "analog_proxy"; 
     67} 
     68 
     69vpr::Interval AnalogProxy::getTimeStamp() const 
     70{ 
     71   return mData.getTime(); 
    4372} 
    4473 
  • juggler/trunk/modules/gadgeteer/gadget/Type/AnalogProxy.h

    r20131 r20966  
    5353   /** Constructor. */ 
    5454   AnalogProxy(const std::string& deviceName = "UnknownAnalog", 
    55                const int unitNum = -1) 
    56       : TypedProxy<Analog>(deviceName) 
    57       , mUnitNum(unitNum) 
    58       , mData(-1.0f) 
    59    {;} 
     55               const int unitNum = -1); 
    6056 
    6157public: 
     
    6965                                const int unitNum = -1); 
    7066 
    71    virtual ~AnalogProxy() 
    72    {;} 
     67   virtual ~AnalogProxy(); 
    7368 
    7469   /** Updates the cached data copy from the device. */ 
    75    virtual void updateData() 
    76    { 
    77       if(!isStupefied()) 
    78       { 
    79          // Make sure dependencies are updated. 
    80          getProxiedInputDevice()->updateDataIfNeeded(); 
    81          mData = mTypedDevice->getAnalogData(mUnitNum); 
    82       } 
    83    } 
     70   virtual void updateData(); 
    8471 
    8572   /** Returns the time of last update. */ 
    86    virtual vpr::Interval getTimeStamp() const 
    87    { 
    88       return mData.getTime(); 
    89    } 
     73   virtual vpr::Interval getTimeStamp() const; 
    9074 
    9175   /** 
  • juggler/trunk/modules/gadgeteer/gadget/Type/CommandProxy.cpp

    r20131 r20966  
    3333{ 
    3434 
     35CommandProxy::CommandProxy(const std::string& deviceName, 
     36                           const int unitNum) 
     37   : TypedProxy<Command>(deviceName) 
     38   , mUnitNum(unitNum) 
     39   , mData(0) 
     40{ 
     41   /* Do nothing. */ ; 
     42} 
     43 
    3544CommandProxyPtr CommandProxy::create(const std::string& deviceName, 
    3645                                     const int unitNum) 
    3746{ 
    3847   return CommandProxyPtr(new CommandProxy(deviceName, unitNum)); 
     48} 
     49 
     50CommandProxy::~CommandProxy() 
     51{ 
     52   /* Do nothing. */ ; 
    3953} 
    4054 
     
    7488} 
    7589 
     90vpr::Interval CommandProxy::getTimeStamp() const 
     91{ 
     92   return mData.getTime(); 
     93} 
     94 
    7695} // End of gadget namespace 
  • juggler/trunk/modules/gadgeteer/gadget/Type/CommandProxy.h

    r20132 r20966  
    5151{ 
    5252protected: 
     53   CommandProxy(const std::string& deviceName = "UnknownCommand", 
     54                const int unitNum = -1); 
     55 
     56public: 
    5357   /** @name Construction/Destruction */ 
    5458   //@{ 
    55    CommandProxy(const std::string& deviceName = "UnknownCommand", 
    56                 const int unitNum = -1) 
    57       : TypedProxy<Command>(deviceName) 
    58       , mUnitNum(unitNum) 
    59       , mData(0) 
    60    {;} 
    61  
    62 public: 
    6359   /** 
    6460    * Creates a CommandProxy instance and returns it wrapped in a 
     
    7066                                 const int unitNum = -1); 
    7167 
    72    virtual ~CommandProxy() 
    73    {;} 
     68   virtual ~CommandProxy(); 
    7469   //@} 
    7570 
     
    7772 
    7873   /** Returns the time of the last update. */ 
    79    virtual vpr::Interval getTimeStamp() const 
    80    { 
    81       return mData.getTime(); 
    82    } 
     74   virtual vpr::Interval getTimeStamp() const; 
    8375 
    8476   /** 
  • juggler/trunk/modules/gadgeteer/gadget/Type/DigitalProxy.cpp

    r20131 r20966  
    3232namespace gadget 
    3333{ 
     34 
     35DigitalProxy::DigitalProxy(const std::string& deviceName, const int unitNum)  
     36   : TypedProxy<Digital>(deviceName) 
     37   , mUnitNum(unitNum) 
     38   , mData(0) 
     39{ 
     40   /* Do nothing. */ ; 
     41} 
     42 
    3443DigitalProxyPtr DigitalProxy::create(const std::string& deviceName, 
    3544                                     const int unitNum) 
    3645{ 
    3746   return DigitalProxyPtr(new DigitalProxy(deviceName, unitNum)); 
     47} 
     48 
     49DigitalProxy::~DigitalProxy() 
     50{ 
     51   ; 
    3852} 
    3953 
     
    108122} 
    109123 
     124vpr::Interval DigitalProxy::getTimeStamp() const 
     125{ 
     126   return mData.getTime(); 
     127} 
     128 
    110129} // End of gadget namespace 
  • juggler/trunk/modules/gadgeteer/gadget/Type/DigitalProxy.h

    r20131 r20966  
    5151{ 
    5252protected: 
     53   DigitalProxy(const std::string& deviceName = "UnknownDigital", 
     54                const int unitNum = -1); 
     55 
     56public: 
    5357   /** @name Construction/Destruction */ 
    5458   //@{ 
    55    DigitalProxy(const std::string& deviceName = "UnknownDigital", 
    56                 const int unitNum = -1)  
    57       : TypedProxy<Digital>(deviceName) 
    58       , mUnitNum(unitNum) 
    59       , mData(0) 
    60    {;} 
    61  
    62 public: 
    6359   /** 
    6460    * Creates a DigitalProxy instance and returns it wrapped in a 
     
    7066                                 const int unitNum = -1); 
    7167 
    72    virtual ~DigitalProxy() 
    73    {;} 
     68   virtual ~DigitalProxy(); 
    7469   //@} 
    7570 
     
    7772 
    7873   /** Returns the time of the last update. */ 
    79    virtual vpr::Interval getTimeStamp() const 
    80    { 
    81       return mData.getTime(); 
    82    } 
     74   virtual vpr::Interval getTimeStamp() const; 
    8375 
    8476   /** 
  • juggler/trunk/modules/gadgeteer/gadget/Type/GestureProxy.cpp

    r20131 r20966  
    3434{ 
    3535 
     36GestureProxy::GestureProxy(const std::string& deviceName) 
     37   : TypedProxy<Gesture>(deviceName) 
     38{ 
     39   /* Do nothing. */ ; 
     40} 
     41 
    3642GestureProxyPtr GestureProxy::create(const std::string& deviceName) 
    3743{ 
    3844   return GestureProxyPtr(new GestureProxy(deviceName)); 
     45} 
     46 
     47GestureProxy::~GestureProxy() 
     48{ 
     49   /* Do nothing. */ ; 
     50} 
     51 
     52vpr::Interval GestureProxy::getTimeStamp() const 
     53{ 
     54   // XXX: Broken for now, this is a case similar to the KeyboardMouse type in 
     55   //      that it does not point to one data element like digital, analog, 
     56   //      and position. 
     57   return vpr::Interval(); 
    3958} 
    4059 
  • juggler/trunk/modules/gadgeteer/gadget/Type/GestureProxy.h

    r20132 r20966  
    5454protected: 
    5555   /** Constructs the proxy to point to the given gesture device. */ 
    56    GestureProxy(const std::string& deviceName = "UnknownGesture") 
    57       : TypedProxy<Gesture>(deviceName) 
    58    {;} 
     56   GestureProxy(const std::string& deviceName = "UnknownGesture"); 
    5957 
    6058public: 
     
    6765   static GestureProxyPtr create(const std::string& deviceName = "UnknownGesture"); 
    6866 
    69    virtual ~GestureProxy() 
    70    {;} 
     67   virtual ~GestureProxy(); 
    7168 
    7269   /** 
     
    124121 
    125122   /** Returns time of last update. */ 
    126    vpr::Interval getTimeStamp() const 
    127    { 
    128       // XXX: Broken for now, this is a case similar to the KeyboardMouse type in that 
    129       //      it does not point to one data element like digital, analog, and position. 
    130       return vpr::Interval(); 
    131    } 
     123   vpr::Interval getTimeStamp() const; 
    132124 
    133125   /** Returns a pointer to the device held by this proxy. */ 
  • juggler/trunk/modules/gadgeteer/gadget/Type/GloveProxy.cpp

    r20131 r20966  
    3434{ 
    3535 
     36GloveProxy::GloveProxy(const std::string& deviceName, const int unitNum) 
     37   : TypedProxy<Glove>(deviceName) 
     38   , mVisible(true) 
     39   , mUnitNum(unitNum) 
     40{ 
     41   /* Do nothing. */ ; 
     42} 
     43 
    3644GloveProxyPtr GloveProxy::create(const std::string& deviceName, 
    3745                                 const int unitNum) 
    3846{ 
    3947   return GloveProxyPtr(new GloveProxy(deviceName, unitNum)); 
     48} 
     49 
     50GloveProxy::~GloveProxy() 
     51{ 
     52   /* Do nothing. */ ; 
     53} 
     54 
     55vpr::Interval GloveProxy::getTimeStamp() const 
     56{ 
     57   // XXX: Broken for now, this is a case similar to the KeyboardMouse type in 
     58   //      that it does not point to one data element like digital, analog, 
     59   //      and position. 
     60   return vpr::Interval(); 
    4061} 
    4162 
  • juggler/trunk/modules/gadgeteer/gadget/Type/GloveProxy.h

    r20131 r20966  
    5656    */ 
    5757   GloveProxy(const std::string& deviceName = "UnknownGlove", 
    58               const int unitNum = -1) 
    59       : TypedProxy<Glove>(deviceName) 
    60       , mUnitNum(unitNum) 
    61    { 
    62       mVisible = true; 
    63    } 
     58              const int unitNum = -1); 
    6459 
    6560public: 
     
    7368                               const int unitNum = -1); 
    7469 
    75    virtual ~GloveProxy() 
    76    {} 
     70   virtual ~GloveProxy(); 
    7771 
    7872   gmtl::Vec3f getTipVector(GloveData::GloveComponent component) 
     
    126120 
    127121   /** Returns time of last update. */ 
    128    vpr::Interval getTimeStamp() const 
    129    { 
    130       // XXX: Broken for now, this is a case similar to the KeyboardMouse type in that 
    131       //      it does not point to one data element like digital, analog, and position. 
    132       return vpr::Interval(); 
    133    } 
     122   vpr::Interval getTimeStamp() const; 
    134123 
    135124   /** Returns a pointer to the device held by this proxy. */ 
     
    163152private: 
    164153   /** Should we be drawn on the screen? */ 
    165    bool mVisible; 
     154   bool mVisible; 
    166155 
    167156   /** The sub-unit number to use in the device. */ 
  • juggler/trunk/modules/gadgeteer/gadget/Type/KeyboardMouseProxy.cpp

    r20131 r20966  
    3434{ 
    3535 
     36KeyboardMouseProxy::KeyboardMouseProxy() 
     37{ 
     38   /* Do nothing. */ ; 
     39} 
     40 
    3641KeyboardMouseProxyPtr KeyboardMouseProxy::create() 
    3742{ 
    3843   return KeyboardMouseProxyPtr(new KeyboardMouseProxy()); 
     44} 
     45 
     46KeyboardMouseProxy::~KeyboardMouseProxy() 
     47{ 
     48   /* Do nothing. */ ; 
     49} 
     50 
     51vpr::Interval KeyboardMouseProxy::getTimeStamp() const 
     52{ 
     53   if ( isStupefied() || (NULL == mTypedDevice.get()) ) 
     54   { 
     55      return vpr::Interval(); 
     56   } 
     57   else 
     58   { 
     59      return mTypedDevice->getSyncTime(); 
     60   }   
    3961} 
    4062 
  • juggler/trunk/modules/gadgeteer/gadget/Type/KeyboardMouseProxy.h

    r20132 r20966  
    5353{ 
    5454protected: 
    55    KeyboardMouseProxy() 
    56    {;} 
     55   KeyboardMouseProxy(); 
    5756 
    5857public: 
     
    6463    */ 
    6564   static KeyboardMouseProxyPtr create(); 
     65 
     66   virtual ~KeyboardMouseProxy(); 
    6667 
    6768   /** 
     
    8182 
    8283   /** Returns the time of the last update. */ 
    83    virtual vpr::Interval getTimeStamp() const 
    84    { 
    85       if ( isStupefied() || (NULL == mTypedDevice.get()) ) 
    86       { 
    87          return vpr::Interval(); 
    88       } 
    89       else 
    90       { 
    91          return mTypedDevice->getSyncTime(); 
    92       }   
    93    } 
     84   virtual vpr::Interval getTimeStamp() const; 
    9485 
    9586   /** 
  • juggler/trunk/modules/gadgeteer/gadget/Type/PositionProxy.cpp

    r20243 r20966  
    4545namespace gadget 
    4646{ 
     47 
     48PositionProxy::PositionProxy(const std::string& deviceName, const int unitNum) 
     49   : TypedProxy<Position>(deviceName) 
     50   , mUnitNum(unitNum) 
     51{ 
     52   /* Do nothing. */ ; 
     53} 
    4754 
    4855PositionProxyPtr PositionProxy::create(const std::string& deviceName, 
     
    172179} 
    173180 
    174  
    175181void PositionProxy::updateData() 
    176182{ 
     
    204210} 
    205211 
     212vpr::Interval PositionProxy::getTimeStamp() const 
     213{ 
     214   return mPositionData.getTime(); 
     215} 
     216 
    206217} // End of gadget namespace 
  • juggler/trunk/modules/gadgeteer/gadget/Type/PositionProxy.h

    r20243 r20966  
    6767protected: 
    6868   PositionProxy(const std::string& deviceName = "UnknownPosition", 
    69       const int unitNum = -1) 
    70       : TypedProxy<Position>(deviceName) 
    71       , mUnitNum(unitNum) 
    72    {;} 
     69                 const int unitNum = -1); 
    7370 
    7471public: 
     
    9188 
    9289   /** Returns time of last update. */ 
    93    virtual vpr::Interval getTimeStamp() const 
    94    { 
    95       return mPositionData.getTime(); 
    96    } 
     90   virtual vpr::Interval getTimeStamp() const; 
    9791 
    9892   /** 
  • juggler/trunk/modules/gadgeteer/gadget/Type/Proxy.cpp

    r19729 r20966  
    4848} 
    4949 
    50 /** 
    51  * Configures the proxy. 
    52  * @post Proxy is configured (it is not registered yet though). 
    53  * @return success. 
    54  */ 
    5550bool Proxy::config(jccl::ConfigElementPtr element) 
    5651{ 
     
    5954} 
    6055 
     56void Proxy::updateData() 
     57{ 
     58   /* Do nothing. */ ; 
     59} 
     60 
     61bool Proxy::isStupefied() const 
     62{ 
     63   return mStupefied; 
     64} 
     65 
    6166} // end namespace 
  • juggler/trunk/modules/gadgeteer/gadget/Type/Proxy.h

    r20138 r20966  
    4848   class GADGET_CLASS_API Proxy 
    4949   { 
     50   protected: 
     51      Proxy(); 
     52 
    5053   public: 
    51       Proxy(); 
    52  
    5354      virtual ~Proxy(); 
    5455 
    5556      /** 
    5657       * Configures the proxy. 
     58       * 
    5759       * @post Proxy is configured (it is not registered yet though). 
    58        * @return success. 
     60       * 
     61       * @return \c true is always returned. 
    5962       */ 
    6063      virtual bool config(jccl::ConfigElementPtr element); 
     
    6669      virtual bool refresh() = 0; 
    6770 
    68       virtual void updateData() 
    69       { 
    70          ; 
    71       } 
     71      virtual void updateData(); 
    7272 
    7373      /** 
     
    127127       * @note Renamed from isStupified() in version 0.92.1. 
    128128       */ 
    129       virtual bool isStupefied() const 
    130       { 
    131          return mStupefied; 
    132       } 
     129      virtual bool isStupefied() const; 
    133130 
    134131      /** 
  • juggler/trunk/modules/gadgeteer/gadget/Type/StringProxy.cpp

    r20131 r20966  
    3333{ 
    3434 
     35StringProxy::StringProxy(const std::string& deviceName, const int unitNum) 
     36   : TypedProxy<String>(deviceName) 
     37   , mUnitNum(unitNum) 
     38   , mData("") 
     39{ 
     40   /* Do nothing. */ ; 
     41} 
     42 
    3543StringProxyPtr StringProxy::create(const std::string deviceName, 
    3644                                   const int unitNum) 
    3745{ 
    3846   return StringProxyPtr(new StringProxy(deviceName, unitNum)); 
     47} 
     48 
     49StringProxy::~StringProxy() 
     50{ 
     51   /* Do nothing. */ ; 
    3952} 
    4053 
     
    7790} 
    7891 
     92vpr::Interval StringProxy::getTimeStamp() const 
     93{ 
     94   return mData.getTime(); 
     95} 
     96 
    7997} // End of gadget namespace 
  • juggler/trunk/modules/gadgeteer/gadget/Type/StringProxy.h

    r20131 r20966  
    6161{ 
    6262protected: 
     63   StringProxy(const std::string& deviceName = "UnknownString", 
     64               const int unitNum = -1); 
     65 
     66public: 
    6367   /** @name Construction/Destruction */ 
    6468   //@{ 
    65    StringProxy(const std::string& deviceName = "UnknownString", 
    66                const int unitNum = -1) 
    67       : TypedProxy<String>(deviceName) 
    68       , mUnitNum(unitNum) 
    69       , mData("") 
    70    {;} 
    71  
    72 public: 
    7369   /** 
    7470    * Creates a StringProxy instance and returns it wrapped in a 
     
    8076                                const int unitNum = -1); 
    8177 
    82    virtual ~StringProxy() 
    83    {;} 
     78   virtual ~StringProxy(); 
    8479   //@} 
    8580 
     
    8782 
    8883   /** Returns the time of the last update. */ 
    89    virtual vpr::Interval getTimeStamp() const 
    90    { 
    91       return mData.getTime(); 
    92    } 
     84   virtual vpr::Interval getTimeStamp() const; 
    9385 
    9486   /**