1 #ifndef SimTK_SimTKCOMMON_SERIALIZE_H_
2 #define SimTK_SimTKCOMMON_SERIALIZE_H_
74 template <
class T>
inline void
80 template <
class T>
inline void
82 { writeUnformatted<float>(o,v); }
84 template <
class T>
inline void
86 { writeUnformatted<double>(o,v); }
89 template <
class T>
inline void
91 { writeUnformatted<long double>(o,v); }
94 template <
class T>
inline void
100 template <
class T>
inline void
105 template <
class T>
inline void
113 template <
int M,
class E,
int S>
inline void
115 for (
int i=0; i < M; ++i) {
116 if (i != 0) o <<
" ";
123 template <
int N,
class E,
int S>
inline void
130 template <
int M,
int N,
class E,
int CS,
int RS>
inline void
132 for (
int i=0; i < M; ++i) {
133 if (i != 0) o << std::endl;
141 template <
int M,
class E,
int RS>
inline void
143 for (
int i=0; i < M; ++i) {
144 if (i != 0) o << std::endl;
173 if (!in.good()) {in.setstate(std::ios::failbit);
return false;}
176 if (!in.good()) {in.setstate(std::ios::failbit);
return false;}
177 in >> token;
if (in.fail())
return false;
178 if (token.empty()) {in.setstate(std::ios_base::failbit);
return false;}
187 template <
class T>
inline bool
192 { in.setstate(std::ios::failbit);
return false; }
197 template <
class T>
inline bool
199 {
return readUnformatted<float>(in,v); }
201 template <
class T>
inline bool
203 {
return readUnformatted<double>(in,v); }
206 template <
class T>
inline bool
208 {
return readUnformatted<long double>(in,v); }
211 template <
class T>
inline bool
219 template <
class T>
inline bool
229 template <
class T>
inline bool
237 template <>
inline bool
245 template <
int M,
class E,
int S>
inline bool
247 for (
int i=0; i < M; ++i)
255 template <
int N,
class E,
int S>
inline bool
261 template <
int M,
int N,
class E,
int CS,
int RS>
inline bool
263 for (
int i=0; i < M; ++i)
274 template <
int M,
class E,
int RS>
inline bool
278 in.setstate(std::ios::failbit);
311 template <
class T>
inline void
334 template <
class T>
inline bool
346 #endif // SimTK_SimTKCOMMON_SERIALIZE_H_