Ignore:
Timestamp:
Sep 25, 2008, 2:02:52 PM (14 years ago)
Author:
Peter
Message:

refs #368 - introducing proxy class

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/DataWeightProxy.cc

    r1532 r1533  
    2020*/
    2121
    22 #include "DataWeight.h"
     22#include "DataWeightProxy.h"
    2323
    2424namespace theplu {
     
    2626namespace utility { 
    2727
    28   DataWeight::DataWeight(double data, double weight)
     28  DataWeightProxy::DataWeightProxy(double& data, double& weight)
    2929    : data_(data), weight_(weight) {}
    3030
    31 
    32   double& DataWeight::data(void)
     31  double& DataWeightProxy::data(void)
    3332  {
    3433    return data_;
     
    3635
    3736
    38   const double& DataWeight::data(void) const
     37  const double& DataWeightProxy::data(void) const
    3938  {
    4039    return data_;
    4140  }
    4241
    43   double& DataWeight::weight(void)
     42
     43  double& DataWeightProxy::weight(void)
    4444  {
    4545    return weight_;
     
    4747
    4848
    49   const double& DataWeight::weight(void) const
     49  const double& DataWeightProxy::weight(void) const
    5050  {
    5151    return weight_;
    5252  }
    5353
    54 
    55   bool operator==(const DataWeight& lhs, const DataWeight& rhs)
    56   {
    57     return lhs.data() == rhs.data();
    58   }
    59 
    60 
    61   bool operator!=(const DataWeight& lhs, const DataWeight& rhs)
    62   {
    63     return ! (lhs == rhs);
    64   }
    65 
    66 
    67   bool operator<(const DataWeight& lhs, const DataWeight& rhs)
    68   {
    69     return lhs.data() < rhs.data();
    70   }
    71 
    72 
    73   bool operator>(const DataWeight& lhs, const DataWeight& rhs)
    74   {
    75     return rhs < lhs;
    76   }
    77 
    78 
    79   bool operator<=(const DataWeight& lhs, const DataWeight& rhs)
    80   {
    81     return rhs > lhs;
    82   }
    83 
    84 
    85   bool operator>=(const DataWeight& lhs, const DataWeight& rhs)
    86   {
    87     return rhs < lhs;
    88   }
    89 
    90 
    9154}}} // of namespace utility, yat, and theplu
Note: See TracChangeset for help on using the changeset viewer.