OpenASIP
2.0
src
tools
Options.hh
Go to the documentation of this file.
1
/*
2
Copyright (c) 2002-2009 Tampere University.
3
4
This file is part of TTA-Based Codesign Environment (TCE).
5
6
Permission is hereby granted, free of charge, to any person obtaining a
7
copy of this software and associated documentation files (the "Software"),
8
to deal in the Software without restriction, including without limitation
9
the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
and/or sell copies of the Software, and to permit persons to whom the
11
Software is furnished to do so, subject to the following conditions:
12
13
The above copyright notice and this permission notice shall be included in
14
all copies or substantial portions of the Software.
15
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
DEALINGS IN THE SOFTWARE.
23
*/
24
/**
25
* @file Options.hh
26
*
27
* Declaration of Options class.
28
*
29
* @author Jari Mäntyneva 2005 (jari.mantyneva-no.spam-tut.fi)
30
* @note rating: red
31
*/
32
33
#ifndef TTA_OPTIONS_HH
34
#define TTA_OPTIONS_HH
35
36
#include <string>
37
#include <map>
38
#include <vector>
39
40
#include "
Exception.hh
"
41
42
class
OptionValue
;
43
44
using
std::map;
45
using
std::string;
46
using
std::vector;
47
48
/**
49
* Generic container of option values.
50
*/
51
class
Options
{
52
public
:
53
Options
();
54
virtual
~Options
();
55
void
addOptionValue
(
const
string
& name,
OptionValue
* option);
56
57
// index for lists of options
58
OptionValue
&
optionValue
(
const
string
& name,
int
index = 0);
59
int
valueCount
(
const
string
& name);
60
61
private
:
62
map<string, vector<OptionValue*> >
options_
;
63
};
64
65
#endif
Options
Definition:
Options.hh:51
Exception.hh
Options::optionValue
OptionValue & optionValue(const string &name, int index=0)
Definition:
Options.cc:115
Options::options_
map< string, vector< OptionValue * > > options_
Definition:
Options.hh:62
Options::~Options
virtual ~Options()
Definition:
Options.cc:57
Options::addOptionValue
void addOptionValue(const string &name, OptionValue *option)
Definition:
Options.cc:78
Options::valueCount
int valueCount(const string &name)
Definition:
Options.cc:134
OptionValue
Definition:
OptionValue.hh:51
Options::Options
Options()
Definition:
Options.cc:51
Generated by
1.8.17