Commit bbeed7db authored by COULAUD Olivier's avatar COULAUD Olivier
Browse files

Add << operator

parent 34a5f212
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
// =================================================================================== // ===================================================================================
#ifndef FSPHERICAL_HPP #ifndef FSPHERICAL_HPP
#define FSPHERICAL_HPP #define FSPHERICAL_HPP
#include <iostream>
#include "FGlobal.hpp" #include "FGlobal.hpp"
#include "FMath.hpp" #include "FMath.hpp"
...@@ -108,6 +109,21 @@ public: ...@@ -108,6 +109,21 @@ public:
FReal getSinTheta() const{ FReal getSinTheta() const{
return sinTheta; return sinTheta;
} }
/**
* Operator stream FPoint to std::ostream
* This can be used to simpldata[1] write out a position
* @param[in,out] output where to write the position
* @param[in] inPosition the position to write out
* @return the output for multiple << operators
*/
template <class StreamClass>
friend StreamClass& operator<<(StreamClass& output, const FSpherical& inPosition){
output << "(" << inPosition.getR() << ", " << inPosition.getPhi() << ", " << inPosition.getTheta() <<")";
return output; // for multiple << operators.
}
}; };
#endif // FSPHERICAL_HPP #endif // FSPHERICAL_HPP
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment