Disk ARchive  2.5.2
Full featured and portable backup and archiving tool
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Member Functions | Protected Member Functions
libdar::on_pool Class Reference

#include <on_pool.hpp>

Inherited by libdar::archive, libdar::archive_options_create, libdar::archive_options_diff, libdar::archive_options_extract, libdar::archive_options_isolate, libdar::archive_options_listing, libdar::archive_options_merge, libdar::archive_options_read, libdar::archive_options_test, libdar::cat_entree, libdar::cat_etoile, libdar::catalogue, libdar::compressor::xfer, libdar::crc, libdar::crit_action, libdar::criterium, libdar::data_tree, libdar::database, libdar::datetime, libdar::deci, libdar::defile, libdar::ea_attributs, libdar::elastic, libdar::entrepot, libdar::etage, libdar::filesystem_hard_link_read [virtual], libdar::filesystem_hard_link_write [virtual], libdar::filesystem_specific_attribute, libdar::filesystem_specific_attribute_list, libdar::generic_file, libdar::generic_file_overlay_for_gpgme, libdar::header, libdar::header_version, libdar::infinint, libdar::label, libdar::limitint< B >, libdar::list_entry, libdar::mask, libdar::messaging_decode, libdar::messaging_encode, libdar::path, libdar::secu_string, libdar::semaphore, libdar::slave_thread, libdar::slave_zapette, libdar::slice_layout, libdar::tlv_list, libdar::user_interaction, and libdar::wrapperlib.

List of all members.

Public Member Functions

void * operator new (size_t n_byte)
void * operator new (size_t n_byte, const std::nothrow_t &nothrow_value)
void * operator new[] (size_t n_byte)
void * operator new[] (size_t n_byte, const std::nothrow_t &nothrow_value)
void * operator new (size_t n_byte, memory_pool *p)
void * operator new[] (size_t n_byte, memory_pool *p)
void operator delete (void *ptr, memory_pool *p)
 this operator is called by the compiler if an exception is throw from the constructor of the allocated object
void operator delete[] (void *ptr, memory_pool *p)
 this operator is called by the compiler if an exception is throw from the constructor of the allocated objects
void operator delete (void *ptr)
 this is the usual delete operator, modified to handle allocated objects allocated on a memory pool or not
void operator delete[] (void *ptr)
 this is the usual delete[] operator, modified to handle allocated objects allocated on a memory pool or not

Protected Member Functions

memory_pool * get_pool () const
template<class T >
void meta_new (T *&ptr, size_t num)
template<class T >
void meta_delete (T *ptr)

Detailed Description

class on_pool is the ancestors of all class that are able to be allocated on a memory pool

Note:
: new and new[] operators using memory pool never throw an exception upon allocation failure but rather return nullptr pointer. This is the way it was working before g++03 and g++11

Definition at line 52 of file on_pool.hpp.


Member Function Documentation

memory_pool* libdar::on_pool::get_pool ( ) const [inline, protected]

get the pool used to allocate "this"

Returns:
the address of the memory pool that has been used to allocate the object
Note:
if the object has not been allocated using a memory pool nullptr is returned
if the object has not been dynamically allocated, that's to say is a local variable or a temporary object, get_pool() must not be called as it will return unpredictable result and could most probably crash the application if the returned data is used

Definition at line 144 of file on_pool.hpp.

Referenced by libdar::cat_eod::clone(), libdar::cat_ignored::clone(), libdar::cat_ignored_dir::clone(), libdar::cat_detruit::clone(), libdar::mask_list::clone(), libdar::cat_blockdev::clone(), libdar::cat_lien::clone(), libdar::cat_chardev::clone(), libdar::cat_tube::clone(), libdar::cat_prise::clone(), libdar::cat_mirage::clone(), libdar::bool_mask::clone(), libdar::cat_file::clone(), libdar::crit_constant_action::clone(), libdar::cat_directory::clone(), libdar::simple_mask::clone(), libdar::regular_mask::clone(), libdar::testing::clone(), libdar::not_mask::clone(), libdar::crit_chain::clone(), libdar::crit_in_place_is_inode::clone(), libdar::et_mask::clone(), libdar::crit_in_place_is_dir::clone(), libdar::crit_in_place_is_file::clone(), libdar::crit_in_place_is_hardlinked_inode::clone(), libdar::crit_in_place_is_new_hardlinked_inode::clone(), libdar::crit_in_place_data_more_recent::clone(), libdar::ou_mask::clone(), libdar::crit_in_place_data_more_recent_or_equal_to::clone(), libdar::crit_in_place_data_bigger::clone(), libdar::simple_path_mask::clone(), libdar::crit_in_place_data_saved::clone(), libdar::crit_in_place_data_dirty::clone(), libdar::same_path_mask::clone(), libdar::crit_in_place_data_sparse::clone(), libdar::crit_in_place_EA_present::clone(), libdar::exclude_dir_mask::clone(), libdar::crit_in_place_EA_more_recent::clone(), libdar::crit_in_place_EA_more_recent_or_equal_to::clone(), libdar::crit_in_place_more_EA::clone(), libdar::crit_in_place_EA_bigger::clone(), libdar::crit_in_place_EA_saved::clone(), libdar::crit_same_type::clone(), libdar::crit_not::clone(), libdar::crit_and::clone(), and libdar::user_interaction_blind::clone().

void* libdar::on_pool::operator new ( size_t  n_byte) [inline]

the usual new operator is wrapped to allow proper delete operation later on (throws std::bad_alloc upon allocation failure)

Note:
memory allocation done this way does not use the default C++ new[] operator, which may be slower than using memory pool

Definition at line 84 of file on_pool.hpp.

void* libdar::on_pool::operator new ( size_t  n_byte,
const std::nothrow_t &  nothrow_value 
) [inline]

the usual new operator is wrapped to allow proper delete operation later on (does not throw exception upon allocation failure)

Note:
memory allocation done this way does not use the default C++ new[] operator, which may be slower than using memory pool

Definition at line 90 of file on_pool.hpp.

void* libdar::on_pool::operator new ( size_t  n_byte,
memory_pool *  p 
) [inline]

this operator allocates a single object on a memory pool

Note:
usage is: type *ptr = new (pool_obj) type(initial,values)
such object has to be delete normally no need to call the destructor manually

Definition at line 108 of file on_pool.hpp.

void* libdar::on_pool::operator new[] ( size_t  n_byte) [inline]

the usual new[] operator is wrapped to allow proper delete[] operation later on (throws std::bad_alloc upon allocation failure)

Note:
memory allocation done this way does not use the default C++ new[] operator, which may be slower than using memory pool

Definition at line 96 of file on_pool.hpp.

void* libdar::on_pool::operator new[] ( size_t  n_byte,
const std::nothrow_t &  nothrow_value 
) [inline]

the usual new[] operator is wrapped to allow proper delete[] operation later on (does not throw exception upon allocation failure)

Note:
memory allocation done this way does not use the default C++ new[] operator, which may be slower than using memory pool

Definition at line 102 of file on_pool.hpp.

void* libdar::on_pool::operator new[] ( size_t  n_byte,
memory_pool *  p 
) [inline]

this operator allocates an array of objects on a memory pool

Note:
usage is: type *ptr = new (pool_obj) type(initial,values)
such object has to be delete normally no need to call the destructor manually

Definition at line 115 of file on_pool.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines