Otawa  0.10
AddressOption.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * AddressOption class interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2010, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef OTAWA_APP_ADDRESSOPTION_H_
23 #define OTAWA_APP_ADDRESSOPTION_H_
24 
25 #include <otawa/base.h>
26 #include <elm/option/ValueOption.h>
27 
28 namespace otawa {
29 
30 using namespace elm;
31 
32 // AddressOption class
34 public:
35  AddressOption(option::Manager &manager, char short_name, cstring description, Address def = Address::null);
36  AddressOption(option::Manager &manager, cstring long_name, cstring description, Address def = Address::null);
37  AddressOption(option::Manager &manager, char short_name, cstring long_name, cstring description, Address def = Address::null);
38  AddressOption(const Make& make, Address def = Address::null): option::AbstractValueOption(make), addr(def) { }
39 
40  inline Address address(void) const { return addr; }
41  inline Address operator*(void) const { return addr; }
42 
43  // option::Option overload
44  virtual option::usage_t usage(void);
45  virtual cstring argDescription(void);
46  virtual void process(string arg);
47 
48 private:
50 };
51 
52 } // otawa
53 
54 #endif /* OTAWA_APP_ADDRESSOPTION_H_ */
AddressOption(const Make &make, Address def=Address::null)
Definition: AddressOption.h:38
Address addr
Definition: AddressOption.h:49
An option allowing to read an address, currently, only an unsigned decimal, hexadecimal and so one va...
Definition: AddressOption.h:33
The representation of an address in OTAWA.
Definition: base.h:54
Address operator*(void) const
Definition: AddressOption.h:41
Property * make(const Identifier< T > &id, const T &v)
Definition: info.h:31
static Address null
Null address.
Definition: base.h:58
Address address(void) const
Get the address contained in the option.
Definition: AddressOption.h:40