Go to the documentation of this file.00001
00009 #ifndef LANDMARKFACTORY_HPP_
00010 #define LANDMARKFACTORY_HPP_
00011
00012 #include "rtslam/rtSlam.hpp"
00013
00014 namespace jafar {
00015 namespace rtslam {
00016
00017 class LandmarkFactoryAbstract
00018 {
00019 public:
00020 virtual landmark_ptr_t createInit(map_ptr_t mapPtr) = 0;
00021 virtual landmark_ptr_t createConverged(map_ptr_t mapPtr) = 0;
00022 virtual landmark_ptr_t createConverged(map_ptr_t mapPtr, landmark_ptr_t lmkinit, jblas::ind_array &_icomp) = 0;
00023 virtual size_t sizeComplement() = 0;
00024 virtual size_t sizeInit() = 0;
00025 };
00026
00027
00028 template<class LandmarkInit, class LandmarkConverged>
00029 class LandmarkFactory: public LandmarkFactoryAbstract
00030 {
00031 public:
00032 virtual landmark_ptr_t createInit(map_ptr_t mapPtr) {
00033 return boost::shared_ptr<LandmarkInit>(new LandmarkInit(mapPtr));
00034 }
00035 virtual landmark_ptr_t createConverged(map_ptr_t mapPtr) {
00036 return boost::shared_ptr<LandmarkConverged>(new LandmarkConverged(mapPtr));
00037 }
00038 virtual landmark_ptr_t createConverged(map_ptr_t mapPtr, landmark_ptr_t lmkinit, jblas::ind_array &_icomp) {
00039 return boost::shared_ptr<LandmarkConverged>(new LandmarkConverged(mapPtr, lmkinit, _icomp));
00040 }
00041 virtual size_t sizeInit() {
00042 return (LandmarkInit::size());
00043 }
00044 virtual size_t sizeComplement() {
00045 return (LandmarkInit::size() - LandmarkConverged::size());
00046 }
00047 };
00048
00049 }}
00050
00051 #endif // LANDMARKFACTORY_HPP