Otawa  0.10
otawa::hard::Platform::Identification Class Reference

#include <otawa/hard/Platform.h>

Public Member Functions

 Identification (const elm::String &name)
 Build a platform identifier from a string. More...
 
 Identification (const elm::String &arch, const elm::String &abi, const elm::String &mach=ANY)
 Build an explicit platform identifier. More...
 
const elm::Stringname (void) const
 Get the full name of the identification. More...
 
const elm::Stringarchitecture (void) const
 Get the architecture component of the platform identifier. More...
 
const elm::Stringabi (void) const
 Get the ABI component of the platform identifier. More...
 
const elm::Stringmachine (void) const
 Get the machine component of the platform identifier. More...
 
bool matches (const Identification &id)
 Check if the current identification matches the given one. More...
 
Identificationoperator= (const Identification &id)
 Copy the given identification in the current one. More...
 
void print (io::Output &out) const
 Display the identification. More...
 

Private Member Functions

void split (void)
 Split the platform name into its components. More...
 

Private Attributes

elm::String _name
 
elm::String _arch
 
elm::String _abi
 
elm::String _mach
 

Detailed Description

This class represents a platform identification that is composed by:

  • architecture: processor family like 'x86', 'powerpc', 'arm', ... possibly followed by the exact model : i586, arm7, ...
  • ABI or Application Binary Interface that defines the encoding of binary and system call protocol like 'elf' or 'coff' followed by the version of the running system "linux2.2", "linux2.4", ...
  • machine that gives information about the hardware configuration of the system, for example, 'pcat' or 'sim' for simulator.

Each component may be datailed by one or many sub-components separated by '/' slashes. For example, a full description of a classic executable environment on Linux may be: 'x86/i586-elf/linux/libc2.4-pcat'.

Constructor & Destructor Documentation

otawa::hard::Platform::Identification::Identification ( const elm::String name)

Build a platform identifier from a string.

Parameters
nameName of the platform.

References split().

otawa::hard::Platform::Identification::Identification ( const elm::String arch,
const elm::String abi,
const elm::String mach = ANY 
)

Build an explicit platform identifier.

Parameters
archArchietcture.
abiABI.
machMachine.

Member Function Documentation

const elm::String & otawa::hard::Platform::Identification::abi ( void  ) const
inline

Get the ABI component of the platform identifier.

Returns
ABI component.

Referenced by otawa::hard::Platform::accept().

const elm::String & otawa::hard::Platform::Identification::architecture ( void  ) const
inline

Get the architecture component of the platform identifier.

Returns
Architecture component.

References _arch.

Referenced by otawa::hard::Platform::accept().

const elm::String & otawa::hard::Platform::Identification::machine ( void  ) const
inline

Get the machine component of the platform identifier.

Returns
Machine component.

Referenced by otawa::hard::Platform::accept().

bool otawa::hard::Platform::Identification::matches ( const Identification id)

Check if the current identification matches the given one.

Note that the "*" "any" identity is used only by the current identification. Matching is also performed by prefix. For example, an identification "xxx" in the current identification matches a "xxx/yyy" in the given identification.

Returns
True if both identification matches, false else.

References otawa::hard::Platform::ANY.

const elm::String & otawa::hard::Platform::Identification::name ( void  ) const
inline

Get the full name of the identification.

Returns
Identification name.
Platform::Identification & otawa::hard::Platform::Identification::operator= ( const Identification id)

Copy the given identification in the current one.

Parameters
idCopied identification.
Returns
Current identification.

References _name.

void otawa::hard::Platform::Identification::print ( io::Output out) const

Display the identification.

Parameters
outUsed output.

References name.

void otawa::hard::Platform::Identification::split ( void  )
private

Split the platform name into its components.

References _abi, _arch, _mach, _name, otawa::hard::Platform::ANY, elm::String::indexOf(), elm::String::length(), and elm::String::substring().

Referenced by Identification().

Member Data Documentation

elm::String otawa::hard::Platform::Identification::_abi
private

Referenced by split().

elm::String otawa::hard::Platform::Identification::_arch
private

Referenced by architecture(), and split().

elm::String otawa::hard::Platform::Identification::_mach
private

Referenced by split().

elm::String otawa::hard::Platform::Identification::_name
private

Referenced by operator=(), and split().


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