Dip
0.92.4
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
tmp
Dip-0.92.4
Dip
src
old
UtilParameters.h
Go to the documentation of this file.
1
//===========================================================================//
2
// This file is part of the Decomp Solver Framework. //
3
// //
4
// Decomp is distributed under the Common Public License as part of the //
5
// COIN-OR repository (http://www.coin-or.org). //
6
// //
7
// Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8
// //
9
// Copyright (C) 2002-2007, Lehigh University, Matthew Galati, and Ted Ralphs//
10
// All Rights Reserved. //
11
//===========================================================================//
12
13
#ifndef UTIL_PARAMETERS_INCLUDED
14
#define UTIL_PARAMETERS_INCLUDED
15
16
//===========================================================================//
17
#include <map>
18
#include <string>
19
#include <fstream>
20
using namespace
std;
21
22
//===========================================================================//
23
struct
UtilParamT
{
24
string
paramName
;
25
bool
isUsed
;
//is used in code (a call to getSetting)?
26
};
27
typedef
struct
UtilParamT
UtilParam
;
28
29
//===========================================================================//
30
class
UtilParameters
{
31
private
:
32
UtilParameters
(
const
UtilParameters
& copy);
33
UtilParameters
& operator=(
const
UtilParameters
& rhs);
34
35
private
:
36
map<string, UtilParam>
m_paramMap
;
37
38
public
:
39
UtilParameters
()
40
: m_paramMap() {}
41
42
UtilParameters
(
int
& argc,
43
char
* argv[]) :
44
m_paramMap() {
45
ScanCmdLineArgs(argc, argv);
46
};
47
48
~UtilParameters
() {};
49
50
void
ScanCmdLineArgs(
int
& argc,
51
char
* argv[]);
52
void
LoadParamFile(
string
& paramFileName);
53
void
Add(
string
& section,
54
string
& name,
55
string
& value);
56
void
Add(
const
char
* section,
57
const
char
* name,
58
const
char
* value);
59
string
GetSetting(
const
char
* name,
60
const
char
* defaultValue,
61
const
char
* section = NULL);
62
int
GetSetting(
const
char
* name,
63
const
int
defaultValue,
64
const
char
* section = NULL);
65
bool
GetSetting(
const
char
* name,
66
const
bool
defaultValue,
67
const
char
* section = NULL);
68
long
GetSetting(
const
char
* name,
69
const
long
defaultValue,
70
const
char
* section = NULL);
71
double
GetSetting(
const
char
* name,
72
const
double
defaultValue,
73
const
char
* section = NULL);
74
75
private
:
76
UtilParam
* FindEntry(
const
char
* section,
77
const
char
* name);
78
string
* Find(
const
char
* section,
79
const
char
* name);
80
};
81
82
#endif
UtilParameters
Definition:
UtilParameters.h:30
UtilParameters::UtilParameters
UtilParameters(int &argc, char *argv[])
Definition:
UtilParameters.h:42
UtilParameters::UtilParameters
UtilParameters()
Definition:
UtilParameters.h:39
UtilParamT::paramName
string paramName
Definition:
UtilParameters.h:24
UtilParameters::~UtilParameters
~UtilParameters()
Definition:
UtilParameters.h:48
UtilParamT
Definition:
UtilParameters.h:23
UtilParamT::isUsed
bool isUsed
Definition:
UtilParameters.h:25
UtilParameters::m_paramMap
map< string, UtilParam > m_paramMap
Definition:
UtilParameters.h:36
Generated by
1.8.5