Phoenix
Object-oriented orthogonally persistent operating system
Public Member Functions
vm::Addr< AddrType > Class Template Reference

Class representing generic address of the VM subsystem. More...

#include <vm.h>

List of all members.

Public Member Functions

 Addr (AddrType addr=0)
 Construct VM address from VM address integer type.
template<typename T >
 Addr (T addr)
 Construct VM address from any integer type.
template<typename T >
 Addr (T *ptr)
 Construct VM address from pointer type.
Addroperator= (AddrType addr)
 Assign address value to VM address.
Addroperator= (void *ptr)
 Assign pointer value to VM address.
Addroperator+= (const Addr &addr)
 Add another VM address to the current one.
Addroperator+= (const AddrType addr)
 Add another VM address to the current one.
Addroperator-= (const Addr &addr)
 Subtract another VM address from the current one.
Addroperator-= (const AddrType addr)
 Subtract another VM address from the current one.
bool operator== (const Addr &addr)
 Compare VM addresses.
bool operator== (void *ptr)
 Compare VM addresses.
bool operator== (AddrType addr)
 Compare VM addresses.
bool operator== (int addr)
 Compare VM addresses.
bool operator!= (const Addr &addr)
 Compare VM addresses.
bool operator!= (void *ptr)
 Compare VM addresses.
bool operator!= (AddrType addr)
 Compare VM addresses.
bool operator!= (int addr)
 Compare VM addresses.
bool operator< (Addr &addr)
 Compare VM addresses.
template<typename T >
bool operator< (T addr)
 Compare VM addresses.
bool operator<= (Addr &addr)
 Compare VM addresses.
template<typename T >
bool operator<= (T addr)
 Compare VM addresses.
bool operator> (Addr &addr)
 Compare VM addresses.
template<typename T >
bool operator> (T addr)
 Compare VM addresses.
bool operator>= (Addr &addr)
 Compare VM addresses.
template<typename T >
bool operator>= (T addr)
 Compare VM addresses.
Addr operator+ (Addr &addr)
 Sum VM addresses.
template<typename T >
Addr operator+ (T addr)
 Sum VM addresses.
Addr operator- (Addr &addr)
 Subtract VM addresses.
template<typename T >
Addr operator- (T addr)
 Subtract VM addresses.
 operator AddrType ()
 Cast VM address value to base address type.
AddrType BaseAddr ()
 Return VM address base type value.
 operator void * ()
 Cast VM address value to a generic pointer.
template<typename T >
 operator T * ()
 Cast VM address value to a pointer of specified type.
AddrRoundUp (AddrType alignment=PAGE_SIZE)
 Round up VM address.
AddrRoundDown (AddrType alignment=PAGE_SIZE)
 Round down VM address.
bool IsAligned (AddrType alignment=PAGE_SIZE)
 Check if the address aligned to specified alignment value.
PageIdx GetPageIdx ()
 Get page index which corresponds to a given virtual address.
vaddr_t GetPageOffset ()
 Get offset in the page which corresponds to a given virtual address.
bool CheckFmtChar (char fmtChar)
 Support for converting this class to string via text_stream::OTextStream.
bool ToString (text_stream::OTextStreamBase &stream, text_stream::OTextStreamBase::Context &ctx, char fmtChar=0)
 Support for converting this class to string via text_stream::OTextStream.

Detailed Description

template<typename AddrType>
class vm::Addr< AddrType >

Class representing generic address of the VM subsystem.


Constructor & Destructor Documentation

template<typename AddrType>
vm::Addr< AddrType >::Addr ( AddrType  addr = 0) [inline]

Construct VM address from VM address integer type.

template<typename AddrType>
template<typename T >
vm::Addr< AddrType >::Addr ( addr) [inline]

Construct VM address from any integer type.

template<typename AddrType>
template<typename T >
vm::Addr< AddrType >::Addr ( T *  ptr) [inline]

Construct VM address from pointer type.


Member Function Documentation

template<typename AddrType>
AddrType vm::Addr< AddrType >::BaseAddr ( ) [inline]

Return VM address base type value.

template<typename AddrType>
bool vm::Addr< AddrType >::CheckFmtChar ( char  fmtChar) [inline]

Support for converting this class to string via text_stream::OTextStream.

template<typename AddrType>
PageIdx vm::Addr< AddrType >::GetPageIdx ( ) [inline]

Get page index which corresponds to a given virtual address.

template<typename AddrType>
vaddr_t vm::Addr< AddrType >::GetPageOffset ( ) [inline]

Get offset in the page which corresponds to a given virtual address.

template<typename AddrType>
bool vm::Addr< AddrType >::IsAligned ( AddrType  alignment = PAGE_SIZE) [inline]

Check if the address aligned to specified alignment value.

Parameters:
alignmentAlignment value, must be power of two.
Returns:
true if address if aligned, false otherwise.
template<typename AddrType>
vm::Addr< AddrType >::operator AddrType ( ) [inline]

Cast VM address value to base address type.

template<typename AddrType>
vm::Addr< AddrType >::operator void * ( ) [inline]

Cast VM address value to a generic pointer.

template<typename AddrType>
bool vm::Addr< AddrType >::operator!= ( void *  ptr) [inline]

Compare VM addresses.

template<typename AddrType>
bool vm::Addr< AddrType >::operator!= ( AddrType  addr) [inline]

Compare VM addresses.

template<typename AddrType>
bool vm::Addr< AddrType >::operator!= ( const Addr< AddrType > &  addr) [inline]

Compare VM addresses.

template<typename AddrType>
bool vm::Addr< AddrType >::operator!= ( int  addr) [inline]

Compare VM addresses.

template<typename AddrType>
Addr vm::Addr< AddrType >::operator+ ( Addr< AddrType > &  addr) [inline]

Sum VM addresses.

template<typename AddrType>
template<typename T >
Addr vm::Addr< AddrType >::operator+ ( addr) [inline]

Sum VM addresses.

template<typename AddrType>
Addr& vm::Addr< AddrType >::operator+= ( const Addr< AddrType > &  addr) [inline]

Add another VM address to the current one.

template<typename AddrType>
Addr& vm::Addr< AddrType >::operator+= ( const AddrType  addr) [inline]

Add another VM address to the current one.

template<typename AddrType>
Addr vm::Addr< AddrType >::operator- ( Addr< AddrType > &  addr) [inline]

Subtract VM addresses.

template<typename AddrType>
template<typename T >
Addr vm::Addr< AddrType >::operator- ( addr) [inline]

Subtract VM addresses.

template<typename AddrType>
Addr& vm::Addr< AddrType >::operator-= ( const AddrType  addr) [inline]

Subtract another VM address from the current one.

template<typename AddrType>
Addr& vm::Addr< AddrType >::operator-= ( const Addr< AddrType > &  addr) [inline]

Subtract another VM address from the current one.

template<typename AddrType>
template<typename T >
bool vm::Addr< AddrType >::operator< ( addr) [inline]

Compare VM addresses.

template<typename AddrType>
bool vm::Addr< AddrType >::operator< ( Addr< AddrType > &  addr) [inline]

Compare VM addresses.

template<typename AddrType>
bool vm::Addr< AddrType >::operator<= ( Addr< AddrType > &  addr) [inline]

Compare VM addresses.

template<typename AddrType>
template<typename T >
bool vm::Addr< AddrType >::operator<= ( addr) [inline]

Compare VM addresses.

template<typename AddrType>
Addr& vm::Addr< AddrType >::operator= ( void *  ptr) [inline]

Assign pointer value to VM address.

template<typename AddrType>
Addr& vm::Addr< AddrType >::operator= ( AddrType  addr) [inline]

Assign address value to VM address.

template<typename AddrType>
bool vm::Addr< AddrType >::operator== ( void *  ptr) [inline]

Compare VM addresses.

template<typename AddrType>
bool vm::Addr< AddrType >::operator== ( AddrType  addr) [inline]

Compare VM addresses.

template<typename AddrType>
bool vm::Addr< AddrType >::operator== ( int  addr) [inline]

Compare VM addresses.

template<typename AddrType>
bool vm::Addr< AddrType >::operator== ( const Addr< AddrType > &  addr) [inline]

Compare VM addresses.

template<typename AddrType>
template<typename T >
bool vm::Addr< AddrType >::operator> ( addr) [inline]

Compare VM addresses.

template<typename AddrType>
bool vm::Addr< AddrType >::operator> ( Addr< AddrType > &  addr) [inline]

Compare VM addresses.

template<typename AddrType>
bool vm::Addr< AddrType >::operator>= ( Addr< AddrType > &  addr) [inline]

Compare VM addresses.

template<typename AddrType>
template<typename T >
bool vm::Addr< AddrType >::operator>= ( addr) [inline]

Compare VM addresses.

template<typename AddrType>
Addr& vm::Addr< AddrType >::RoundDown ( AddrType  alignment = PAGE_SIZE) [inline]

Round down VM address.

Template parameter alignment specifies an alignment to apply for rounding.

Returns:
Reference to the same object.
template<typename AddrType>
Addr& vm::Addr< AddrType >::RoundUp ( AddrType  alignment = PAGE_SIZE) [inline]

Round up VM address.

Template parameter alignment specifies an alignment to apply for rounding.

Returns:
Reference to the same object.
template<typename AddrType>
bool vm::Addr< AddrType >::ToString ( text_stream::OTextStreamBase stream,
text_stream::OTextStreamBase::Context ctx,
char  fmtChar = 0 
) [inline]

Support for converting this class to string via text_stream::OTextStream.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines