Public Member Functions | Static Public Member Functions
vcpu_manager Class Reference

Public Member Functions

virtual ~vcpu_manager ()=default
 
virtual void create_vcpu (vcpuid::type vcpuid, user_data *data=nullptr)
 
virtual void delete_vcpu (vcpuid::type vcpuid, user_data *data=nullptr)
 
virtual void run_vcpu (vcpuid::type vcpuid, user_data *data=nullptr)
 
virtual void hlt_vcpu (vcpuid::type vcpuid, user_data *data=nullptr)
 
virtual void write (vcpuid::type vcpuid, const std::string &str) noexcept
 
 vcpu_manager (const vcpu_manager &)=delete
 
vcpu_manageroperator= (const vcpu_manager &)=delete
 

Static Public Member Functions

static vcpu_managerinstance () noexcept
 

Detailed Description

vCPU Manager

The vCPU manager is responsible for creating / destroying vCPUs, and calling a vCPU's interface, depending on which vcpuid is provided. If you need to work with a vCPU, but all you have is a vcpuid, this is the class to use.

Definition at line 39 of file vcpu_manager.h.

Constructor & Destructor Documentation

◆ ~vcpu_manager()

virtual vcpu_manager::~vcpu_manager ( )
virtualdefault

Destructor

Precondition
expects: none
Postcondition
ensures: none

◆ vcpu_manager()

vcpu_manager::vcpu_manager ( const vcpu_manager )
delete

Member Function Documentation

◆ instance()

vcpu_manager * vcpu_manager::instance ( )
staticnoexcept

Get Singleton Instance

Precondition
expects: none
Postcondition
ensures: ret != nullptr

Get an instance to the singleton class.

Definition at line 37 of file vcpu_manager.cpp.

◆ create_vcpu()

void vcpu_manager::create_vcpu ( vcpuid::type  vcpuid,
user_data data = nullptr 
)
virtual

Create vCPU

Creates the vCPU. Note that the vCPU is actually created by the vCPU factory's make_vcpu function.

Precondition
expects: none
Postcondition
ensures: none
Parameters
vcpuidthe vcpu to initialize
datauser data that can be passed around as needed by extensions of Bareflank

Definition at line 44 of file vcpu_manager.cpp.

◆ delete_vcpu()

void vcpu_manager::delete_vcpu ( vcpuid::type  vcpuid,
user_data data = nullptr 
)
virtual

Delete vCPU

Deletes the vCPU.

Parameters
vcpuidthe vcpu to stop
datauser data that can be passed around as needed by extensions of Bareflank

Definition at line 57 of file vcpu_manager.cpp.

◆ run_vcpu()

void vcpu_manager::run_vcpu ( vcpuid::type  vcpuid,
user_data data = nullptr 
)
virtual

Run vCPU

Executes the vCPU.

Precondition
expects: vcpu exists
Postcondition
ensures: none
Parameters
vcpuidthe vcpu to execute
datauser data that can be passed around as needed by extensions of Bareflank

Definition at line 70 of file vcpu_manager.cpp.

◆ hlt_vcpu()

void vcpu_manager::hlt_vcpu ( vcpuid::type  vcpuid,
user_data data = nullptr 
)
virtual

Halt vCPU

Halts the vCPU.

Precondition
expects: none
Postcondition
ensures: none
Parameters
vcpuidthe vcpu to halt
datauser data that can be passed around as needed by extensions of Bareflank

Definition at line 77 of file vcpu_manager.cpp.

◆ write()

void vcpu_manager::write ( vcpuid::type  vcpuid,
const std::string &  str 
)
virtualnoexcept

Write to Log

Write's a string the vCPU's debug ring.

Precondition
expects: none
Postcondition
ensures: none
Parameters
vcpuidthe vCPU to write to
strthe string to write

Definition at line 84 of file vcpu_manager.cpp.

◆ operator=()

vcpu_manager& vcpu_manager::operator= ( const vcpu_manager )
delete

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