From 581cfca84082620e55278c0c0074d1c178beb507 Mon Sep 17 00:00:00 2001
From: andreucm <acoromin@iri.upc.edu>
Date: Fri, 18 Nov 2016 11:34:48 +0100
Subject: [PATCH] Typedef Ptr defined for all CaptureX classes.

---
 src/capture_image.h                         | 2 +-
 src/capture_imu.h                           | 6 ++++++
 src/capture_laser_2D.h                      | 9 +++++++--
 src/capture_motion.h                        | 7 +++++++
 src/capture_void.h                          | 7 +++++++
 src/processor_tracker_feature_corner.cpp    | 2 +-
 src/processor_tracker_feature_corner.h      | 2 +-
 src/processor_tracker_landmark_corner.cpp   | 2 +-
 src/processor_tracker_landmark_corner.h     | 2 +-
 src/processor_tracker_landmark_polyline.cpp | 2 +-
 src/processor_tracker_landmark_polyline.h   | 2 +-
 11 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/src/capture_image.h b/src/capture_image.h
index 61c7d54aa..6c8fae652 100644
--- a/src/capture_image.h
+++ b/src/capture_image.h
@@ -17,7 +17,7 @@ namespace wolf {
 //forward declaration to typedef class pointers
 class CaptureImage;
 typedef std::shared_ptr<CaptureImage> CaptureImagePtr;
-typedef std::shared_ptr<const CaptureImage> CaptureImageConst;
+typedef std::shared_ptr<const CaptureImage> CaptureImageConstPtr;
 typedef std::weak_ptr<CaptureImage> CaptureImageWPtr;    
     
 /**
diff --git a/src/capture_imu.h b/src/capture_imu.h
index e07453c19..c4c6a6cd3 100644
--- a/src/capture_imu.h
+++ b/src/capture_imu.h
@@ -5,6 +5,12 @@
 #include "capture_motion.h"
 
 namespace wolf {
+    
+//forward declaration to typedef class pointers
+class CaptureIMU;
+typedef std::shared_ptr<CaptureIMU> CaptureIMUPtr;
+typedef std::shared_ptr<const CaptureIMU> CaptureIMUConstPtr;
+typedef std::weak_ptr<CaptureIMU> CaptureIMUWPtr;      
 
 class CaptureIMU : public CaptureMotion
 {
diff --git a/src/capture_laser_2D.h b/src/capture_laser_2D.h
index 6c0a406a4..c6ac10e07 100644
--- a/src/capture_laser_2D.h
+++ b/src/capture_laser_2D.h
@@ -16,10 +16,15 @@ class SensorLaser2D;
 
 namespace wolf {
 
+//forward declaration to typedef class pointers
+class CaptureLaser2D;
+typedef std::shared_ptr<CaptureLaser2D> CaptureLaser2DPtr;
+typedef std::shared_ptr<const CaptureLaser2D> CaptureLaser2DConstPtr;
+typedef std::weak_ptr<CaptureLaser2D> CaptureLaser2DWPtr;      
+    
+    
 class CaptureLaser2D : public CaptureBase
 {
-    public:
-        typedef std::shared_ptr<CaptureLaser2D> Ptr;
     public:
         /** \brief Constructor with ranges
          **/
diff --git a/src/capture_motion.h b/src/capture_motion.h
index 40ab0872f..bebdccbb7 100644
--- a/src/capture_motion.h
+++ b/src/capture_motion.h
@@ -19,6 +19,13 @@
 #include <utility>
 
 namespace wolf {
+    
+//forward declaration to typedef class pointers
+class CaptureMotion;
+typedef std::shared_ptr<CaptureMotion> CaptureMotionPtr;
+typedef std::shared_ptr<const CaptureMotion> CaptureMotionConst;
+typedef std::weak_ptr<CaptureMotion> CaptureMotionWPtr;      
+    
 
 /** \brief Base class for motion Captures.
  *
diff --git a/src/capture_void.h b/src/capture_void.h
index 1b0602fa1..1d50d88eb 100644
--- a/src/capture_void.h
+++ b/src/capture_void.h
@@ -7,6 +7,13 @@
 
 namespace wolf {
 
+//forward declaration to typedef class pointers
+class CaptureVoid;
+typedef std::shared_ptr<CaptureVoid> CaptureVoidPtr;
+typedef std::shared_ptr<const CaptureVoid> CaptureVoidConstPtr;
+typedef std::weak_ptr<CaptureVoid> CaptureVoidWPtr;      
+   
+    
 //class CaptureVoid
 class CaptureVoid : public CaptureBase
 {
diff --git a/src/processor_tracker_feature_corner.cpp b/src/processor_tracker_feature_corner.cpp
index 21214b1ea..0753102d1 100644
--- a/src/processor_tracker_feature_corner.cpp
+++ b/src/processor_tracker_feature_corner.cpp
@@ -117,7 +117,7 @@ ConstraintBasePtr ProcessorTrackerFeatureCorner::createConstraint(FeatureBasePtr
     return std::make_shared<ConstraintCorner2D>(_feature_ptr, landmark_ptr);
 }
 
-void ProcessorTrackerFeatureCorner::extractCorners(CaptureLaser2D::Ptr _capture_laser_ptr,
+void ProcessorTrackerFeatureCorner::extractCorners(CaptureLaser2DPtr _capture_laser_ptr,
                                                   FeatureBaseList& _corner_list)
 {
     // TODO: sort corners by bearing
diff --git a/src/processor_tracker_feature_corner.h b/src/processor_tracker_feature_corner.h
index a692b6f2c..6dca1193d 100644
--- a/src/processor_tracker_feature_corner.h
+++ b/src/processor_tracker_feature_corner.h
@@ -116,7 +116,7 @@ class ProcessorTrackerFeatureCorner : public ProcessorTrackerFeature
 
     private:
 
-        void extractCorners(CaptureLaser2D::Ptr _capture_laser_ptr, FeatureBaseList& _corner_list);
+        void extractCorners(CaptureLaser2DPtr _capture_laser_ptr, FeatureBaseList& _corner_list);
 
 };
 
diff --git a/src/processor_tracker_landmark_corner.cpp b/src/processor_tracker_landmark_corner.cpp
index 72bfc5b5e..b6cbe25e9 100644
--- a/src/processor_tracker_landmark_corner.cpp
+++ b/src/processor_tracker_landmark_corner.cpp
@@ -222,7 +222,7 @@ bool ProcessorTrackerLandmarkCorner::voteForKeyFrame()
     return false;
 }
 
-void ProcessorTrackerLandmarkCorner::extractCorners(CaptureLaser2D::Ptr _capture_laser_ptr,
+void ProcessorTrackerLandmarkCorner::extractCorners(CaptureLaser2DPtr _capture_laser_ptr,
                                                     FeatureBaseList& _corner_list)
 {
     // TODO: sort corners by bearing
diff --git a/src/processor_tracker_landmark_corner.h b/src/processor_tracker_landmark_corner.h
index 02e186005..66707e666 100644
--- a/src/processor_tracker_landmark_corner.h
+++ b/src/processor_tracker_landmark_corner.h
@@ -162,7 +162,7 @@ class ProcessorTrackerLandmarkCorner : public ProcessorTrackerLandmark
 
     private:
 
-        void extractCorners(CaptureLaser2D::Ptr _capture_laser_ptr, FeatureBaseList& _corner_list);
+        void extractCorners(CaptureLaser2DPtr _capture_laser_ptr, FeatureBaseList& _corner_list);
 
         void expectedFeature(LandmarkBasePtr _landmark_ptr, Eigen::Vector4s& expected_feature_,
                              Eigen::Matrix3s& expected_feature_cov_);
diff --git a/src/processor_tracker_landmark_polyline.cpp b/src/processor_tracker_landmark_polyline.cpp
index f4040138c..030cdd573 100644
--- a/src/processor_tracker_landmark_polyline.cpp
+++ b/src/processor_tracker_landmark_polyline.cpp
@@ -314,7 +314,7 @@ bool ProcessorTrackerLandmarkPolyline::voteForKeyFrame()
     return false;
 }
 
-void ProcessorTrackerLandmarkPolyline::extractPolylines(CaptureLaser2D::Ptr _capture_laser_ptr,
+void ProcessorTrackerLandmarkPolyline::extractPolylines(CaptureLaser2DPtr _capture_laser_ptr,
                                                         FeatureBaseList& _polyline_list)
 {
     //std::cout << "ProcessorTrackerLandmarkPolyline::extractPolylines: " << std::endl;
diff --git a/src/processor_tracker_landmark_polyline.h b/src/processor_tracker_landmark_polyline.h
index a8a033105..ce42dd936 100644
--- a/src/processor_tracker_landmark_polyline.h
+++ b/src/processor_tracker_landmark_polyline.h
@@ -185,7 +185,7 @@ class ProcessorTrackerLandmarkPolyline : public ProcessorTrackerLandmark
 
     private:
 
-        void extractPolylines(CaptureLaser2D::Ptr _capture_laser_ptr, FeatureBaseList& _polyline_list);
+        void extractPolylines(CaptureLaser2DPtr _capture_laser_ptr, FeatureBaseList& _polyline_list);
 
         void expectedFeature(LandmarkBasePtr _landmark_ptr, Eigen::MatrixXs& expected_feature_,
                              Eigen::MatrixXs& expected_feature_cov_);
-- 
GitLab