CBMC
memory_sizet Class Reference

#include <memory_units.h>

Public Member Functions

 memory_sizet ()
 
 memory_sizet (const memory_sizet &)
 
 memory_sizet (memory_sizet &&)
 
memory_sizetoperator= (const memory_sizet &)
 
memory_sizetoperator= (memory_sizet &&) noexcept
 
memory_sizetoperator+= (const memory_sizet &)
 
memory_sizet operator+ (const memory_sizet &) const
 
std::size_t get_bytes () const
 
std::size_t get_kibibytes () const
 
std::size_t get_mebibytes () const
 
std::size_t get_gibibytes () const
 
std::string to_string () const
 

Static Public Member Functions

static memory_sizet from_bytes (std::size_t bytes)
 

Static Public Attributes

static const char * si_byte_symbol = "B"
 
static const char * si_kibibyte_symbol = "KiB"
 
static const char * si_mebibyte_symbol = "MiB"
 
static const char * si_gibibyte_symbol = "GiB"
 

Private Member Functions

 memory_sizet (std::size_t bytes)
 

Private Attributes

std::size_t bytes
 

Detailed Description

Definition at line 15 of file memory_units.h.

Constructor & Destructor Documentation

◆ memory_sizet() [1/4]

memory_sizet::memory_sizet ( )

Definition at line 13 of file memory_units.cpp.

◆ memory_sizet() [2/4]

memory_sizet::memory_sizet ( const memory_sizet other)

Definition at line 19 of file memory_units.cpp.

◆ memory_sizet() [3/4]

memory_sizet::memory_sizet ( memory_sizet &&  other)

Definition at line 22 of file memory_units.cpp.

◆ memory_sizet() [4/4]

memory_sizet::memory_sizet ( std::size_t  bytes)
explicitprivate

Definition at line 16 of file memory_units.cpp.

Member Function Documentation

◆ from_bytes()

memory_sizet memory_sizet::from_bytes ( std::size_t  bytes)
static

Definition at line 38 of file memory_units.cpp.

◆ get_bytes()

std::size_t memory_sizet::get_bytes ( ) const

Definition at line 43 of file memory_units.cpp.

◆ get_gibibytes()

std::size_t memory_sizet::get_gibibytes ( ) const

Definition at line 58 of file memory_units.cpp.

◆ get_kibibytes()

std::size_t memory_sizet::get_kibibytes ( ) const

Definition at line 48 of file memory_units.cpp.

◆ get_mebibytes()

std::size_t memory_sizet::get_mebibytes ( ) const

Definition at line 53 of file memory_units.cpp.

◆ operator+()

memory_sizet memory_sizet::operator+ ( const memory_sizet other) const

Definition at line 112 of file memory_units.cpp.

◆ operator+=()

memory_sizet & memory_sizet::operator+= ( const memory_sizet other)

Definition at line 106 of file memory_units.cpp.

◆ operator=() [1/2]

memory_sizet & memory_sizet::operator= ( const memory_sizet other)

Definition at line 26 of file memory_units.cpp.

◆ operator=() [2/2]

memory_sizet & memory_sizet::operator= ( memory_sizet &&  other)
noexcept

Definition at line 32 of file memory_units.cpp.

◆ to_string()

std::string memory_sizet::to_string ( ) const

Definition at line 63 of file memory_units.cpp.

Member Data Documentation

◆ bytes

std::size_t memory_sizet::bytes
private

Definition at line 42 of file memory_units.h.

◆ si_byte_symbol

const char * memory_sizet::si_byte_symbol = "B"
static

Definition at line 36 of file memory_units.h.

◆ si_gibibyte_symbol

const char * memory_sizet::si_gibibyte_symbol = "GiB"
static

Definition at line 39 of file memory_units.h.

◆ si_kibibyte_symbol

const char * memory_sizet::si_kibibyte_symbol = "KiB"
static

Definition at line 37 of file memory_units.h.

◆ si_mebibyte_symbol

const char * memory_sizet::si_mebibyte_symbol = "MiB"
static

Definition at line 38 of file memory_units.h.


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