Changeset 1134 for trunk/yat/utility


Ignore:
Timestamp:
Feb 23, 2008, 11:52:43 PM (14 years ago)
Author:
Peter
Message:

using Index class instead of std::vector<size_t>

Location:
trunk/yat/utility
Files:
2 edited

Legend:

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

    r1127 r1134  
    4747
    4848
     49  Index::Index(const std::vector<size_t>& vec)
     50    : index_(utility::SmartPtr<const std::vector<size_t> >
     51             (new std::vector<size_t>(vec)))
     52  {}
     53
     54
    4955  Index::Index(const Index& a, const Index& b)
    5056  {
     
    6369
    6470
     71  const std::vector<size_t>& Index::vector(void) const
     72  {
     73    return *index_;
     74  }
     75
     76
    6577  const size_t& Index::operator[](size_t i) const
    6678  {
  • trunk/yat/utility/Index.h

    r1127 r1134  
    6363
    6464    /**
     65       \brief Constructor
     66
     67       vec is copied
     68     */
     69    explicit Index(const std::vector<size_t>& vec);
     70
     71    /**
    6572       \brief access operator
    6673    */
     
    7178    */
    7279    size_t size(void) const;
     80
     81    /**
     82       \return underlying vector
     83    */
     84    const std::vector<size_t>& vector(void) const;
    7385
    7486  private:
Note: See TracChangeset for help on using the changeset viewer.