vnl_xio_vector.h
Go to the documentation of this file.
1 // This is core/vnl/xio/vnl_xio_vector.h
2 #ifndef vnl_xio_vector_h
3 #define vnl_xio_vector_h
4 //:
5 // \file
6 // \brief XML write a vnl_vector
7 // Two functions which write a valid XML fragment to an ostream.
8 // The vector length is output as an attribute of the (top) node.
9 // - x_write() writes a single XML element node with text content only:
10 // space-separated coordinates.
11 // - x_write_tree() writes a 2-level XML fragment: one top element node,
12 // and one level below it for the individual vector elements
13 // (element nodes named "element" with a single value each).
14 // The name of the top node can be chosen; by default, it is "vnl_vector".
15 // \author Gamze Tunali
16 // \date 30-Dec-2005
17 // \verbatim
18 // Modifications
19 // 29 July 2011 - Peter Vanroose - added documentation, tests, and x_write_tree()
20 // \endverbatim
21 
22 #include <string>
23 #include <iosfwd>
24 #include <vnl/vnl_vector.h>
25 #ifdef _MSC_VER
26 # include <vcl_msvc_warnings.h>
27 #endif
28 
29 //: XML save vnl_vector to stream.
30 // \relatesalso vnl_vector
31 template <class T>
32 void x_write(std::ostream & os, vnl_vector<T> const& v,
33  std::string name="vnl_vector");
34 
35 //: XML save vnl_vector as a 2-level tree to stream.
36 // \relatesalso vnl_vector
37 template <class T>
38 void x_write_tree(std::ostream & os, vnl_vector<T> const& v,
39  std::string name="vnl_vector");
40 
41 #define VNL_XIO_VECTOR_INSTANTIATE(T) extern "Please #include <vnl/xio/vnl_xio_vector.hxx> first"
42 
43 #endif // vnl_xio_vector_h
void VNL_EXPORT x_write_tree(std::ostream &os, vnl_matrix< T > const &v, std::string name="vnl_matrix")
XML save vnl_matrix as a 3-level tree to stream.
#define v
Definition: vnl_vector.h:42
Mathematical vector class, templated by type of element.
Definition: vnl_fwd.h:16
void VNL_EXPORT x_write(std::ostream &os, vnl_matrix< T > const &v, std::string name="vnl_matrix")
XML save vnl_matrix to stream.