libmicroemu 0.2.0
ARM Microcontroller Emulator Library
Loading...
Searching...
No Matches
libmicroemu::internal::RegAccessor< TCpuAccessor > Class Template Reference

Provides access to processor registers. More...

#include <reg_access.h>

Inheritance diagram for libmicroemu::internal::RegAccessor< TCpuAccessor >:
libmicroemu::IRegAccessor

Public Types

using CpuAccessor = TCpuAccessor
 
using Reg = typename CpuAccessor::Reg
 
using SReg = typename CpuAccessor::SReg
 

Public Member Functions

 RegAccessor (CpuAccessor &cpua)
 Constructs a RegAccessor object with the given processor states.
 
 ~RegAccessor ()=default
 Default destructor for the RegAccessor object.
 
 RegAccessor (const RegAccessor &)=default
 Default copy constructor for the RegAccessor object.
 
RegAccessoroperator= (const RegAccessor &)=default
 Default copy assignment operator for the RegAccessor object.
 
 RegAccessor (RegAccessor &&)=default
 Default move constructor for the RegAccessor object.
 
RegAccessoroperator= (RegAccessor &&)=default
 Default move assignment operator for the RegAccessor object.
 
std::string_view GetRegisterName (const RegisterId &id) const override
 Gets the name of the specified register.
 
u32 ReadRegister (const RegisterId &id) const override
 Reads the value of the specified register.
 
void WriteRegister (const RegisterId &id, u32 value) override
 Writes the value to the specified register.
 

Detailed Description

template<typename TCpuAccessor>
class libmicroemu::internal::RegAccessor< TCpuAccessor >

Provides access to processor registers.

The RegAccessor class allows reading and writing values to processor registers. It provides methods to read the value of a register and write a value to a register. The class also handles edge cases where the register ID is out of range (greater than or equal to 16).

Template Parameters
TCpuAccessorThe type of the cpu accessor object used by the RegAccessor object.
TRegOpsThe type of the register operations used by the RegAccessor object.

Constructor & Destructor Documentation

◆ RegAccessor()

template<typename TCpuAccessor>
libmicroemu::internal::RegAccessor< TCpuAccessor >::RegAccessor ( CpuAccessor & cpua)
inline

Constructs a RegAccessor object with the given processor states.

Parameters
CpuAccessorThe processor states to be used by the RegAccessor object.

Member Function Documentation

◆ GetRegisterName()

template<typename TCpuAccessor>
std::string_view libmicroemu::internal::RegAccessor< TCpuAccessor >::GetRegisterName ( const RegisterId & id) const
inlineoverridevirtual

Gets the name of the specified register.

Parameters
idThe ID of the register.
Returns
The name of the register.

Implements libmicroemu::IRegAccessor.

◆ ReadRegister()

template<typename TCpuAccessor>
u32 libmicroemu::internal::RegAccessor< TCpuAccessor >::ReadRegister ( const RegisterId & id) const
inlineoverridevirtual

Reads the value of the specified register.

Parameters
reg_idThe ID of the register to be read.
Returns
The value of the register.

Implements libmicroemu::IRegAccessor.

◆ WriteRegister()

template<typename TCpuAccessor>
void libmicroemu::internal::RegAccessor< TCpuAccessor >::WriteRegister ( const RegisterId & id,
u32 value )
inlineoverridevirtual

Writes the value to the specified register.

Parameters
reg_idThe ID of the register to be written.
valueThe value to be written to the register.

Implements libmicroemu::IRegAccessor.


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