Otawa  0.10
ProgItem.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * Copyright (c) 2005-07, IRIT UPS.
4  *
5  * ProgItem class interface
6  */
7 #ifndef OTAWA_PROG_PROG_ITEM_H
8 #define OTAWA_PROG_PROG_ITEM_H
9 
10 #include <elm/assert.h>
11 #include <elm/string.h>
12 #include <elm/inhstruct/DLList.h>
13 #include <otawa/base.h>
14 #include <otawa/properties.h>
15 
16 namespace otawa {
17 
18 // Extern classes
19 class Inst;
20 class Segment;
21 
22 // ProgItem class
23 class ProgItem: public PropList, protected inhstruct::DLNode {
24 
25 public:
26  ProgItem *next(void) const;
27  ProgItem *previous(void) const;
28  virtual address_t address(void) const = 0;
29  virtual t::uint32 size(void) const = 0;
30  inline address_t topAddress(void) const { return address() + size(); }
31  virtual Inst *toInst(void);
32 
33 protected:
34  friend class Segment;
35  virtual ~ProgItem(void);
36  inline void insertPseudo(ProgItem *pos)
37  { pos->insertBefore(this); }
38 };
39 
40 } // otawa
41 
42 #endif // OTAWA_PROG_PROG_ITEM_H
void insertPseudo(ProgItem *pos)
Definition: ProgItem.h:36
ProgItem * next(void) const
Get the next program item.
Definition: prog_ProgItem.cpp:44
In usual file format like ELF, COFF and so on, the program file is divided in segment according platf...
Definition: Segment.h:40
virtual Inst * toInst(void)
Return the instruction matching the current item.
Definition: prog_ProgItem.cpp:95
address_t topAddress(void) const
Compute the address of the item immediately following the current item.
Definition: ProgItem.h:30
ProgItem * previous(void) const
Get the previous program item.
Definition: prog_ProgItem.cpp:57
The representation of an address in OTAWA.
Definition: base.h:54
virtual address_t address(void) const =0
Get the address of the item .
virtual t::uint32 size(void) const =0
Get the size of the item in bytes.
This class represents assembly instruction of a piece of code.
Definition: Inst.h:62
This a list of properties.
Definition: PropList.h:63
Base class of the components of a program file segment.
Definition: ProgItem.h:23
void insertBefore(DLNode *node)
virtual ~ProgItem(void)
Protected destructor for avoiding implementation unexpected deletion.
Definition: prog_ProgItem.cpp:36
uint32_t uint32