[go: up one dir, main page]

Menu

[r201]: / mia2 / mia / core / history.hh  Maximize  Restore  History

Download this file

65 lines (52 with data), 1.9 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* -*- mia-c++ -*-
* Copyright (c) 2004
* Max-Planck-Institute for Human Cognitive and Brain Science
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
// $Id: miaHistory.hh 937 2006-07-11 11:56:52Z write1 $
#ifndef HISTORY_HH
#define HISTORY_HH
#include <list>
#include <string>
#include <map>
#include <vector>
#include <mia/core/cmdopt.hh>
NS_MIA_BEGIN
/** holds the history infor of a certain program call */
typedef std::map<std::string, std::string> CHistoryRecord;
/** holds the name of the program and the associated history record */
typedef std::pair<std::string, CHistoryRecord> CHistoryEntry;
/** This class holds the complete history list of a data set */
class CHistory: public std::list<CHistoryEntry> {
public:
/** append a new history record
\param program name of the calling program
\param version version of the program run
*/
void append(const std::string& program, const std::string& version, const popt::COptions& options,
const std::vector<std::string> *extra=NULL);
/**
\returns the complete history as a string.
*/
std::string as_string()const;
/** returns the reference to the singelton history object */
static CHistory& instance();
private:
CHistory();
};
NS_MIA_END
#endif