For some reason the following class (or any like it) will not import. No errors are given, but no class is created by EA on import. I tried commenting out the fwd declarations of the class and friend, as well as the method implementations, to no avail. I tried generating from an identically named class first and then syncing, no good.
Thanks
#ifndef CORESIM_IO_POINT_H_INCLUDED
#define CORESIM_IO_POINT_H_INCLUDED
#include "Osal/Osal.h"
#include <iostream>
#include <vector>
namespace CoreSim
{
namespace Io
{
// This is a forward declaration of the class so that we can declare the friend
// function. Don't use doxygen tags for these 2 here.
template<class X, class Y>
class Point;
// Forward declaration for the friend function.
template<class X, class Y>
std::ostream &operator<< (std::ostream& output,
const CoreSim::Io::Point<X, Y>& rhs);
/** Point class. Represents a tuple of values, which can be scalar or vector
* (or any type since this is a template class).
*/
template <class X, class Y>
class Point
{
public:
/** Constructor.
* @param x Initial value for X coordinate.
* @param y Initial value for Y coordinate.
*/
Point (X x, Y y);
/** Constructor. */
Point ();
/** Destructor. */
virtual ~Point();
/** Accessor returns X
* @return Value of X.
*/
inline X getX();
/** Accessor sets X.
* @param x New value of x.
*/
inline void setX (X x);
/** Accessor returns Y
* @return Value of Y.
*/
inline Y getY();
/** Accessor sets Y.
* @param y New value of y.
*/
inline void setY (Y y);
/** Override the stream insertion operator so we can print the contents.
* @return The output stream.
* @param output Reference to the output stream.
* @param rhs Right hand side of the stream insertion operator.
*/
friend std::ostream &operator<< <> (std::ostream& output,
const CoreSim::Io::Point<X, Y>& rhs);
protected:
/** X coordinate. */
X m_x;
/** Y coordinate. */
Y m_y;
};
/********************** Method implementations. ***********************/
template <class X, class Y>
Point<X,Y>::Point (X x, Y y)
: m_x(x),
m_y(y)
{}
template <class X, class Y>
Point<X,Y>::Point ()
{}
template <class X, class Y>
Point<X,Y>::~Point()
{}
template <class X, class Y>
inline X Point<X,Y>::getX()
{
return m_x;
}
template <class X, class Y>
inline void Point<X,Y>::setX (X x)
{
m_x = x;
}
template <class X, class Y>
inline Y Point<X,Y>::getY()
{
return m_y;
}
template <class X, class Y>
inline void Point<X,Y>::setY (Y y)
{
m_y = y;
}
template <class X, class Y>
std::ostream &operator<<(std::ostream& output,
const CoreSim::Io::Point<X, Y>& rhs)
{
output << rhs.m_x << ", " << rhs.m_y << std::endl;
return output;
}
}
}
#endif