Changeset 20968

Show
Ignore:
Timestamp:
12/30/07 09:28:46 (8 months ago)
Author:
patrick
Message:

Improved const correctness including expanded use of const references for
objects. In no small way, this is aimed at reducing expensive copying of
data. Bumped the version to 1.3.17.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/gadgeteer/ChangeLog

    r20934 r20968  
    11DATE        AUTHOR      CHANGE 
    22----------- ----------- ------------------------------------------------------- 
     3Dec-30-2007 patrick     Improved const correctness for most input-related 
     4                        classes. This should not break any existing code, but 
     5                        some code could reduce data copying by using const 
     6                        references to returned data. 
     7                        NEW VERSION: 1.3.17 
    38Nov-18-2007 patrick     The X,Y position for mouse events is now reported 
    49                        using a lower left-hand corner origin to match the 
  • juggler/trunk/modules/gadgeteer/VERSION

    r20934 r20968  
     11.3.17-0 @12/30/2007 15:30:00 UTC@ 
    121.3.16-0 @11/18/2007 19:35:00 UTC@ 
    231.3.15-0 @11/18/2007 09:15:00 UTC@ 
  • juggler/trunk/modules/gadgeteer/gadget/Devices/Sim/SimGloveGesture.cpp

    r19729 r20968  
    145145 * @return id of current gesture 
    146146 */ 
    147 int SimGloveGesture::getGesture() 
     147int SimGloveGesture::getGesture() const 
    148148{ return mCurGesture; } 
    149149 
  • juggler/trunk/modules/gadgeteer/gadget/Devices/Sim/SimGloveGesture.h

    r20356 r20968  
    6363    * @return id of current gesture. 
    6464    */ 
    65    virtual int getGesture()
     65   virtual int getGesture() const
    6666 
    6767   virtual const DigitalData getDigitalData(int devNum = 0); 
  • juggler/trunk/modules/gadgeteer/gadget/Type/AnalogProxy.h

    r20966 r20968  
    9191 
    9292   /** Returns a pointer to the gadget::Analog object that we are proxying. */ 
    93    AnalogPtr getAnalogPtr() 
     93   const AnalogPtr getAnalogPtr() const 
    9494   { 
    95       if(isStupefied() || NULL == mTypedDevice.get()
     95      if ( isStupefied() || NULL == mTypedDevice.get()
    9696      { 
    9797         return AnalogPtr(); 
  • juggler/trunk/modules/gadgeteer/gadget/Type/Command.cpp

    r20123 r20968  
    4646} 
    4747 
    48 const CommandData Command::getCommandData(int devNum) 
     48const CommandData Command::getCommandData(const int devNum) const 
    4949{ 
    50    SampleBuffer_t::buffer_t& stable_buffer = mCommandSamples.stableBuffer(); 
     50   const SampleBuffer_t::buffer_t& stable_buffer = 
     51      mCommandSamples.stableBuffer(); 
    5152 
    5253   if ( (!stable_buffer.empty()) && 
  • juggler/trunk/modules/gadgeteer/gadget/Type/Command.h

    r20603 r20968  
    100100    *       an error to a log or console - but will not ASSERT. 
    101101    */ 
    102    const CommandData getCommandData(int devNum = 0)
     102   const CommandData getCommandData(const int devNum = 0) const
    103103 
    104104   /** 
     
    135135    * Returns the current stable sample buffers for this device. 
    136136    */ 
    137    const SampleBuffer_t::buffer_t& getCommandDataBuffer() 
     137   const SampleBuffer_t::buffer_t& getCommandDataBuffer() const 
    138138   { 
    139139      return mCommandSamples.stableBuffer(); 
  • juggler/trunk/modules/gadgeteer/gadget/Type/CommandProxy.h

    r20966 r20968  
    8383   } 
    8484 
    85    CommandData* getCommandData() 
     85   const CommandData* getCommandData() const 
    8686   { 
    8787      return &mData; 
     
    9191    * Returns a pointer to the gadget::Command object that we are proxying. 
    9292    */ 
    93    CommandPtr getCommandPtr() 
     93   const CommandPtr getCommandPtr() const 
    9494   { 
    9595      // If we're stupefied, return NULL.  Otherwise, return mTypedDevice. 
  • juggler/trunk/modules/gadgeteer/gadget/Type/DeviceFactory.cpp

    r20243 r20968  
    183183// Simply query all device constructors registered looking 
    184184// for one that knows how to load the device 
    185 bool DeviceFactory::recognizeDevice(jccl::ConfigElementPtr element) 
     185bool DeviceFactory::recognizeDevice(jccl::ConfigElementPtr element) const 
    186186{ 
    187187   return ! (findConstructor(element) == -1); 
     
    209209} 
    210210 
    211 int DeviceFactory::findConstructor(jccl::ConfigElementPtr element) 
     211int DeviceFactory::findConstructor(jccl::ConfigElementPtr element) const 
    212212{ 
    213213   const std::string element_type(element->getID()); 
  • juggler/trunk/modules/gadgeteer/gadget/Type/DeviceFactory.h

    r20243 r20968  
    7676    * @return true if the factory knows how to create the device; false if not. 
    7777    */ 
    78    bool recognizeDevice(jccl::ConfigElementPtr element)
     78   bool recognizeDevice(jccl::ConfigElementPtr element) const
    7979 
    8080   /** 
     
    9393    *         Otherwise, the index of the constructor is returned. 
    9494    */ 
    95    int findConstructor(jccl::ConfigElementPtr element)
     95   int findConstructor(jccl::ConfigElementPtr element) const
    9696 
    9797   void debugDump(); 
  • juggler/trunk/modules/gadgeteer/gadget/Type/DeviceInterface.h

    r20131 r20968  
    7676 
    7777   /** Returns the name of the proxy. */ 
    78    std::string getProxyName() const 
     78   const std::string& getProxyName() const 
    7979   { 
    8080      return mProxyName; 
     
    161161    * @see init() 
    162162    */ 
    163    boost::shared_ptr<PROXY_TYPE> operator->() 
     163   const boost::shared_ptr<PROXY_TYPE> operator->() const 
    164164   { 
    165165      return mTypeSpecificProxy; 
     
    180180 
    181181   /** Returns the underlying proxy to which we are connected. */ 
    182    boost::shared_ptr<PROXY_TYPE> getProxy() 
     182   const boost::shared_ptr<PROXY_TYPE> getProxy() const 
    183183   { 
    184184      return mTypeSpecificProxy; 
  • juggler/trunk/modules/gadgeteer/gadget/Type/DigitalProxy.h

    r20966 r20968  
    9696   } 
    9797 
    98    DigitalData* getDigitalData() 
     98   const DigitalData* getDigitalData() const 
    9999   { 
    100100      return &mData; 
     
    102102 
    103103   /** Returns a pointer to the gadget::Digital object that we are proxying. */ 
    104    DigitalPtr getDigitalPtr() 
     104   const DigitalPtr getDigitalPtr() const 
    105105   { 
    106106      // If we're stupefied, return NULL.  Otherwise, return mTypedDevice. 
  • juggler/trunk/modules/gadgeteer/gadget/Type/Gesture.h

    r20138 r20968  
    7272    * @return -1 if the gesture name not found. 
    7373    */ 
    74    virtual int getGestureIndex(std::string name) = 0; 
     74   virtual int getGestureIndex(const std::string& name) const = 0; 
    7575 
    7676   /** 
     
    7878    * If id is -1, then it returns the string name of the current gesture. 
    7979    */ 
    80    virtual std::string getGestureString(int id) = 0; 
     80   virtual std::string getGestureString(const int id) const = 0; 
    8181 
    8282   /** 
     
    8484    * @return id of current gesture. 
    8585    */ 
    86    virtual int getGesture() = 0; 
     86   virtual int getGesture() const = 0; 
    8787 
    8888 
  • juggler/trunk/modules/gadgeteer/gadget/Type/GestureProxy.h

    r20966 r20968  
    7171    * @return id of current gesture. 
    7272    */ 
    73    int getGesture() 
     73   int getGesture() const 
    7474   { 
    7575      const int defaultGesture(-1); 
     
    9090    * @return -1 if not found 
    9191    */ 
    92    int getGestureIndex(std::string name) 
     92   int getGestureIndex(const std::string& name) const 
    9393   { 
    9494      const int defaultGestureIndex(-1); 
     
    108108    * @note if gestureId = -1, returns name of current gesture. 
    109109    */ 
    110    std::string getGestureString(int gestureId = -1) 
     110   const std::string getGestureString(const int gestureId = -1) 
    111111   { 
    112112      if(isStupefied()) 
     
    124124 
    125125   /** Returns a pointer to the device held by this proxy. */ 
    126    GesturePtr getGesturePtr() 
     126   const GesturePtr getGesturePtr() const 
    127127   { 
    128128      if(isStupefied()) 
  • juggler/trunk/modules/gadgeteer/gadget/Type/Glove.cpp

    r20123 r20968  
    206206 * Use getJointTransform to get the transformation matrix. 
    207207 */ 
    208 gmtl::Vec3f Glove::getTipVector(GloveData::GloveComponent component, int devNum) 
     208const gmtl::Vec3f Glove:: 
     209getTipVector(const GloveData::GloveComponent component, const int devNum) const 
    209210{ 
    210211   gmtl::Vec3f y_axis(0.0f, 1.0f, 0.0f); 
     
    219220 * wTt = wTb bTj jTt 
    220221 */ 
    221 gmtl::Matrix44f Glove::getTipTransform(GloveData::GloveComponent component,int devNum) 
     222const gmtl::Matrix44f Glove:: 
     223getTipTransform(const GloveData::GloveComponent component, const int devNum) 
     224   const 
    222225{ 
    223226   gmtl::Matrix44f worldTdij; 
     
    237240 * wTj = wTb bTj 
    238241 */ 
    239 gmtl::Matrix44f Glove::getJointTransform(GloveData::GloveComponent component, GloveData::GloveJoint joint,int devNum) 
     242const gmtl::Matrix44f Glove:: 
     243getJointTransform(const GloveData::GloveComponent component, 
     244                  const GloveData::GloveJoint joint, int devNum) 
     245   const 
    240246{ 
    241247   gmtl::Matrix44f result;           // The returned matrix. 
     
    264270 
    265271   // Compute return value: result = TIPw = wTb bTd dTt 
    266    if(devNum<(int)mGlovePositions.size()){ 
     272   if ( devNum < (int) mGlovePositions.size() ) 
     273   { 
    267274      result=mGlovePositions[devNum]->getData();      // wTb 
    268275   } 
     
    272279} 
    273280 
    274 GloveData Glove::getGloveData(int devNum = 0) 
    275 
    276    SampleBuffer_t::buffer_t& stable_buffer = mGloveSamples.stableBuffer(); 
     281const GloveData Glove::getGloveData(const int devNum) const 
     282
     283   const SampleBuffer_t::buffer_t& stable_buffer = 
     284      mGloveSamples.stableBuffer(); 
    277285 
    278286   if ( (!stable_buffer.empty()) && (stable_buffer.back().size() > (unsigned)devNum) )  // If have entry && devNum in range 
     
    297305 * Utility function to convert a 10 size vector of DigitalData to GloveData 
    298306 */ 
    299 std::vector<GloveData> Glove::getGloveDataFromDigitalData(const std::vector<DigitalData> &digitalData) 
     307const std::vector<GloveData> Glove:: 
     308getGloveDataFromDigitalData(const std::vector<DigitalData> &digitalData) 
     309   const 
    300310{ 
    301311   assert(digitalData.size()>=10); 
  • juggler/trunk/modules/gadgeteer/gadget/Type/Glove.h

    r20603 r20968  
    8181    * Can be used for selection, etc. 
    8282    */ 
    83    gmtl::Vec3f getTipVector(GloveData::GloveComponent component, int devNum); 
     83   const gmtl::Vec3f getTipVector(const GloveData::GloveComponent component, 
     84                                  const int devNum) 
     85      const; 
    8486 
    8587   /** 
     
    8789    * component. 
    8890    */ 
    89    gmtl::Matrix44f getTipTransform(GloveData::GloveComponent component, 
    90                                    int devNum); 
     91   const gmtl::Matrix44f 
     92      getTipTransform(const GloveData::GloveComponent component, 
     93                      const int devNum) 
     94      const; 
    9195 
    9296   /** 
    9397    * Returns the transform matrix of the specified joint in world space. 
    9498    */ 
    95    gmtl::Matrix44f getJointTransform(GloveData::GloveComponent component, 
    96                                      GloveData::GloveJoint joint, int devNum); 
     99   const gmtl::Matrix44f 
     100      getJointTransform(const GloveData::GloveComponent component, 
     101                        const GloveData::GloveJoint joint, const int devNum) 
     102      const; 
    97103 
    98104   /** Returns a copy of the glove data struct. */ 
    99    GloveData getGloveData(int devNum)
     105   const GloveData getGloveData(const int devNum) const
    100106   //@} 
    101107 
     
    128134   } 
    129135 
    130    const SampleBuffer_t::buffer_t& getGloveDataBuffer() 
     136   const SampleBuffer_t::buffer_t& getGloveDataBuffer() const 
    131137   { 
    132138      return mGloveSamples.stableBuffer(); 
     
    159165 
    160166   /** Utility function to generate GloveData from DigitalData. */ 
    161    std::vector<GloveData> getGloveDataFromDigitalData(const std::vector<DigitalData>& digitalData); 
     167   const std::vector<GloveData> 
     168      getGloveDataFromDigitalData(const std::vector<DigitalData>& digitalData) 
     169      const; 
    162170 
    163171protected: 
  • juggler/trunk/modules/gadgeteer/gadget/Type/GloveData.h

    r19729 r20968  
    6969 
    7070   /** 
    71     * Calulates all the xform matrices 
    72     * This is calculated based upon the angles in the data structure 
     71    * Calulates all the transformation matrices. 
     72    * This is calculated based upon the angles in the data structure. 
     73    * 
     74    * @post mTransforms is updated to reflect the current transformations. 
    7375    */ 
    7476   int calcXforms(); 
     
    7779    * Returns the transform matrix of the specified joint 
    7880    */ 
    79    gmtl::Matrix44f getLocalTransformMatrix(GloveComponent component,GloveJoint joint) const 
     81   const gmtl::Matrix44f& 
     82      getLocalTransformMatrix(const GloveComponent component, 
     83                              const GloveJoint joint) 
     84      const 
    8085   { 
    8186      return mTransforms[component][joint]; 
  • juggler/trunk/modules/gadgeteer/gadget/Type/GloveGesture.cpp

    r19729 r20968  
    3737 * @return (gesture not in range) - empty string 
    3838 */ 
    39 std::string GloveGesture::getGestureString(int gestureId) 
     39std::string GloveGesture::getGestureString(const int gestureId) const 
    4040{ 
    4141   if(gestureId < 0) 
     
    134134 
    135135/** Returns the gesture identifier of the gesture. */ 
    136 int GloveGesture::getGestureIndex(std::string gestureName) 
     136int GloveGesture::getGestureIndex(const std::string& gestureName) const 
    137137{ 
    138138   unsigned i = 0; 
  • juggler/trunk/modules/gadgeteer/gadget/Type/GloveGesture.h

    r20061 r20968  
    6363    * @note if gestureId = -1, returns name of current gesture. 
    6464    */ 
    65    virtual std::string getGestureString(int gestureId = -1)
     65   virtual std::string getGestureString(const int gestureId) const
    6666 
    6767   /** 
     
    102102    * @return -1 if not found. 
    103103    */ 
    104    virtual int getGestureIndex(std::string gestureName)
     104   virtual int getGestureIndex(const std::string& gestureName) const
    105105 
    106106   /** Return the number of gestures in system. */ 
    107    virtual int getNumGestures() 
    108    { return mGestureNames.size(); } 
     107   virtual int getNumGestures() const 
     108   { 
     109      return mGestureNames.size(); 
     110   } 
    109111 
    110112protected: 
  • juggler/trunk/modules/gadgeteer/gadget/Type/GloveProxy.h

    r20966 r20968  
    7070   virtual ~GloveProxy(); 
    7171 
    72    gmtl::Vec3f getTipVector(GloveData::GloveComponent component) 
     72   const gmtl::Vec3f getTipVector(const GloveData::GloveComponent component)  
     73      const 
    7374   { 
    7475      if(isStupefied()) 
     
    8283   } 
    8384 
    84    gmtl::Matrix44f getTipTransform( GloveData::GloveComponent component) 
     85   const gmtl::Matrix44f 
     86   getTipTransform(const GloveData::GloveComponent component) const 
    8587   { 
    8688      if(isStupefied()) 
     
    9496   } 
    9597   
    96    gmtl::Matrix44f getJointTransform(GloveData::GloveComponent component, 
    97                                      GloveData::GloveJoint joint) 
     98   const gmtl::Matrix44f 
     99   getJointTransform(const GloveData::GloveComponent component, 
     100                     const GloveData::GloveJoint joint) 
     101      const 
    98102   { 
    99103      if(isStupefied()) 
     
    107111   } 
    108112 
    109    GloveData getData() 
     113   const GloveData getData() const 
    110114   { 
    111115      if(isStupefied()) 
     
    123127 
    124128   /** Returns a pointer to the device held by this proxy. */ 
    125    GlovePtr getGlovePtr() 
     129   const GlovePtr getGlovePtr() const 
    126130   { 
    127131      if(isStupefied()) 
     
    136140 
    137141   /** Returns the subUnit number that this proxy points to. */ 
    138    int getUnit() 
     142   int getUnit() const 
    139143   { 
    140144      return mUnitNum; 
    141145   } 
    142146 
    143    bool isVisible() 
     147   bool isVisible() const 
    144148   { 
    145149      return mVisible; 
  • juggler/trunk/modules/gadgeteer/gadget/Type/Input.h

    r20603 r20968  
    163163    * "MyFlockOfBirds", "The Ibox", etc.). 
    164164    */ 
    165    std::string getInstanceName() 
     165   const std::string getInstanceName() const 
    166166   { 
    167167      if (mInstName.empty()) 
     
    207207 
    208208   /** Is this input device active? */ 
    209    bool isActive() 
     209   bool isActive() const 
    210210   { 
    211211      return mActive; 
  • juggler/trunk/modules/gadgeteer/gadget/Type/InputData.h

    r19729 r20968  
    6262 
    6363   /** Return the last marked time using the vpr::Interval. */ 
    64    vpr::Interval getTime() const 
     64   const vpr::Interval& getTime() const 
    6565   { 
    6666      return mTimeStamp; 
  • juggler/trunk/modules/gadgeteer/gadget/Type/KeyboardMouse.cpp

    r20322 r20968  
    149149} 
    150150 
    151 bool KeyboardMouse::modifierOnly(gadget::Keys modKey) 
     151bool KeyboardMouse::modifierOnly(gadget::Keys modKey) const 
    152152{ 
    153153   switch (modKey) 
     
    167167} 
    168168 
    169 std::string KeyboardMouse::getKeyName(gadget::Keys keyId) 
     169const std::string KeyboardMouse::getKeyName(const gadget::Keys keyId) const 
    170170{ 
    171171   switch(keyId) 
     
    334334} 
    335335 
    336 KeyboardMouse::EventQueue KeyboardMouse::getEventQueue() 
     336const KeyboardMouse::EventQueue KeyboardMouse::getEventQueue() 
    337337{ 
    338338   vpr::Guard<vpr::Mutex> guard(mCurEventQueueLock); 
  • juggler/trunk/modules/gadgeteer/gadget/Type/KeyboardMouse.h

    r20603 r20968  
    116116    * keyboard data across the cluster. 
    117117    */ 
    118    vpr::Interval getSyncTime() 
     118   const vpr::Interval& getSyncTime() const 
    119119   { 
    120120      return mSyncTime; 
     
    130130    * @return The number of times the key was pressed since last update. 
    131131    */ 
    132    int keyPressed(gadget::Keys keyId) 
     132   int keyPressed(const gadget::Keys keyId) const 
    133133   { 
    134134      return mCurKeys[keyId]; 
     
    146146    * @return true if the given modifier key is the only modifier key pressed. 
    147147    */ 
    148    bool modifierOnly(gadget::Keys modKey)
     148   bool modifierOnly(const gadget::Keys modKey) const
    149149 
    150150   /** 
     
    156156    * @return A string that is the symbolic name of the given key. 
    157157    */ 
    158    std::string getKeyName(gadget::Keys keyId)
    159  
    160    /** 
    161     * Returns a copy of the current queue of events for this device. 
    162     */ 
    163    EventQueue getEventQueue(); 
     158   const std::string getKeyName(const gadget::Keys keyId) const
     159 
     160   /** 
     161    * Returns a \em copy of the current queue of events for this device. 
     162    */ 
     163   const EventQueue getEventQueue(); 
    164164 
    165165   /** 
  • juggler/trunk/modules/gadgeteer/gadget/Type/KeyboardMouseProxy.h

    r20966 r20968  
    6969    * Returns a pointer to the gadget::KeyboardMouse object held by this proxy. 
    7070    */ 
    71    KeyboardMousePtr getKeyboardMousePtr() 
     71   const KeyboardMousePtr getKeyboardMousePtr() const 
    7272   { 
    7373      if(isStupefied()) 
     
    9595    * @return true if the given modifier key is the only modifier key pressed. 
    9696    */ 
    97    bool modifierOnly(gadget::Keys modKey) 
     97   bool modifierOnly(gadget::Keys modKey) const 
    9898   { 
    9999      if ( isStupefied() || (NULL == mTypedDevice.get()) ) 
     
    116116    * @return The number of times the key was pressed since last update. 
    117117    */ 
    118    int keyPressed(gadget::Keys keyId) 
     118   int keyPressed(gadget::Keys keyId) const 
    119119   { 
    120120      if ( isStupefied() || (NULL == mTypedDevice.get()) ) 
     
    131131    * Returns a copy of the current queue of events for the proxied device. 
    132132    */ 
    133    KeyboardMouse::EventQueue getEventQueue() 
     133   const KeyboardMouse::EventQueue getEventQueue() const 
    134134   { 
    135135      if ( isStupefied() || (NULL == mTypedDevice.get()) ) 
  • juggler/trunk/modules/gadgeteer/gadget/Type/LinearSigmoidPositionFilter.cpp

    r19729 r20968  
    5959// Else, perform a quaternion slerp on the rotation and linear calculation 
    6060// on position and return that matrix. 
    61 gmtl::Matrix44f LinearSigmoidPositionFilter::getPos(const gmtl::Matrix44f newPos) 
     61const gmtl::Matrix44f LinearSigmoidPositionFilter:: 
     62getPos(const gmtl::Matrix44f newPos) const 
    6263{ 
    6364   // If value is the same, then return immediately 
     
    135136} 
    136137 
    137 float LinearSigmoidPositionFilter::getScaleFactor(const float distance) 
     138float LinearSigmoidPositionFilter::getScaleFactor(const float distance) const 
    138139{ 
    139140   if(distance < mMinDist) 
  • juggler/trunk/modules/gadgeteer/gadget/Type/LinearSigmoidPositionFilter.h

    r19729 r20968  
    5454    * @param newPos The new postion this frame of the physical device. 
    5555    */ 
    56    gmtl::Matrix44f getPos(const gmtl::Matrix44f newPos)
     56   const gmtl::Matrix44f getPos(const gmtl::Matrix44f& newPos) const
    5757 
    5858   /** 
     
    6060    * maxDist values. 
    6161    */ 
    62    float getScaleFactor(const float distance)
     62   float getScaleFactor(const float distance) const
    6363 
    64    void setMinDist(float val) { mMinDist = val;} 
    65    float minDist() { return mMinDist;} 
     64   void setMinDist(const float val) 
     65   { 
     66      mMinDist = val; 
     67   } 
    6668 
    67    void setMaxDist(float val) { mMaxDist = val;} 
    68    float maxDist() { return mMaxDist;} 
     69   float minDist() const 
     70   { 
     71      return mMinDist; 
     72   } 
    6973 
    70    void setMaxThreshold(float val) { mMaxThreshold = val; } 
    71    float maxTheshold() { return mMaxThreshold; } 
     74   void setMaxDist(const float val) 
     75   { 
     76      mMaxDist = val; 
     77   } 
     78 
     79   float maxDist() const 
     80   { 
     81      return mMaxDist; 
     82   } 
     83 
     84   void setMaxThreshold(const float val) 
     85   { 
     86      mMaxThreshold = val; 
     87   } 
     88 
     89   float maxTheshold() const 
     90   { 
     91      return mMaxThreshold; 
     92   } 
    7293 
    7394private: 
  • juggler/trunk/modules/gadgeteer/gadget/Type/Position.h

    r20603 r20968  
    9595   virtual bool config(jccl::ConfigElementPtr e); 
    9696 
    97  
    9897   /** Get positional data. */ 
    99    PositionData getPositionData(int devNum = 0) 
     98   const PositionData& getPositionData(int devNum = 0) const 
    10099   { 
    101       SampleBuffer_t::buffer_t& stable_buffer = mPosSamples.stableBuffer(); 
     100      const SampleBuffer_t::buffer_t& stable_buffer = 
     101         mPosSamples.stableBuffer(); 
    102102 
    103103      if ((!stable_buffer.empty()) && 
     
    175175    * Returns the current stable sample buffers for this device. 
    176176    */ 
    177    const SampleBuffer_t::buffer_t& getPositionDataBuffer() 
     177   const SampleBuffer_t::buffer_t& getPositionDataBuffer() const 
    178178   { 
    179179      return mPosSamples.stableBuffer(); 
  • juggler/trunk/modules/gadgeteer/gadget/Type/PositionData.h

    r19729 r20968  
    5050   } 
    5151 
    52    gmtl::Matrix44f getPosition() const 
     52   const gmtl::Matrix44f& getPosition() const 
    5353   { 
    5454      return mPosData; 
    5555   } 
    5656 
    57    void setPosition(gmtl::Matrix44f posMatrix) 
     57   void setPosition(const gmtl::Matrix44f& posMatrix) 
    5858   { 
    5959      mPosData = posMatrix; 
  • juggler/trunk/modules/gadgeteer/gadget/Type/PositionProxy.cpp

    r20966 r20968  
    149149 
    150150// Deprecated, don't use 
    151 gmtl::Matrix44f PositionProxy::getData(float scaleFactor) const 
     151const gmtl::Matrix44f PositionProxy::getData(const float scaleFactor) const 
    152152{ 
    153153   gmtl::Matrix44f ret_mat; 
  • juggler/trunk/modules/gadgeteer/gadget/Type/PositionProxy.h

    r20966 r20968  
    100100    * @return The position of the device as a matrix. 
    101101    */ 
    102    gmtl::Matrix44f getData(float scaleFactor = gadget::PositionUnitConversion::ConvertToFeet ) const; 
     102   const gmtl::Matrix44f 
     103   getData(const float scaleFactor = PositionUnitConversion::ConvertToFeet) 
     104      const; 
    103105    
    104106   /** Gets the actual PositionData. */ 
    105    PositionData* getPositionData() 
     107   const PositionData* getPositionData() const 
    106108   { 
    107109      return &mPositionData; 
     
    115117 
    116118   /// Returns a pointer to the gadget::Position object held by this proxy. 
    117    PositionPtr getPositionPtr() 
     119   const PositionPtr getPositionPtr() const 
    118120   { 
    119121      if(mStupefied || NULL == mTypedDevice.get()) 
  • juggler/trunk/modules/gadgeteer/gadget/Type/Proxy.h

    r20966 r20968  
    107107 
    108108      /** Gets the name of the proxy. */ 
    109       std::string getName() const 
     109      const std::string& getName() const 
    110110      { 
    111111         return mName; 
  • juggler/trunk/modules/gadgeteer/gadget/Type/SampleBuffer.h

    r20055 r20968  
    107107 
    108108   void lock() 
    109    {  mLock.acquire(); } 
     109   { 
     110      mLock.acquire(); 
     111   } 
    110112 
    111113   void unlock() 
    112    {  mLock.release(); } 
     114   { 
     115      mLock.release(); 
     116   } 
    113117 
    114118   buffer_t& stableBuffer() 
    115    { return mStableBuffer; } 
     119   { 
     120      return mStableBuffer; 
     121   } 
     122 
     123   const buffer_t& stableBuffer() const 
     124   { 
     125      return mStableBuffer; 
     126   } 
    116127 
    117128protected: 
  • juggler/trunk/modules/gadgeteer/gadget/Type/String.cpp