SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Core::Mem::Item Struct Referencefinal

#include <swcdb/core/PageArena.h>

+ Collaboration diagram for SWC::Core::Mem::Item:

Classes

struct  Equal
 
struct  Hash
 
struct  Less
 

Public Types

typedef ItemPtr
 

Public Member Functions

 Item ()=delete
 
 Item (const Item &)=delete
 
 Item (Item &&other)=delete
 
Itemoperator= (const Item &)=delete
 
Itemoperator= (Item &&)=delete
 
 Item (const uint8_t *ptr, uint32_t size) noexcept
 
size_t _hash () const noexcept
 
void allocate ()
 
 ~Item () noexcept
 
uint32_t size () const noexcept
 
const uint8_t * data () const noexcept
 
size_t hash () const noexcept
 
Ptr use () noexcept
 
bool unused () noexcept
 
void release ()
 
std::string_view to_string () const noexcept
 
bool less (const Item &other) const noexcept
 
bool equal (const Item &other) const noexcept
 

Static Public Member Functions

static Item::Ptr make (const uint8_t *buf, uint32_t size)
 

Public Attributes

Core::Atomic< uint64_t > count
 
const uint32_t size_
 
const uint8_t * data_
 
const size_t hash_
 

Detailed Description

Definition at line 17 of file PageArena.h.

Member Typedef Documentation

◆ Ptr

Definition at line 20 of file PageArena.h.

Constructor & Destructor Documentation

◆ Item() [1/4]

SWC::Core::Mem::Item::Item ( )
delete

◆ Item() [2/4]

SWC::Core::Mem::Item::Item ( const Item )
delete

◆ Item() [3/4]

SWC::Core::Mem::Item::Item ( Item &&  other)
delete

◆ Item() [4/4]

SWC::Core::Mem::Item::Item ( const uint8_t *  ptr,
uint32_t  size 
)
inlinenoexcept

Definition at line 37 of file PageArena.h.

◆ ~Item()

SWC::Core::Mem::Item::~Item ( )
inlinenoexcept

Definition at line 55 of file PageArena.h.

References data_.

Member Function Documentation

◆ _hash()

size_t SWC::Core::Mem::Item::_hash ( ) const
inlinenoexcept

Definition at line 41 of file PageArena.h.

References data_, and size_.

◆ allocate()

void SWC::Core::Mem::Item::allocate ( )
inline

Definition at line 51 of file PageArena.h.

References data_, and size_.

◆ data()

const uint8_t* SWC::Core::Mem::Item::data ( ) const
inlinenoexcept

Definition at line 64 of file PageArena.h.

References data_.

Referenced by SWC::Core::Mem::ItemPtr::data().

+ Here is the caller graph for this function:

◆ equal()

bool SWC::Core::Mem::Item::equal ( const Item other) const
inlinenoexcept

Definition at line 93 of file PageArena.h.

References data_, SWC::Condition::eq(), and size_.

Referenced by SWC::Core::Mem::Item::Equal::operator()().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash()

size_t SWC::Core::Mem::Item::hash ( ) const
inlinenoexcept

Definition at line 68 of file PageArena.h.

References hash_.

◆ less()

bool SWC::Core::Mem::Item::less ( const Item other) const
inlinenoexcept

Definition at line 87 of file PageArena.h.

References data_, SWC::Condition::mem_cmp(), and size_.

Referenced by SWC::Core::Mem::Item::Less::operator()().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make()

Item::Ptr SWC::Core::Mem::Item::make ( const uint8_t *  buf,
uint32_t  size 
)
static

Definition at line 301 of file PageArena.h.

References SWC::Env::PageArena, size(), and SWC::Core::Mem::Arena::use().

Referenced by SWC::Core::Mem::ItemPtr::use().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [1/2]

Item& SWC::Core::Mem::Item::operator= ( const Item )
delete

◆ operator=() [2/2]

Item& SWC::Core::Mem::Item::operator= ( Item &&  )
delete

◆ release()

void SWC::Core::Mem::Item::release ( )

Definition at line 305 of file PageArena.h.

References SWC::Core::Mem::Arena::free(), SWC::Env::PageArena, and unused().

Referenced by SWC::Core::Mem::ItemPtr::release(), SWC::Core::Mem::ItemPtr::use(), and SWC::Core::Mem::ItemPtr::~ItemPtr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

uint32_t SWC::Core::Mem::Item::size ( ) const
inlinenoexcept

Definition at line 60 of file PageArena.h.

References size_.

Referenced by SWC::Core::Mem::Arena::free(), make(), and SWC::Core::Mem::ItemPtr::size().

+ Here is the caller graph for this function:

◆ to_string()

std::string_view SWC::Core::Mem::Item::to_string ( ) const
inlinenoexcept

Definition at line 83 of file PageArena.h.

References data_, and size_.

Referenced by SWC::Core::Mem::ItemPtr::to_string().

+ Here is the caller graph for this function:

◆ unused()

bool SWC::Core::Mem::Item::unused ( )
inlinenoexcept

Definition at line 77 of file PageArena.h.

References count, and SWC::Core::Atomic< T, OrderT >::fetch_sub().

Referenced by release().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ use()

Ptr SWC::Core::Mem::Item::use ( )
inlinenoexcept

Definition at line 72 of file PageArena.h.

References count, and SWC::Core::Atomic< T, OrderT >::fetch_add().

Referenced by SWC::Core::Mem::ItemPtr::operator=(), and SWC::Core::Mem::ItemPtr::use().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ count

Core::Atomic<uint64_t> SWC::Core::Mem::Item::count

Definition at line 22 of file PageArena.h.

Referenced by SWC::Core::Mem::Page::free(), unused(), and use().

◆ data_

const uint8_t* SWC::Core::Mem::Item::data_

Definition at line 24 of file PageArena.h.

Referenced by _hash(), allocate(), data(), equal(), less(), to_string(), and ~Item().

◆ hash_

const size_t SWC::Core::Mem::Item::hash_

Definition at line 25 of file PageArena.h.

Referenced by hash().

◆ size_

const uint32_t SWC::Core::Mem::Item::size_

Definition at line 23 of file PageArena.h.

Referenced by _hash(), allocate(), equal(), less(), size(), and to_string().


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