SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ContainerWriter.hpp
Go to the documentation of this file.
1 
9 #ifndef CONTAINERWRITER_HPP_
10 #define CONTAINERWRITER_HPP_
11 
12 #include <string>
13 
14 namespace slip{
15 
29 template<class Container, typename T>
31 public:
32 
33  typedef Container container_type;
34  typedef T value_type;
39 
44  :
46  {}
47 
53  ContainerWriter(std::string output_filename)
54  :
55  output_filename_(output_filename)
56  {}
57 
61  virtual ~ContainerWriter(){}
62 
72  const std::string& get_output_filename() const;
76  void set_output_filename(const std::string& output_filename);
85  virtual int write(const container_type & data) = 0;
86 
87 protected:
88 
89  std::string output_filename_;
90 };
91 
92 }
94 namespace slip {
95 
96 template<class Container, typename T>
97 inline
99  return output_filename_;
100 }
101 
102 template<class Container, typename T>
104  const std::string& output_filename) {
105  output_filename_ = output_filename;
106 }
107 
108 }
110 #endif /* CONTAINERWRITER_HPP_ */
virtual int write(const container_type &data)=0
virtual write function. This function write the data within the output file after the previous one...
ContainerWriter is the base class of the writer classes. All the writers are working the same way: ...
ContainerWriter(std::string output_filename)
const std::string & get_output_filename() const
return the output file name.
void set_output_filename(const std::string &output_filename)
set the output file name.