ROBOOP, A Robotics Object Oriented Package in C++
IO_matrix_file Class Reference

Read and write data at every iterations in a file. More...

#include <gnugraph.h>

Inheritance diagram for IO_matrix_file:
Plot_file

Public Member Functions

 IO_matrix_file (const std::string &filename)
 Constructor.
 
short write (const std::vector< Matrix > &data)
 
short write (const std::vector< Matrix > &data, const std::vector< std::string > &title)
 
short read (std::vector< Matrix > &data)
 
short read (std::vector< Matrix > &data, std::vector< std::string > &title)
 
short read_all (std::vector< Matrix > &data, std::vector< std::string > &data_title)
 Reads all sequences of data. More...
 

Private Attributes

int position_read
 Position to read the file.
 
int nb_iterations_write
 Number of iterations in writing mode.
 
int nb_iterations_read
 Number of iterations in reading mode.
 
int nb_element
 Number of elements to read or write.
 
std::string filename
 File name.
 

Detailed Description

Read and write data at every iterations in a file.

Definition at line 197 of file gnugraph.h.

Member Function Documentation

short IO_matrix_file::read_all ( std::vector< Matrix > &  data,
std::vector< std::string > &  data_title 
)

Reads all sequences of data.

If the file "filename does not exist yet, created it and fill the first line with the number of rows and columns for each element of "data". ex: 6x1;3x1;3x3; This line indidate that data has 3 elements Matrix. The first one has 6 rows and 1 columns, the second one has 3 rows and 1 columns ...

Definition at line 627 of file gnugraph.cpp.

References filename, nb_element, and nb_iterations_read.

Referenced by Plot_file::Plot_file().