Otawa  0.10
otawa::hard::RegBank Class Reference

This class represents a bank of registers. More...

#include <otawa/hard/Register.h>

Inheritance diagram for otawa::hard::RegBank:
otawa::hard::MeltedBank otawa::hard::PlainBank

Public Member Functions

elm::CString name (void) const
 Get the name of the bank. More...
 
Register::kind_t kind (void) const
 Get the kind of registers in the bank. More...
 
int size (void) const
 Get the size, in bits, of the registers in the bank. More...
 
int count (void) const
 Get the count of register in the bank. More...
 
Registerget (int index) const
 Get a register from the bank. More...
 
Registeroperator[] (int index) const
 Short to RegBank::get(). More...
 
const elm::genstruct::Table
< Register * > & 
registers () const
 

Protected Member Functions

 RegBank (elm::CString name, Register::kind_t kind, int size)
 Buil a new register bank. More...
 
 RegBank (elm::CString name, Register::kind_t kind, int size, int count)
 Buil a new register bank. More...
 
 ~RegBank (void)
 
void set (int index, Register *reg)
 

Protected Attributes

elm::CString _name
 
Register::kind_t _kind
 
int _size
 
elm::genstruct::AllocatedTable
< Register * > 
_regs
 

Friends

class Register
 

Detailed Description

This class represents a bank of registers.

Constructor & Destructor Documentation

otawa::hard::RegBank::RegBank ( elm::CString  name,
Register::kind_t  kind,
int  size 
)
protected

Buil a new register bank.

Parameters
nameName of the bank.
kindKind of register (may be NONE for melted bank).
sizeSize in bits of the register (may be -1 for melted bank).
otawa::hard::RegBank::RegBank ( elm::CString  name,
Register::kind_t  kind,
int  size,
int  count 
)
protected

Buil a new register bank.

Parameters
nameName of the bank.
kindKind of register (may be NONE for melted bank).
sizeSize in bits of the register (may be -1 for melted bank).
countCount of registers.
otawa::hard::RegBank::~RegBank ( void  )
inlineprotected

Member Function Documentation

int otawa::hard::RegBank::count ( void  ) const
inline

Get the count of register in the bank.

Returns
Bank registers count.

References _regs.

Referenced by otawa::hard::PlainBank::PlainBank(), and otawa::ResourceList::ResourceList().

Register * otawa::hard::RegBank::get ( int  number) const
inline

Get a register from the bank.

Parameters
numberNumber of the register to get.
Returns
Register matching the given number.

References _regs.

Register::kind_t otawa::hard::RegBank::kind ( void  ) const
inline

Get the kind of registers in the bank.

Returns
Bank register kind.

References _kind.

Referenced by otawa::hard::PlainBank::PlainBank().

elm::CString otawa::hard::RegBank::name ( void  ) const
inline

Get the name of the bank.

Returns
Bank name.

References _name.

Referenced by otawa::ResourceList::ResourceList().

Register * otawa::hard::RegBank::operator[] ( int  index) const
inline

Short to RegBank::get().

const elm::genstruct::Table<Register *>& otawa::hard::RegBank::registers ( ) const
inline

References _regs.

void otawa::hard::RegBank::set ( int  index,
Register reg 
)
inlineprotected
int otawa::hard::RegBank::size ( void  ) const
inline

Get the size, in bits, of the registers in the bank.

Returns
Bank register size.

References _size.

Referenced by otawa::hard::PlainBank::PlainBank().

Friends And Related Function Documentation

friend class Register
friend

Member Data Documentation

Register::kind_t otawa::hard::RegBank::_kind
protected

Referenced by kind().

elm::CString otawa::hard::RegBank::_name
protected

Referenced by name().

int otawa::hard::RegBank::_size
protected

Referenced by size().


The documentation for this class was generated from the following files: