]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/blobdiff - api/bcar.h
Overload << for bicycle car
[hubacji1/bcar.git] / api / bcar.h
index bddb18945e410ea199314925653d273c1dbc2557..82c2672aea3a4cd87536854c3ca974425bb8b46c 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef BCAR_H
 #define BCAR_H
 
+#include <ostream>
+
 /*! \brief Bicycle car basic class.
 
 This class contains some geometrical computations of bicycle car.
@@ -142,6 +144,17 @@ class BicycleCar {
                 void st(double st) { this->st_ = st; }
 
                 BicycleCar();
+                friend std::ostream &operator<<(
+                        std::ostream &out,
+                        const BicycleCar &bc
+                )
+                {
+                        out << "[" << bc.x();
+                        out << "," << bc.y();
+                        out << "," << bc.h();
+                        out << "]";
+                        return out;
+                }
 };
 
 #endif /* BCAR_H */