CUBRID Engine  latest
record_descriptor Class Reference

#include <record_descriptor.hpp>

Inheritance diagram for record_descriptor:
Inheritance graph
Collaboration diagram for record_descriptor:
Collaboration graph

Public Member Functions

 record_descriptor (const cubmem::block_allocator &alloc=cubmem::PRIVATE_BLOCK_ALLOCATOR)
 
 ~record_descriptor (void)
 
 record_descriptor (const char *data, std::size_t size)
 
 record_descriptor (const recdes &rec, const cubmem::block_allocator &alloc=cubmem::PRIVATE_BLOCK_ALLOCATOR)
 
 record_descriptor (record_descriptor &&other)
 
void set_recdes (const recdes &rec)
 
int peek (cubthread::entry *thread_p, PAGE_PTR page, PGSLOTID slotid)
 
int copy (cubthread::entry *thread_p, PAGE_PTR page, PGSLOTID slotid)
 
int get (cubthread::entry *thread_p, PAGE_PTR page, PGSLOTID slotid, record_get_mode mode)
 
const recdesget_recdes (void) const
 
const char * get_data (void) const
 
std::size_t get_size (void) const
 
char * get_data_for_modify (void)
 
void set_data (const char *data, std::size_t size)
 
template<typename T >
void set_data_to_object (const T &t)
 
void set_record_length (std::size_t length)
 
void set_type (std::int16_t type)
 
void modify_data (std::size_t offset, std::size_t old_size, std::size_t new_size, const char *new_data)
 
void delete_data (std::size_t offset, std::size_t data_size)
 
void insert_data (std::size_t offset, std::size_t new_size, const char *new_data)
 
void move_data (std::size_t dest_offset, std::size_t source_offset)
 
void pack (cubpacking::packer &packer) const override
 
void unpack (cubpacking::unpacker &unpacker) override
 
std::size_t get_packed_size (cubpacking::packer &packer, std::size_t curr_offset) const override
 
void resize_buffer (std::size_t size)
 
void set_external_buffer (char *buf, std::size_t buf_size)
 
template<std::size_t S>
void set_external_buffer (cubmem::stack_block< S > &membuf)
 
void release_buffer (char *&data, std::size_t &size)
 
- Public Member Functions inherited from cubpacking::packable_object
virtual ~packable_object ()
 
virtual bool is_equal (const packable_object *other)
 

Private Types

enum  data_source {
  data_source::INVALID, data_source::PEEKED, data_source::COPIED, data_source::NEW,
  data_source::IMMUTABLE
}
 

Private Member Functions

void check_changes_are_permitted (void) const
 
bool is_mutable () const
 
void update_source_after_get (record_get_mode mode)
 

Private Attributes

recdes m_recdes
 
cubmem::extensible_block m_own_data
 
data_source m_data_source
 

Detailed Description

Definition at line 60 of file record_descriptor.hpp.

Member Enumeration Documentation

enum record_descriptor::data_source
strongprivate
Enumerator
INVALID 
PEEKED 
COPIED 
NEW 
IMMUTABLE 

Definition at line 144 of file record_descriptor.hpp.

Constructor & Destructor Documentation

record_descriptor::record_descriptor ( const cubmem::block_allocator alloc = cubmem::PRIVATE_BLOCK_ALLOCATOR)
record_descriptor::~record_descriptor ( void  )

Definition at line 80 of file record_descriptor.cpp.

record_descriptor::record_descriptor ( const char *  data,
std::size_t  size 
)

Definition at line 74 of file record_descriptor.cpp.

References set_data().

record_descriptor::record_descriptor ( const recdes rec,
const cubmem::block_allocator alloc = cubmem::PRIVATE_BLOCK_ALLOCATOR 
)

Definition at line 56 of file record_descriptor.cpp.

References set_recdes().

record_descriptor::record_descriptor ( record_descriptor &&  other)

Definition at line 63 of file record_descriptor.cpp.

References INVALID, m_data_source, m_own_data, m_recdes, NULL, and REC_UNKNOWN.

Member Function Documentation

void record_descriptor::check_changes_are_permitted ( void  ) const
private

Definition at line 313 of file record_descriptor.cpp.

References assert, and is_mutable().

Referenced by delete_data(), get_data_for_modify(), modify_data(), move_data(), set_record_length(), and set_type().

Here is the caller graph for this function:

int record_descriptor::copy ( cubthread::entry thread_p,
PAGE_PTR  page,
PGSLOTID  slotid 
)

Definition at line 110 of file record_descriptor.cpp.

References COPY_RECORD.

void record_descriptor::delete_data ( std::size_t  offset,
std::size_t  data_size 
)

Definition at line 298 of file record_descriptor.cpp.

References check_changes_are_permitted(), and move_data().

int record_descriptor::get ( cubthread::entry thread_p,
PAGE_PTR  page,
PGSLOTID  slotid,
record_get_mode  mode 
)
const char * record_descriptor::get_data ( void  ) const

Definition at line 196 of file record_descriptor.cpp.

References assert, recdes::data, INVALID, m_data_source, and m_recdes.

char * record_descriptor::get_data_for_modify ( void  )

Definition at line 211 of file record_descriptor.cpp.

References check_changes_are_permitted(), recdes::data, and m_recdes.

Referenced by heap_attrinfo_transform_to_disk_internal().

Here is the caller graph for this function:

std::size_t record_descriptor::get_packed_size ( cubpacking::packer packer,
std::size_t  curr_offset 
) const
overridevirtual
const recdes & record_descriptor::get_recdes ( void  ) const

Definition at line 189 of file record_descriptor.cpp.

References assert, INVALID, m_data_source, and m_recdes.

Referenced by locator_allocate_copy_area_by_attr_info(), and serial_update_serial_object().

Here is the caller graph for this function:

std::size_t record_descriptor::get_size ( void  ) const

Definition at line 203 of file record_descriptor.cpp.

References assert, INVALID, recdes::length, m_data_source, and m_recdes.

Referenced by locator_allocate_copy_area_by_attr_info(), move_data(), and serial_update_serial_object().

Here is the caller graph for this function:

void record_descriptor::insert_data ( std::size_t  offset,
std::size_t  new_size,
const char *  new_data 
)

Definition at line 307 of file record_descriptor.cpp.

References modify_data().

bool record_descriptor::is_mutable ( ) const
private

Definition at line 319 of file record_descriptor.cpp.

References COPIED, m_data_source, and NEW.

Referenced by check_changes_are_permitted(), and resize_buffer().

Here is the caller graph for this function:

void record_descriptor::modify_data ( std::size_t  offset,
std::size_t  old_size,
std::size_t  new_size,
const char *  new_data 
)

Definition at line 285 of file record_descriptor.cpp.

References check_changes_are_permitted(), recdes::data, m_recdes, and move_data().

Referenced by insert_data().

Here is the caller graph for this function:

void record_descriptor::move_data ( std::size_t  dest_offset,
std::size_t  source_offset 
)

Definition at line 252 of file record_descriptor.cpp.

References assert, check_changes_are_permitted(), recdes::data, get_size(), recdes::length, m_recdes, and resize_buffer().

Referenced by delete_data(), and modify_data().

Here is the caller graph for this function:

void record_descriptor::pack ( cubpacking::packer packer) const
overridevirtual
int record_descriptor::peek ( cubthread::entry thread_p,
PAGE_PTR  page,
PGSLOTID  slotid 
)

Definition at line 104 of file record_descriptor.cpp.

References PEEK_RECORD.

void record_descriptor::release_buffer ( char *&  data,
std::size_t &  size 
)

Definition at line 353 of file record_descriptor.cpp.

References cubmem::extensible_block::get_size(), m_own_data, and cubmem::extensible_block::release_ptr().

Referenced by locator_allocate_copy_area_by_attr_info().

Here is the caller graph for this function:

void record_descriptor::resize_buffer ( std::size_t  size)
void record_descriptor::set_data ( const char *  data,
std::size_t  size 
)

Definition at line 219 of file record_descriptor.cpp.

References recdes::data, IMMUTABLE, recdes::length, m_data_source, and m_recdes.

Referenced by record_descriptor().

Here is the caller graph for this function:

template<typename T >
void record_descriptor::set_data_to_object ( const T &  t)

Definition at line 175 of file record_descriptor.hpp.

void record_descriptor::set_external_buffer ( char *  buf,
std::size_t  buf_size 
)
template<std::size_t S>
void record_descriptor::set_external_buffer ( cubmem::stack_block< S > &  membuf)
void record_descriptor::set_recdes ( const recdes rec)
void record_descriptor::set_record_length ( std::size_t  length)

Definition at line 228 of file record_descriptor.cpp.

References recdes::area_size, assert, check_changes_are_permitted(), recdes::length, and m_recdes.

Referenced by heap_attrinfo_transform_to_disk_internal().

Here is the caller graph for this function:

void record_descriptor::set_type ( std::int16_t  type)

Definition at line 236 of file record_descriptor.cpp.

References check_changes_are_permitted(), m_recdes, and recdes::type.

Referenced by serial_update_serial_object().

Here is the caller graph for this function:

void record_descriptor::update_source_after_get ( record_get_mode  mode)
private

Definition at line 171 of file record_descriptor.cpp.

References assert, COPIED, COPY_RECORD, INVALID, m_data_source, PEEK_RECORD, and PEEKED.

Referenced by get().

Here is the caller graph for this function:

Member Data Documentation

cubmem::extensible_block record_descriptor::m_own_data
private

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