@@ -20,8 +20,8 @@ class StampPoint3D: public StampBaseStr, public StampBaseV<Point3D>
2020 public:
2121 virtual int minSize () override ;
2222 virtual int maxSize () override ;
23- virtual std::string ExtractStr (Blob & blob) override ;
24- virtual Point3D ExtractValue (Blob & blob) override ;
23+ virtual std::string ExtractStr (std::shared_ptr< Blob> blob) override ;
24+ virtual Point3D ExtractValue (std::shared_ptr< Blob> blob) override ;
2525};
2626
2727int StampPoint3D::minSize ()
@@ -31,10 +31,10 @@ int StampPoint3D::minSize()
3131
3232int StampPoint3D::maxSize ()
3333{
34- return stampX.maxSize () + stampY.maxSize () + stampZ.maxSize ();
34+ return stampX.maxSize () + stampY.maxSize () + stampZ.maxSize ();
3535}
3636
37- std::string StampPoint3D::ExtractStr (Blob & blob)
37+ std::string StampPoint3D::ExtractStr (std::shared_ptr< Blob> blob)
3838{
3939 std::string X,Y,Z;
4040 X = stampX.ExtractStr (blob);
@@ -43,7 +43,7 @@ std::string StampPoint3D::ExtractStr(Blob &blob)
4343 return " (" + X + " , " + Y + " , " + Z + " )" ;
4444}
4545
46- Point3D StampPoint3D::ExtractValue (Blob & blob)
46+ Point3D StampPoint3D::ExtractValue (std::shared_ptr< Blob> blob)
4747{
4848 Point3D res;
4949 res.X = stampX.ExtractValue (blob);
@@ -55,17 +55,13 @@ Point3D StampPoint3D::ExtractValue(Blob &blob)
5555
5656class StampPolyLine3D : public GalleyVectorStr , public StampBaseStr
5757{
58- protected:
59- StampPoint3D * item_stamp_p;
6058 public:
61- StampPolyLine3D (): GalleyVectorStr(*(item_stamp_p = new StampPoint3D())) {};
62- ~StampPolyLine3D () {delete item_stamp_p;};
63-
64- virtual std::string ExtractStr (Blob &blob) override ;
59+ StampPolyLine3D (): GalleyVectorStr(std::make_shared<StampPoint3D>()) {};
60+ virtual std::string ExtractStr (std::shared_ptr<Blob> blob) override ;
6561};
6662
6763
68- std::string StampPolyLine3D::ExtractStr (Blob & blob)
64+ std::string StampPolyLine3D::ExtractStr (std::shared_ptr< Blob> blob)
6965{
7066 std::vector<std::string> data = ExtractStrVector (blob);
7167 std::string res = " " ;
@@ -85,7 +81,7 @@ std::string StampPolyLine3D::ExtractStr(Blob &blob)
8581int main ()
8682{
8783 char data[] = " abcdef" " abcdef" " ABCDEF" " 012345" ;
88- Blob blob (data, strlen (data));
84+ auto blob = std::make_shared<Blob> (data, strlen (data));
8985 StampPolyLine3D stamp;
9086
9187 std::string s = stamp.ExtractStr (blob);
0 commit comments