feisty meow concerns codebase
2.140
|
Represents a sequential, ordered, contiguous collection of objects. More...
#include <array.h>
Public Types | |
enum | specialc_flags { NO_SPECIAL_MODES = 0x0 , SIMPLE_COPY = 0x1 , EXPONENTIAL_GROWTH = 0x2 , EXPONE = EXPONENTIAL_GROWTH , FLUSH_INVISIBLE = 0x4 } |
the flags specify how the array treats its contents and its length. More... | |
enum | how_to_copy { NEW_AT_END , NEW_AT_BEGINNING , DONT_COPY } |
enum | shift_directions { TO_LEFT , TO_RIGHT } |
Public Member Functions | |
DEFINE_CLASS_NAME ("array") | |
array (int number=0, const contents *init=NULL_POINTER, int flags=EXPONENTIAL_GROWTH|FLUSH_INVISIBLE) | |
Constructs an array with room for "number" objects. More... | |
array (const array< contents > ©_from) | |
copies the contents & sizing information from "copy_from". More... | |
virtual | ~array () |
destroys the memory allocated for the objects. More... | |
void | reset (int number=0, const contents *initial_contents=NULL_POINTER) |
Resizes this array and sets the contents from an array of contents. More... | |
array & | operator= (const array< contents > ©_from) |
Copies the array in "copy_from" into this. More... | |
int | length () const |
Returns the current reported length of the allocated C array. More... | |
int | last () const |
Returns the last valid element in the array. More... | |
int | flags () const |
Provides the raw flags value, without interpreting what it means. More... | |
bool | exponential () const |
Returns true if this allocator will grow exponentially on resize. More... | |
bool | simple () const |
Reports whether the templated object is a simple type or not. More... | |
const contents & | get (int index) const |
Accesses individual objects stored in "this" at the "index" position. More... | |
contents & | use (int index) |
A non-constant version of get(); the returned object can be modified. More... | |
const contents & | operator[] (int index) const |
Synonym for get that provides the expected array indexing syntax. More... | |
contents & | operator[] (int index) |
Synonym for use that provides the expected array indexing syntax. More... | |
outcome | put (int index, const contents &to_put) |
Stores an object at the index "index" in the array. More... | |
array | concatenation (const array &to_concatenate) const |
Returns the concatenation of "this" and the array "to_concatenate". More... | |
array | concatenation (const contents &to_concatenate) const |
Returns the concatenation of "this" and the object "to_concatenate". More... | |
array & | concatenate (const array &to_concatenate) |
Appends the array "to_concatenate" onto "this" and returns "this". More... | |
array & | concatenate (const contents &to_concatenate) |
Appends the object "to_concatenate" onto "this" and returns "this". More... | |
array & | concatenate (const contents *to_concatenate, int length) |
Concatenates a C-array "to_concatenate" onto "this" and returns "this". More... | |
array | operator+ (const array &to_cat) const |
Synonym for concatenation. More... | |
array | operator+ (const contents &to_concatenate) const |
Synonym for concatenation. More... | |
array & | operator+= (const array &to_concatenate) |
Synonym for concatenate that modifies "this". More... | |
array & | operator+= (const contents &to_concatenate) |
Synonym for concatenate that modifies "this". More... | |
const contents * | observe () const |
Returns a pointer to the underlying C array of data. More... | |
contents * | access () |
A non-constant access of the underlying C-array. BE REALLY CAREFUL. More... | |
void | swap_contents (array< contents > &other) |
Exchanges the contents of "this" and "other". More... | |
void | snarf (array &new_contents) |
Drops "this" array's contents into the dustbin and uses "new_contents". More... | |
array | subarray (int start, int end) const |
Returns the array segment between the indices "start" and "end". More... | |
outcome | insert (int index, int new_indices) |
Adds "new_indices" new positions for objects into the array at "index". More... | |
outcome | overwrite (int index, const array &write_with, int count=-1) |
Stores the array "write_with" into the current array at the "index". More... | |
outcome | stuff (int length, contents *to_stuff) const |
Copies at most "length" elements from this into the array "to_stuff". More... | |
outcome | resize (int new_size, how_to_copy way=NEW_AT_END) |
Changes the size of the C array to "new_size". More... | |
outcome | zap (int start, int end) |
Deletes from "this" the objects inclusively between "start" and "end". More... | |
outcome | shrink () |
Cuts loose any allocated space that is beyond the real length. More... | |
outcome | retrain (int new_size, const contents *to_copy) |
Resizes the C array and stuffs it with the contents in "to_copy". More... | |
void | shift_data (shift_directions where) |
The valid portion of the array is moved to the left or right. More... | |
int | internal_real_length () const |
Gritty Internal: the real allocated length. More... | |
int | internal_offset () const |
Gritty Internal: the offset from real start to stored data. More... | |
const contents * | internal_block_start () const |
Gritty Internal: constant peek at the real allocated pointer. More... | |
contents * | internal_block_start () |
Gritty Internal: the real allocated pointer made accessible. More... | |
contents *const * | internal_offset_mem () const |
Gritty Internal: the start of the actual stored data. More... | |
Represents a sequential, ordered, contiguous collection of objects.
This object manages a contiguous array of memory to hold the objects it contains. The objects to be stored must have a constructor with zero parameters, since the objects are stored in a C-style array (and array constructors cannot be given arguments to be passed to the objects). The objects must also either be flat (containing no pointers) or have an assignment operator (=) that correctly copies the deep contents. This class also provides an exponential growth mode for memory to reduce thrashing; this allows the size pre-allocated to double every time a new allocation is required during a resize. This causes the allocation to grow very swiftly, speeding up usage of frequently growing arrays, but this may not be desired for every array. terms used here... blank array: a array with some number of elements, but where those elements are objects that have been constructed using their default parameterless constructor. empty array: a array of zero elements.
enum basis::array::how_to_copy |
enum basis::array::shift_directions |
enum basis::array::specialc_flags |
the flags specify how the array treats its contents and its length.
basis::array< contents >::array | ( | int | number = 0 , |
const contents * | init = NULL_POINTER , |
||
int | flags = EXPONENTIAL_GROWTH | FLUSH_INVISIBLE |
||
) |
Constructs an array with room for "number" objects.
The initial contents are copied from "init" unless NULL_POINTER is passed in instead. If "init" is not NULL_POINTER, then it must point to an array of objects that contains at least "number". The "flags" are a value based on the special flags being added bit-wise. If "flags" contains SIMPLE_COPY, then memmove() is used rather than using the C++ object's assignment operator. Note that SIMPLE_COPY will NOT work if the templated object has a regular constructor or assignment operator, since those methods will not be called on copying. If the "flags" contain EXPONENTIAL_GROWTH, then the true allocation size will be doubled every time a new allocation is required. when the FLUSH_INVISIBLE flag is included, then the array elements that go out of scope are returned to the state provided by the content's default constructor. this ensures that if they ever come back into scope, they do not yet have any contents. further, if the elements had any deep contents, those resources should be released.
Definition at line 315 of file array.h.
References basis::array< contents >::EXPONE, basis::array< contents >::FLUSH_INVISIBLE, eml_to_txt::num, and basis::array< contents >::retrain().
basis::array< contents >::array | ( | const array< contents > & | copy_from | ) |
copies the contents & sizing information from "copy_from".
Definition at line 331 of file array.h.
References basis::array< contents >::operator=().
|
virtual |
destroys the memory allocated for the objects.
Definition at line 339 of file array.h.
References NULL_POINTER.
|
inline |
A non-constant access of the underlying C-array. BE REALLY CAREFUL.
Definition at line 175 of file array.h.
Referenced by basis::astring::access(), structures::amorph< contents >::acquire(), basis::astring::astring(), structures::amorph< contents >::borrow(), basis::array< contents >::concatenation(), crypto::blowfish_crypto::decrypt(), crypto::blowfish_crypto::encrypt(), versions::version_checker::get_language(), versions::version_checker::get_record(), filesystem::byte_filer::getline(), nechung_oracle::pick_random(), crypto::rsa_crypto::private_decrypt(), crypto::rsa_crypto::private_encrypt(), crypto::rsa_crypto::private_key(), crypto::rsa_crypto::public_decrypt(), crypto::rsa_crypto::public_encrypt(), crypto::rsa_crypto::public_key(), structures::amorph< contents >::put(), filesystem::byte_filer::read(), sockets::spocket::receive(), sockets::spocket::receive_from(), filesystem::directory::rescan(), structures::bit_vector::reset(), versions::version_checker::retrieve_version(), versions::version_checker::retrieve_version_info(), crypto::rsa_crypto::set_key(), application::stdio_redirecter::std_thread_action(), and configuration::system_values::text_form().
array< contents > & basis::array< contents >::concatenate | ( | const array< contents > & | to_concatenate | ) |
Appends the array "to_concatenate" onto "this" and returns "this".
Definition at line 379 of file array.h.
References basis::array< contents >::length().
Referenced by basis::attach_flat(), structures::set< contents >::intersection(), sockets::span_manager::make_missing_list(), sockets::span_manager::make_received_list(), basis::array< contents >::operator+=(), filesystem::directory::rescan(), and textual::string_manipulation::string_to_hex().
array< contents > & basis::array< contents >::concatenate | ( | const contents & | to_concatenate | ) |
array< contents > & basis::array< contents >::concatenate | ( | const contents * | to_concatenate, |
int | length | ||
) |
array< contents > basis::array< contents >::concatenation | ( | const array< contents > & | to_concatenate | ) | const |
Returns the concatenation of "this" and the array "to_concatenate".
Definition at line 421 of file array.h.
References basis::array< contents >::length(), NULL_POINTER, and basis::array< contents >::overwrite().
Referenced by basis::array< contents >::operator+().
array< contents > basis::array< contents >::concatenation | ( | const contents & | to_concatenate | ) | const |
Returns the concatenation of "this" and the object "to_concatenate".
Definition at line 431 of file array.h.
References basis::array< contents >::access(), basis::array< contents >::last(), NULL_POINTER, and basis::array< contents >::overwrite().
basis::array< contents >::DEFINE_CLASS_NAME | ( | "array< contents >" | ) |
|
inline |
Returns true if this allocator will grow exponentially on resize.
Definition at line 124 of file array.h.
References basis::array< contents >::EXPONENTIAL_GROWTH.
|
inline |
Provides the raw flags value, without interpreting what it means.
Definition at line 121 of file array.h.
Referenced by structures::unpack_array(), and structures::unpack_simple().
const contents & basis::array< contents >::get | ( | int | index | ) | const |
Accesses individual objects stored in "this" at the "index" position.
If the index is out of range, then a bogus reference (to internally held garbage) is returned.
Definition at line 372 of file array.h.
References bounds_return.
Referenced by structures::bit_vector::find_first(), basis::astring::get(), structures::matrix< contents >::get(), structures::bit_vector::get(), sockets::socket_minder::get_pending_server(), textual::string_manipulation::hex_to_string(), structures::set< contents >::intersection(), structures::amorph< contents >::next_valid(), sockets::machine_uid::operator==(), structures::string_set::operator==(), basis::array< contents >::operator[](), basis::astring::operator[](), structures::set< contents >::set_union(), sockets::machine_uid::text_form(), sockets::machine_uid::type(), structures::set< contents >::unionize(), and sockets::span_manager::update().
outcome basis::array< contents >::insert | ( | int | index, |
int | new_indices | ||
) |
Adds "new_indices" new positions for objects into the array at "index".
Definition at line 803 of file array.h.
References access.
Referenced by structures::amorph< contents >::adjust(), basis::attach(), basis::astring::insert(), structures::amorph< contents >::insert(), structures::matrix< contents >::insert_row(), basis::astring::operator+=(), and sockets::socket_minder::put_pending_server().
|
inline |
|
inline |
|
inline |
|
inline |
Gritty Internal: the start of the actual stored data.
Definition at line 253 of file array.h.
Referenced by basis::astring::astring().
|
inline |
|
inline |
Returns the last valid element in the array.
Definition at line 118 of file array.h.
Referenced by filesystem::directory_tree::add_path(), basis::attach(), processes::launch_process::break_line(), basis::array< contents >::concatenation(), crypto::blowfish_crypto::decrypt(), structures::detach(), crypto::blowfish_crypto::encrypt(), cromp::cromp_transaction::flatten(), sockets::machine_uid::native(), crypto::rsa_crypto::private_decrypt(), crypto::rsa_crypto::private_encrypt(), crypto::rsa_crypto::public_decrypt(), crypto::rsa_crypto::public_encrypt(), sockets::socket_minder::push_receives(), sockets::spocket::receive(), sockets::spocket::receive_from(), and filesystem::directory_tree::remove_path().
|
inline |
Returns the current reported length of the allocated C array.
Definition at line 115 of file array.h.
Referenced by cromp::cromp_common::accumulated_bytes(), octopi::simple_entity_registry::add_entity(), filesystem::directory_tree::add_path(), octopi::octopus::add_tentacle(), unit_test::unit_base::assert_equal(), unit_test::unit_base::assert_not_equal(), basis::astring::astring(), structures::attach(), cromp::cromp_common::buffer_clog(), filesystem::heavy_file_operations::buffer_files(), textual::byte_formatter::bytes_to_shifted_string(), textual::byte_formatter::bytes_to_string(), filesystem::file_info::calculate(), octopi::infoton::check_classifier(), application::hoople_service::close_application(), compare_arrays(), filesystem::filename::compare_prefix(), filesystem::filename::compare_suffix(), filesystem::directory_tree::compare_trees(), structures::version::components(), basis::array< contents >::concatenate(), basis::array< contents >::concatenation(), sockets::spocket::connect(), structures::copy_hash_table(), textual::list_parsing::create_csv_line(), crypto::blowfish_crypto::decrypt(), structures::detach(), basis::detach(), basis::detach_flat(), sockets::tcpip_stack::dns_resolve(), structures::hash_table< key_type, contents >::elements(), structures::set< contents >::elements(), crypto::blowfish_crypto::encrypt(), sockets::tcpip_stack::enumerate_adapters(), octopi::octopus::evaluate(), octopi::infoton::fast_pack(), octopi::infoton::fast_unpack(), sockets::internet_address::fill(), sockets::tcpip_stack::fill_and_resolve(), structures::bit_vector::find_first(), cromp::cromp_transaction::flatten(), loggers::file_logger::format_bytes(), structures::version::get_component(), textual::list_parsing::get_ids_from_string(), versions::version_checker::get_language(), sockets::socket_minder::get_pending_server(), sockets::socket_minder::get_sockets(), sockets::socket_minder::handle_pending_connecters(), timely::timer_driver::handle_system_timer(), textual::string_manipulation::hex_to_string(), structures::set< contents >::intersection(), sockets::internet_address::is_valid_internet_address(), filesystem::filename::join(), filesystem::directory_tree::jump_to(), basis::astring::length(), octopi::octopus::lock_tentacle(), loggers::file_logger::log_bytes(), sockets::span_manager::make_missing_list(), sockets::span_manager::make_received_list(), sockets::machine_uid_array::member(), algorithms::merge(), algorithms::merge_sort(), cromp::cromp_transaction::minimum_flat_size(), sockets::machine_uid::native(), filesystem::filename_list::operator=(), configuration::table_configurator::operator=(), sockets::machine_uid::operator==(), basis::array< contents >::overwrite(), sockets::machine_uid::pack(), structures::pack_array(), structures::pack_simple(), geometric::angle< contents >::packed_size(), geometric::point< numeric_type >::packed_size(), geometric::rectangle< numeric_type >::packed_size(), filesystem::file_transfer_header::packed_size(), sockets::machine_uid::packed_size(), structures::packed_size(), structures::packed_size_array(), textual::byte_formatter::parse_dump(), cromp::cromp_transaction::peek_header(), cromp::cromp_common::pending_sends(), octopi::encryption_infoton::prepare_blowfish_key(), crypto::rsa_crypto::private_decrypt(), crypto::rsa_crypto::private_encrypt(), crypto::rsa_crypto::private_key(), bookmark_tree::process_category(), bookmark_tree::process_link(), crypto::rsa_crypto::public_decrypt(), crypto::rsa_crypto::public_encrypt(), sockets::socket_minder::push_receives(), sockets::socket_minder::push_sends(), textual::list_parsing::put_ids_in_string(), processes::process_control::query_process(), filesystem::byte_filer::read(), application::stdio_redirecter::read(), bookmark_tree::read_csv_file(), application::stdio_redirecter::read_stderr(), filesystem::directory::recursive_create(), octopi::octopus::remove_tentacle(), configuration::config_watcher::rescan(), filesystem::directory::rescan(), structures::hash_table< key_type, contents >::reset(), structures::bit_vector::reset(), sockets::tcpip_stack::resolve_any(), configuration::ini_parser::restate(), octopi::octopus::restore(), cromp::cromp_transaction::resynchronize(), octopi::SAFE_STATIC_CONST(), filesystem::directory_tree::seek(), sockets::raw_socket::select(), sockets::spocket::send(), cromp::cromp_common::send_buffer(), sockets::spocket::send_to(), structures::version::set_component(), crypto::rsa_crypto::set_key(), crypto::blowfish_crypto::set_key(), textual::byte_formatter::shifted_string_to_bytes(), sockets::socket_minder::snoozy_select(), processes::process_control::sort_by_name(), processes::process_control::sort_by_pid(), structures::string_set::string_set(), octopi::infoton::test_fast_unpack(), textual::byte_formatter::text_dump(), sockets::machine_uid::text_form(), sockets::socket_data::text_form(), sockets::tcpip_stack::this_host(), sockets::machine_uid::type(), cromp::cromp_transaction::unflatten(), sockets::machine_uid::unpack(), manifest_chunk::unpack(), sockets::span_manager::update(), structures::hash_table< key_type, contents >::verify(), structures::version::version(), whacking_spider(), filesystem::byte_filer::write(), application::stdio_redirecter::write(), filesystem::heavy_file_operations::write_file_chunk(), and structures::hash_table< key_type, contents >::zap().
|
inline |
Returns a pointer to the underlying C array of data.
The array contains "length()" number of objects in it. BE CAREFUL. This version is a constant peek at that pointer.
Definition at line 172 of file array.h.
Referenced by basis::attach(), textual::byte_formatter::bytes_to_shifted_string(), textual::byte_formatter::bytes_to_string(), filesystem::file_info::calculate(), basis::byte_array::comparator(), crypto::blowfish_crypto::decrypt(), basis::detach(), basis::detach_flat(), crypto::blowfish_crypto::encrypt(), footer_string(), octopi::octopus_entity::from_text(), structures::amorph< contents >::get(), loggers::file_logger::log_bytes(), basis::astring::observe(), basis::array< contents >::operator=(), basis::array< contents >::overwrite(), basis::astring::pack(), sockets::socket_minder::push_receives(), sockets::socket_minder::push_sends(), processes::launch_process::run(), sockets::spocket::send(), cromp::cromp_common::send_buffer(), sockets::spocket::send_to(), octopi::infoton::test_fast_unpack(), textual::byte_formatter::text_dump(), structures::unpack_array(), structures::unpack_simple(), filesystem::byte_filer::write(), application::stdio_redirecter::write(), and write_build_config::write_output_file().
|
inline |
Synonym for concatenation.
Definition at line 159 of file array.h.
References basis::array< contents >::concatenation().
|
inline |
Synonym for concatenation.
Definition at line 162 of file array.h.
References basis::array< contents >::concatenation().
|
inline |
Synonym for concatenate that modifies "this".
Definition at line 165 of file array.h.
References basis::array< contents >::concatenate().
|
inline |
Synonym for concatenate that modifies "this".
Definition at line 168 of file array.h.
References basis::array< contents >::concatenate().
array< contents > & basis::array< contents >::operator= | ( | const array< contents > & | copy_from | ) |
Copies the array in "copy_from" into this.
Definition at line 353 of file array.h.
References basis::array< contents >::observe().
Referenced by basis::array< contents >::array(), and structures::matrix< contents >::operator=().
|
inline |
Synonym for use that provides the expected array indexing syntax.
Definition at line 139 of file array.h.
References basis::array< contents >::use().
|
inline |
Synonym for get that provides the expected array indexing syntax.
Definition at line 137 of file array.h.
References basis::array< contents >::get().
Referenced by structures::matrix< contents >::get(), and structures::matrix< contents >::operator[]().
outcome basis::array< contents >::overwrite | ( | int | index, |
const array< contents > & | write_with, | ||
int | count = -1 |
||
) |
Stores the array "write_with" into the current array at the "index".
The current contents are overwritten with "write_with". If the index is invalid, then OUT_OF_RANGE is returned. If the "write_with" array cannot fit due to the boundaries of "this" array, then only the portion that can fit is used. If "count" is negative, the whole "write_with" array is used; otherwise, only "count" elements are used.
Definition at line 490 of file array.h.
References access, bounds_return, basis::array< contents >::length(), basis::negative(), and basis::array< contents >::observe().
Referenced by basis::array< contents >::concatenation(), and basis::astring::insert().
outcome basis::array< contents >::put | ( | int | index, |
const contents & | to_put | ||
) |
Stores an object at the index "index" in the array.
The outcome is "OUT_OF_RANGE" if the index does not exist.
Definition at line 834 of file array.h.
References access, and bounds_return.
Referenced by structures::hash_table< key_type, contents >::add(), structures::amorph< contents >::adjust(), basis::astring::astring(), basis::astring::operator+=(), basis::astring::to_lower(), and basis::astring::to_upper().
void basis::array< contents >::reset | ( | int | number = 0 , |
const contents * | initial_contents = NULL_POINTER |
||
) |
Resizes this array and sets the contents from an array of contents.
Definition at line 349 of file array.h.
References eml_to_txt::num.
Referenced by basis::astring::astring(), structures::bit_vector::bit_vector(), filesystem::heavy_file_operations::buffer_files(), structures::set< contents >::clear(), octopi::tentacle_helper< contents >::consume(), octopi::identity_tentacle::consume(), octopi::encryption_tentacle::consume(), octopi::unwrapping_tentacle::consume(), octopi::file_transfer_tentacle::consume(), octopi::login_tentacle::consume(), synchronic::list_manager::consume(), cromp::cromp_common::cromp_common(), filesystem::directory_tree::current(), crypto::blowfish_crypto::decrypt(), crypto::blowfish_crypto::encrypt(), sockets::tcpip_stack::enumerate_adapters(), sockets::machine_uid::expand(), octopi::infoton::fast_unpack(), filesystem::filename_list::fill(), crypto::blowfish_crypto::generate_key(), structures::matrix< contents >::get_column(), textual::list_parsing::get_ids_from_string(), structures::matrix< contents >::get_row(), configuration::section_manager::get_section_names(), filesystem::byte_filer::getline(), sockets::internet_address::is_valid_internet_address(), sockets::span_manager::make_missing_list(), sockets::span_manager::make_received_list(), structures::symbol_table< contents >::names(), textual::byte_formatter::parse_dump(), octopi::encryption_infoton::prepare_blowfish_key(), crypto::rsa_crypto::private_decrypt(), crypto::rsa_crypto::private_encrypt(), crypto::rsa_crypto::public_decrypt(), crypto::rsa_crypto::public_encrypt(), sockets::socket_minder::push_receives(), sockets::socket_minder::push_sends(), filesystem::byte_filer::read(), application::stdio_redirecter::read(), manifest_chunk::read_manifest(), application::stdio_redirecter::read_stderr(), sockets::spocket::receive(), sockets::spocket::receive_from(), octopi::file_transfer_tentacle::register_file_transfer(), filesystem::directory::rescan(), structures::matrix< contents >::reset(), sockets::machine_uid::reset(), basis::astring::reset(), versions::version_checker::retrieve_version_info(), configuration::table_configurator::sections(), filesystem::directory_tree::seek(), sockets::raw_socket::select(), filesystem::filename::separate(), octopi::infoton::set_classifier(), textual::byte_formatter::string_to_bytes(), cromp::cromp_transaction::unflatten(), structures::unpack_array(), structures::unpack_simple(), and filesystem::heavy_file_operations::write_file_chunk().
outcome basis::array< contents >::resize | ( | int | new_size, |
how_to_copy | way = NEW_AT_END |
||
) |
Changes the size of the C array to "new_size".
If "way" is NEW_AT_END and the array grows, then new space is added at the end and the prefix of the array is the same as the old array. If the "way" is NEW_AT_END, but the array shrinks, then the new array is a prefix of the old array. If "way" is NEW_AT_BEGINNING and the array grows, then the suffix of the array is the same as the old one and the space is added at the beginning. if the "way" is NEW_AT_BEGINNING but the array shrinks, then the new array is a suffix of the old array. if "way" is DONT_COPY, then the old contents are not copied. keep in mind that any newly visible elements can be in an arbitrary state and will not necessarily be freshly constructed.
FUNCDEF("resize");
Definition at line 585 of file array.h.
References basis::minimum(), and NULL_POINTER.
Referenced by structures::bit_vector::resize(), structures::bit_vector::set(), and structures::version::set_component().
outcome basis::array< contents >::retrain | ( | int | new_size, |
const contents * | to_copy | ||
) |
Resizes the C array and stuffs it with the contents in "to_copy".
FUNCDEF("retrain")
Definition at line 731 of file array.h.
Referenced by basis::array< contents >::array().
void basis::array< contents >::shift_data | ( | shift_directions | where | ) |
outcome basis::array< contents >::shrink |
|
inline |
Reports whether the templated object is a simple type or not.
Definition at line 127 of file array.h.
References basis::array< contents >::SIMPLE_COPY.
void basis::array< contents >::snarf | ( | array< contents > & | new_contents | ) |
outcome basis::array< contents >::stuff | ( | int | length, |
contents * | to_stuff | ||
) | const |
Copies at most "length" elements from this into the array "to_stuff".
This call will fail disastrously if "length" is larger than the array "to_stuff"'s allocated length.
Definition at line 476 of file array.h.
References basis::minimum().
Referenced by sockets::spocket::connect(), sockets::tcpip_stack::convert(), and sockets::tcpip_stack::resolve_any().
array< contents > basis::array< contents >::subarray | ( | int | start, |
int | end | ||
) | const |
Returns the array segment between the indices "start" and "end".
This is all characters from "start" to "end" inclusively, as long as those values are valid for this array. Even then, an intelligent default is usually assumed if the indices are out of range.
Definition at line 443 of file array.h.
References bounds_return, and NULL_POINTER.
Referenced by structures::detach(), octopi::infoton::fast_unpack(), cromp::cromp_transaction::flatten(), filesystem::directory_tree::jump_to(), algorithms::merge_sort(), sockets::machine_uid::native(), filesystem::directory::recursive_create(), application::stdio_redirecter::std_thread_action(), octopi::infoton::test_fast_unpack(), cromp::cromp_transaction::unflatten(), sockets::machine_uid::unpack(), and manifest_chunk::unpack().
void basis::array< contents >::swap_contents | ( | array< contents > & | other | ) |
Exchanges the contents of "this" and "other".
No validation is performed but this should always succeed given arrays constructed properly.
Definition at line 452 of file array.h.
References basis::swap_values().
Referenced by basis::astring::shrink(), structures::amorph< contents >::swap_contents(), structures::unpack_array(), and structures::unpack_simple().
contents & basis::array< contents >::use | ( | int | index | ) |
A non-constant version of get(); the returned object can be modified.
Definition at line 365 of file array.h.
References access, and bounds_return.
Referenced by structures::hash_table< key_type, contents >::apply(), basis::array< contents >::operator[](), basis::astring::operator[](), and structures::bit_vector::resize().
outcome basis::array< contents >::zap | ( | int | start, |
int | end | ||
) |
Deletes from "this" the objects inclusively between "start" and "end".
C-array conventions are used (0 through length()-1 are valid if length() > 0). If either index is out of range, then a default is assumed.
Definition at line 769 of file array.h.
References bounds_return.
Referenced by structures::hash_table< key_type, contents >::acquire(), application::command_line::command_line(), filesystem::directory_tree::compare_trees(), crypto::blowfish_crypto::decrypt(), structures::detach(), basis::detach(), basis::detach_flat(), crypto::blowfish_crypto::encrypt(), octopi::infoton::fast_unpack(), sockets::socket_minder::get_pending_server(), algorithms::merge(), crypto::rsa_crypto::private_decrypt(), crypto::rsa_crypto::public_decrypt(), sockets::socket_minder::push_receives(), sockets::socket_minder::push_sends(), filesystem::byte_filer::read(), sockets::spocket::receive(), sockets::spocket::receive_from(), structures::set< contents >::remove_index(), structures::hash_table< key_type, contents >::reset(), sockets::raw_socket::select(), cromp::cromp_common::send_buffer(), structures::snag_out(), sockets::socket_minder::snoozy_select(), cromp::cromp_transaction::unflatten(), sockets::machine_uid::unpack(), manifest_chunk::unpack(), structures::hash_table< key_type, contents >::zap(), basis::astring::zap(), structures::amorph< contents >::zap(), structures::matrix< contents >::zap_column(), and structures::matrix< contents >::zap_row().