source: trunk/se/lu/thep/wenni/base/base1/BaseFileConverter/Data.h @ 594

Last change on this file since 594 was 594, checked in by Jari Häkkinen, 13 years ago

Improved memory usage of BaseFileConverter?. Previous implementation was not flattering.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#ifndef _theplu_wenni_basefileconverter_data_
2#define _theplu_wenni_basefileconverter_data_
3
4// $Id: Data.h 594 2008-02-26 14:24:46Z jari $
5
6/*
7  Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2008 Jari Häkkinen
9
10  This file is part of WeNNI,
11  http://lev.thep.lu.se/trac/baseplugins/wiki/WeNNI
12
13  WeNNI is free software; you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation; either version 2 of the License, or
16  (at your option) any later version.
17
18  WeNNI is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
21  License for more details.
22
23  You should have received a copy of the GNU General Public License
24  along with this program; if not, write to the Free Software
25  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26  02111-1307, USA.
27*/
28
29#include <iosfwd>
30#include <string>
31#include <vector>
32
33namespace BASE {
34  class BaseFileSection;
35}
36
37namespace theplu {
38namespace wenni {
39
40  class Data
41  {
42  public:
43    Data(BASE::BaseFileSection&,const std::string&, const std::string&);
44
45    ~Data(void);
46
47    void push_back(const std::vector<std::string>&);
48
49    inline int total_nof_columns(void) { return total_nof_columns_; }
50
51    void write(const std::vector<std::string>&);
52
53    void write_matrix(void);
54
55  private:
56    int column_number_;
57    int column_offset_;
58    int total_nof_columns_;
59    int nof_assays_;
60    int nof_fields_per_assay_;
61    std::string column_name_;
62    std::string output_file_;
63
64    std::ofstream* os_;
65  };
66
67}} // of namespace wenni and namespace theplu
68
69#endif
Note: See TracBrowser for help on using the repository browser.