GCSIM
Public Member Functions | Private Attributes | List of all members
root_set_table Class Reference

manages root sets for garbage collection. More...

#include <root-set-table.hpp>

Public Member Functions

 root_set_table ()=default
 creates an instance of the root set table.
 
 ~root_set_table ()=default
 deletes the instance of the root set table.
 
 root_set_table (const root_set_table &)=delete
 deleted copy constructor.
 
root_set_tableoperator= (const root_set_table &)=delete
 deleted assignment operator.
 
 root_set_table (root_set_table &&other) noexcept=default
 constructs new root set table from an existing one.
 
root_set_tableoperator= (root_set_table &&other) noexcept=default
 constructs new root set table by assigning it an existing one.
 
void add_root (std::string key, std::unique_ptr< root_set_base > root)
 adds new root to the root set table.
 
void remove_root (const std::string &key)
 removes root from the root set table.
 
root_set_baseget_root (const std::string &key) noexcept
 getter for the root from the root set table.
 
const root_set_baseget_root (const std::string &key) const noexcept
 getter for the root from the root set table.
 
hash_map< std::string, std::unique_ptr< root_set_base > > & get_roots () noexcept
 getter for the root-set-table.
 
const hash_map< std::string, std::unique_ptr< root_set_base > > & get_roots () const noexcept
 getter for the root-set-table.
 
void clear () noexcept
 removes all roots from root set table.
 
size_t get_root_count () const noexcept
 getter for the number of roots in the root set table.
 

Private Attributes

hash_map< std::string, std::unique_ptr< root_set_base > > roots
 hash map storing root sets by name.
 

Detailed Description

manages root sets for garbage collection.

Constructor & Destructor Documentation

◆ root_set_table() [1/3]

root_set_table::root_set_table ( )
default

creates an instance of the root set table.

◆ ~root_set_table()

root_set_table::~root_set_table ( )
default

deletes the instance of the root set table.

◆ root_set_table() [2/3]

root_set_table::root_set_table ( const root_set_table )
delete

deleted copy constructor.

◆ root_set_table() [3/3]

root_set_table::root_set_table ( root_set_table &&  other)
defaultnoexcept

constructs new root set table from an existing one.

Parameters
other- rvalue of the existing root set value.

moves ownership of the roots from other to this.

Member Function Documentation

◆ add_root()

void root_set_table::add_root ( std::string  key,
std::unique_ptr< root_set_base root 
)

adds new root to the root set table.

Parameters
key- name of the root.
root- instance of the root set entry.
Returns
void

◆ clear()

void root_set_table::clear ( )
noexcept

removes all roots from root set table.

Returns
void

◆ get_root() [1/2]

const root_set_base * root_set_table::get_root ( const std::string &  key) const
noexcept

getter for the root from the root set table.

Parameters
key- name of the root.
Returns
const pointer to a root set entry.

◆ get_root() [2/2]

root_set_base * root_set_table::get_root ( const std::string &  key)
noexcept

getter for the root from the root set table.

Parameters
key- name of the root.
Returns
pointer to a root set entry.

◆ get_root_count()

size_t root_set_table::get_root_count ( ) const
noexcept

getter for the number of roots in the root set table.

Returns
number of roots.

◆ get_roots() [1/2]

const hash_map< std::string, std::unique_ptr< root_set_base > > & root_set_table::get_roots ( ) const
noexcept

getter for the root-set-table.

Returns
const reference to a root-set-table.

◆ get_roots() [2/2]

hash_map< std::string, std::unique_ptr< root_set_base > > & root_set_table::get_roots ( )
noexcept

getter for the root-set-table.

Returns
reference to a root-set-table.

◆ operator=() [1/2]

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

deleted assignment operator.

◆ operator=() [2/2]

root_set_table & root_set_table::operator= ( root_set_table &&  other)
defaultnoexcept

constructs new root set table by assigning it an existing one.

Parameters
other- rvalue of the existing root set table.

moves ownership of the roots from other to this.

◆ remove_root()

void root_set_table::remove_root ( const std::string &  key)

removes root from the root set table.

Parameters
key- name of the root.
Returns
void

Member Data Documentation

◆ roots

hash_map<std::string, std::unique_ptr<root_set_base> > root_set_table::roots
private

hash map storing root sets by name.


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