id.h
Go to the documentation of this file.
00001 /*
00002  * id.h
00003  *
00004  *  Created on: 29.08.2012
00005  *      Author: josh
00006  */
00007 
00008 #ifndef ID_H_
00009 #define ID_H_
00010 
00011 
00012 namespace Slam_CurvedPolygon
00013 {
00018   struct S_ID { //TODO: replace with sorted list
00019     std::vector<int> ids_;
00020 
00021     void operator+=(const int id) {
00022       if(!(*this==id))
00023         ids_.push_back(id);
00024     }
00025 
00026     void operator+=(const S_ID &o) {
00027       for(size_t i=0; i<o.ids_.size(); i++)
00028         *this += o.ids_[i];
00029     }
00030 
00031     bool operator==(const int id) const {
00032       for(size_t i=0; i<ids_.size(); i++)
00033         if(ids_[i]==id)
00034           return true;
00035       return false;
00036     }
00037 
00038     bool operator==(const S_ID &o) const {
00039       for(size_t i=0; i<ids_.size(); i++)
00040         if(o==ids_[i])
00041           return true;
00042       return false;
00043     }
00044   };
00045 }
00046 
00047 #endif /* ID_H_ */


cob_3d_mapping_slam
Author(s): Joshua Hampp
autogenerated on Wed Aug 26 2015 11:04:51