One possibility would be to overload the << operator for ostream in the class as a friend. This would allow you to simply output the class with std::cout.
class MyClass {
public:
friend std::ostream& operator<<(std::ostream& os, class MyClass& m)
{
return os;
}
};
//Edit:
If you want to output a vector with classes you can first use the suggestion for the member variables from your class. Since it is not known how the class looks like it is not possible to say how this works in detail. After that an overload for ostream is also necessary for the output of the vector. Instead of putting the overload in the class you could also write a function or a template for the operator. In any case the operator << should output the data as ostream. By the way, you can also copy() the elements of a vector into the stream instead of writing a loop for it yourself.