#include <array.h>


Public Types | |
| enum | special_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 | shift_directions { TO_LEFT, TO_RIGHT } |
Public Member Functions | |
| array (int number=0, const contents *init=NIL, u_short flags=EXPONENTIAL_GROWTH|FLUSH_INVISIBLE) | |
| Constructs an array with room for "number" objects. | |
| array (const array< contents > ©_from) | |
| copies the contents & sizing information from "copy_from". | |
| ~array () | |
| destroys the memory allocated for the objects. | |
| void | reset (int number=0, const contents *initial_contents=NIL) |
| Resizes this array and sets the contents from an array of contents. | |
| array & | operator= (const array< contents > ©_from) |
| Copies the array in "copy_from" into this. | |
| int | length () const |
| Returns the current reported length of the allocated C array. | |
| int | last () const |
| Returns the last valid element in the array. | |
| u_short | flags () const |
| Provides the raw flags value, without interpreting what it means. | |
| bool | exponential () const |
| Returns true if this allocator will grow exponentially on resize. | |
| bool | simple () const |
| Reports whether the templated object is a simple type or not. | |
| const contents & | get (int index) const |
| Accesses individual objects stored in "this" at the "index" position. | |
| contents & | use (int index) |
| A non-constant version of get(); the returned object can be modified. | |
| const contents & | operator[] (int index) const |
| Synonym for get that provides the expected array indexing syntax. | |
| contents & | operator[] (int index) |
| Synonym for use that provides the expected array indexing syntax. | |
| outcome | put (int index, const contents &to_put) |
| Stores an object at the index "index" in the array. | |
| array | concatenation (const array &to_concatenate) const |
| Returns the concatenation of "this" and the array "to_concatenate". | |
| array | concatenation (const contents &to_concatenate) const |
| Returns the concatenation of "this" and the object "to_concatenate". | |
| array & | concatenate (const array &to_concatenate) |
| Appends the array "to_concatenate" onto "this" and returns "this". | |
| array & | concatenate (const contents &to_concatenate) |
| Appends the object "to_concatenate" onto "this" and returns "this". | |
| array & | concatenate (const contents *to_concatenate, int length) |
| Concatenates a C-array "to_concatenate" onto "this" and returns "this". | |
| array | operator+ (const array &to_cat) const |
| Synonym for concatenation. | |
| array | operator+ (const contents &to_concatenate) const |
| Synonym for concatenation. | |
| array & | operator+= (const array &to_concatenate) |
| Synonym for concatenate that modifies "this". | |
| array & | operator+= (const contents &to_concatenate) |
| Synonym for concatenate that modifies "this". | |
| const contents * | observe () const |
| Returns a pointer to the underlying C array of data. | |
| contents * | access () |
| A non-constant access of the underlying C-array. BE REALLY CAREFUL. | |
| void | swap_contents (array< contents > &other) |
| Exchanges the contents of "this" and "other". | |
| void | snarf (array &new_contents) |
| Drops "this" array's contents into the dustbin and uses "new_contents". | |
| array | subarray (int start, int end) const |
| Returns the array segment between the indices "start" and "end". | |
| outcome | insert (int index, int new_indices) |
| Adds "new_indices" new positions for objects into the array at "index". | |
| outcome | overwrite (int index, const array &write_with, int count=-1) |
| Stores the array "write_with" into the current array at the "index". | |
| outcome | stuff (int length, contents *to_stuff) const |
| Copies at most "length" elements from this into the array "to_stuff". | |
| outcome | resize (int new_size, common::how_to_copy way=common::NEW_AT_END) |
| Changes the size of the C array to "new_size". | |
| outcome | zap (int start, int end) |
| Deletes from "this" the objects inclusively between "start" and "end". | |
| outcome | shrink () |
| Cuts loose any allocated space that is beyond the real length. | |
| outcome | retrain (int new_size, const contents *to_copy) |
| Resizes the C array and stuffs it with the contents in "to_copy". | |
| void | shift_data (shift_directions where) |
| The valid portion of the array is moved to the left or right. | |
| int | internal_real_length () const |
| Gritty Internal: the real allocated length. | |
| int | internal_offset () const |
| Gritty Internal: the offset from real start to stored data. | |
| const contents * | internal_block_start () const |
| Gritty Internal: constant peek at the real allocated pointer. | |
| contents * | internal_block_start () |
| Gritty Internal: the real allocated pointer made accessible. | |
| contents *const * | internal_offset_mem () const |
| Gritty Internal: the start of the actual stored data. | |
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.
Definitions:
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.
Definition at line 48 of file array.h.
| enum array::special_flags |
the flags specify how the array treats its contents and its length.
| enum array::shift_directions |
| array< contents >::array | ( | int | number = 0, |
|
| const contents * | init = NIL, |
|||
| u_short | flags = EXPONENTIAL_GROWTH | FLUSH_INVISIBLE | |||
| ) | [inline] |
Constructs an array with room for "number" objects.
The initial contents are copied from "init" unless NIL is passed in instead. If "init" is not NIL, 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 303 of file array.h.
References CAUSE_BREAKPOINT, array< contents >::EXPONE, array< contents >::FLUSH_INVISIBLE, and array< contents >::retrain().
copies the contents & sizing information from "copy_from".
Definition at line 328 of file array.h.
References array< contents >::_active_length, and array< contents >::operator=().
| void array< contents >::reset | ( | int | number = 0, |
|
| const contents * | initial_contents = NIL | |||
| ) | [inline] |
Resizes this array and sets the contents from an array of contents.
Definition at line 346 of file array.h.
References array< contents >::retrain().
Referenced by bit_vector::bit_vector(), blowfish_decryption(), blowfish_encryption(), heavy_file_operations::buffer_files(), basis::set< istring >::clear(), smtp_client::clear_carbons(), smtp_client::clear_recipients(), login_tentacle::consume(), file_transfer_tentacle::consume(), encryption_tentacle::consume(), tentacle_helper< unhandled_request >::consume(), identity_tentacle::consume(), cromp_common::cromp_common(), directory_tree::current(), ice_key::decrypt(), blowfish_crypto::decrypt(), buffer::dump(), ice_key::encrypt(), blowfish_crypto::encrypt(), tcpip_stack::enumerate_adapters(), machine_uid::expand(), infoton::fast_unpack(), filename_list::fill(), generate_key(), blowfish_crypto::generate_key(), matrix< contents >::get_column(), list_parsing::get_ids_from_string(), list_parsing::get_positions(), matrix< contents >::get_row(), section_manager::get_section_names(), list_parsing::get_values_from_string(), byte_filer::getline(), internet_address::is_valid_internet_address(), istring::istring(), main(), span_manager::make_missing_list(), span_manager::make_received_list(), symbol_table< contents >::names(), file_transfer_infoton::package_tree_info(), byte_format::parse_dump(), encryption_infoton::prepare_blowfish_key(), RSA_crypto::private_decrypt(), RSA_crypto::private_encrypt(), provide_init_vect(), RSA_crypto::public_decrypt(), RSA_crypto::public_encrypt(), drawing_window::pull_out_mice(), drawing_window::push_in_mice(), socket_minder::push_receives(), socket_minder::push_sends(), stdio_redirecter::read(), byte_filer::read(), manifest_chunk::read_manifest(), stdio_redirecter::read_stderr(), spocket::receive(), spocket::receive_from(), directory::rescan(), bubble::reset(), matrix< contents >::reset(), istring::reset(), machine_uid::reset(), version_checker::retrieve_version_info(), rsa_private_decryption(), rsa_private_encryption(), rsa_public_decryption(), rsa_public_encryption(), run_test_36(), table_configurator::sections(), directory_tree::seek(), raw_socket::select(), filename::separate(), infoton::set_classifier(), array< contents >::snarf(), byte_format::string_to_bytes(), cromp_transaction::unflatten(), basis::unpack(), basis::unpack_simple(), and heavy_file_operations::write_file_chunk().
| array< contents > & array< contents >::operator= | ( | const array< contents > & | copy_from | ) | [inline] |
Copies the array in "copy_from" into this.
Definition at line 350 of file array.h.
References array< contents >::_active_length, array< contents >::_flags, array< contents >::observe(), and array< contents >::retrain().
Referenced by array< contents >::array(), matrix< contents >::operator=(), and argument_list::operator=().
| int array< contents >::length | ( | ) | const [inline] |
Returns the current reported length of the allocated C array.
Definition at line 96 of file array.h.
Referenced by cromp_common::accumulated_bytes(), simple_entity_registry::add_entity(), directory_tree::add_path(), octopus::add_tentacle(), life_maintainer::apply(), basis::attach(), query_handler::bind_columns(), blowfish_decryption(), blowfish_encryption(), buffer::buffer(), cromp_common::buffer_clog(), heavy_file_operations::buffer_files(), byte_format::bytes_to_shifted_string(), byte_format::bytes_to_string(), file_info::calculate(), infoton::check_classifier(), averager< contents >::check_for_compaction(), check_hostname(), shutdown_alerter::close_application(), averager< contents >::compact(), compare(), compare_arrays(), filename::compare_prefix(), filename::compare_suffix(), directory_tree::compare_trees(), version::components(), array< contents >::concatenate(), array< contents >::concatenation(), spocket::connect(), recursive_file_copy::copy_hierarchy(), list_parsing::create_csv_line(), bubble::data_length(), ice_key::decrypt(), blowfish_crypto::decrypt(), basis::detach(), detach_flat(), tcpip_stack::dns_resolve(), buffer::dump(), basis::set< istring >::elements(), ice_key::encrypt(), blowfish_crypto::encrypt(), tcpip_stack::enumerate_adapters(), octopus::evaluate(), portable::exiting_child_signal_handler(), fake_pack(), infoton::fast_pack(), infoton::fast_unpack(), internet_address::fill(), tcpip_stack::fill_and_resolve(), sequence< contents >::find(), bit_vector::find_first(), process_control::find_process_in_list(), cromp_transaction::flatten(), formal(), column_headers::format(), file_logger::format_bytes(), version::get_component(), list_parsing::get_ids_from_string(), version_checker::get_language(), socket_minder::get_pending_server(), list_parsing::get_positions(), socket_minder::get_sockets(), example_rpc_client::get_some_points(), list_parsing::get_values_from_string(), socket_minder::handle_pending_connecters(), timer_driver::handle_system_timer(), string_manipulation::hex_to_string(), service_root::initialize(), array< contents >::insert(), internet_address::is_valid_internet_address(), filename::join(), directory_tree::jump_to(), averager< int >::length(), istring::length(), octopus::lock_tentacle(), file_logger::log_bytes(), main(), span_manager::make_missing_list(), span_manager::make_received_list(), machine_uid_array::member(), cromp_transaction::minimum_flat_size(), machine_uid::native(), bubble::non_data_overhead(), list_dialog::OnInitDialog(), filename_list::operator=(), table_configurator::operator=(), byte_array::operator==(), machine_uid::operator==(), array< contents >::overwrite(), basis::pack(), machine_uid::pack(), basis::pack_simple(), bubble::packed_size(), basis::packed_size(), istring::pad(), list_parsing::parse_csv_line(), byte_format::parse_dump(), zing_table::peek_event(), zing_table::peek_events(), cromp_transaction::peek_header(), cromp_common::pending_sends(), zing_table::pop_event(), zing_table::pop_events(), encryption_infoton::prepare_blowfish_key(), RSA_crypto::private_decrypt(), RSA_crypto::private_encrypt(), RSA_crypto::private_key(), bookmark_tree::process_category(), example_rpc_server::process_client_request(), grid_processor::process_grid_files(), faux_grid_processor::process_grid_files(), bookmark_tree::process_link(), RSA_crypto::public_decrypt(), RSA_crypto::public_encrypt(), drawing_window::pull_out_mice(), drawing_window::push_in_mice(), socket_minder::push_receives(), socket_minder::push_sends(), list_parsing::put_ids_in_string(), process_control::query_process(), stdio_redirecter::read(), byte_filer::read(), bookmark_tree::read_csv_file(), stdio_redirecter::read_stderr(), directory::recursive_create(), smtp_client::remove_carbon(), smtp_client::remove_recipient(), octopus::remove_tentacle(), directory::rescan(), config_watcher::rescan(), bit_vector::reset(), grid_processor::reset_data_fields(), faux_grid_processor::reset_data_fields(), tcpip_stack::resolve_any(), ini_parser::restate(), octopus::restore(), cromp_transaction::resynchronize(), rsa_private_decryption(), rsa_private_encryption(), rsa_public_decryption(), rsa_public_encryption(), run_test_36(), SAFE_STATIC_CONST(), directory_tree::seek(), raw_socket::select(), spocket::send(), cromp_common::send_buffer(), smtp_client::send_email(), spocket::send_to(), ice_key::set(), version::set_component(), RSA_crypto::set_key(), blowfish_crypto::set_key(), byte_format::shifted_string_to_bytes(), show_build_type(), zing_table::show_events(), show_versions(), socket_minder::snoozy_select(), process_control::sort_by_name(), process_control::sort_by_pid(), stamping_spider(), string_set::string_set(), array< contents >::stuff(), test_byte_array_amorph(), infoton::test_fast_unpack(), test_stack_with_objects(), test_stack_with_pointers(), byte_format::text_dump(), directory_tree::text_form(), socket_data::text_form(), machine_uid::text_form(), tcpip_stack::this_host(), machine_uid::type(), cromp_transaction::unflatten(), file_time::unpack(), machine_uid::unpack(), ipc_address::unpack(), serial_port_address::unpack(), internet_address::unpack(), manifest_chunk::unpack(), span_manager::update(), version::version(), whacking_spider(), stdio_redirecter::write(), byte_filer::write(), grid_processor::write_data_fields(), faux_grid_processor::write_data_fields(), grid_processor::write_fields_for_row(), faux_grid_processor::write_fields_for_row(), heavy_file_operations::write_file_chunk(), zing_table::zing_event(), basis::char_star_array::~char_star_array(), and scheduler::~scheduler().
| int array< contents >::last | ( | ) | const [inline] |
Returns the last valid element in the array.
Definition at line 99 of file array.h.
Referenced by directory_tree::add_path(), list_dialog::add_string(), basis::attach(), blowfish_decryption(), blowfish_encryption(), portable::break_line(), array< contents >::concatenate(), array< contents >::concatenation(), basis::detach(), sequence< contents >::find(), cromp_transaction::flatten(), array< contents >::get(), array< contents >::insert(), machine_uid::native(), array< contents >::overwrite(), list_parsing::parse_csv_line(), RSA_crypto::private_decrypt(), RSA_crypto::private_encrypt(), RSA_crypto::public_decrypt(), RSA_crypto::public_encrypt(), socket_minder::push_receives(), array< contents >::put(), spocket::receive(), spocket::receive_from(), directory_tree::remove_path(), rsa_private_decryption(), rsa_private_encryption(), rsa_public_decryption(), rsa_public_encryption(), array< contents >::subarray(), and array< contents >::use().
Provides the raw flags value, without interpreting what it means.
Definition at line 102 of file array.h.
Referenced by basis::set< contents >::intersection(), basis::unpack(), and basis::unpack_simple().
| bool array< contents >::exponential | ( | ) | const [inline] |
Returns true if this allocator will grow exponentially on resize.
Definition at line 105 of file array.h.
Referenced by array< contents >::resize().
| bool array< contents >::simple | ( | ) | const [inline] |
Reports whether the templated object is a simple type or not.
Definition at line 108 of file array.h.
Referenced by array< contents >::concatenate(), array< contents >::concatenation(), array< contents >::insert(), array< contents >::overwrite(), array< contents >::put(), array< contents >::resize(), array< contents >::retrain(), array< contents >::shift_data(), array< contents >::stuff(), and array< contents >::zap().
| const contents & array< contents >::get | ( | int | index | ) | const [inline] |
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.
Reimplemented in picture, amorph< contents >, amorph< bucket< istring, internal_symbol_info< search_record > > >, amorph< bucket< int, mail_cabinet > >, amorph< bucket< istring, recognized_entity > >, amorph< file_transfer_record >, amorph< cromp_client >, amorph< driven_object_record >, amorph< bucket< void *, internal_pointer_hider< test_content > > >, amorph< range_record >, amorph< bucket< istring, internal_symbol_info< test_content > > >, amorph< bucket< void *, internal_pointer_hider< contents > > >, amorph< bucket< octopus_entity, entity_basket > >, amorph< nodes::internal_link >, amorph< bucket< void *, internal_pointer_hider< search_record > > >, amorph< bucket< istring, contents > >, amorph< bucket< void *, internal_pointer_hider< istring > > >, amorph< link_record >, amorph< file_info >, amorph< bucket< istring, internal_symbol_info< contents > > >, amorph< infoton_record >, amorph< bucket< void *, internal_pointer_hider< nodes::symbol_tree * > > >, amorph< bucket< void *, internal_pointer_hider< item_record > > >, amorph< infoton_id_pair >, amorph< letter >, amorph< infoton_holder >, amorph< bucket< istring, internal_symbol_info< dns_entry > > >, amorph< bucket< istring, internal_symbol_info< byte_array > > >, amorph< bucket< int, living_item > >, amorph< configlet >, amorph< buffer_base >, amorph< bucket< istring, internal_symbol_info< octenc_key_record > > >, amorph< db_row >, amorph< actor_thread >, amorph< bucket< istring, internal_symbol_info< int > > >, amorph< bucket< int, sequence_record > >, amorph< cromp_client_record >, amorph< bucket< void *, internal_pointer_hider< int > > >, amorph< bucket< void *, live_object_info > >, amorph< menu_common_base >, amorph< bucket< int, contents > >, amorph< bucket< int, value_record > >, amorph< tentacle_record >, amorph< bucket< key_type, contents > >, amorph< bucket< void *, internal_pointer_hider< string_table > > >, amorph< bucket< void *, internal_pointer_hider< dns_entry > > >, amorph< thread_record >, amorph< bucket< int, queued_zings > >, amorph< attribute_bundle >, amorph< bucket< void *, internal_pointer_hider< byte_array > > >, amorph< picture_part >, amorph< host_record >, amorph< bucket< int, data_shuttle > >, amorph< bucket< istring, internal_symbol_info< item_record > > >, amorph< bucket< istring, internal_symbol_info< istring > > >, amorph< istring >, amorph< bucket< void *, internal_pointer_hider< octenc_key_record > > >, amorph< bucket< istring, internal_symbol_info< nodes::symbol_tree * > > >, amorph< bucket< int, ml_memory_record > >, amorph< event_record >, amorph< printed_page >, amorph< socket_data >, amorph< bucket< int, connection > >, amorph< wp_menu_item >, amorph< bucket< istring, internal_symbol_info< string_table > > >, and amorph< bucket< void *, contents > >.
Definition at line 370 of file array.h.
References bounds_halt, FUNCDEF, array< contents >::last(), and array< contents >::observe().
Referenced by bit_vector::find_first(), averager< int >::get(), matrix< contents >::get(), bit_vector::get(), istring::get(), query_handler::get_bound_int(), socket_minder::get_pending_server(), string_manipulation::hex_to_string(), list_box::list_box_callback(), main(), amorph< contents >::next_valid(), string_set::operator==(), machine_uid::operator==(), istring::operator[](), query_handler::print_row(), drawing_window::pull_out_mice(), smtp_client::remove_carbon(), smtp_client::remove_recipient(), smtp_client::send_email(), query_handler::show_this_row(), machine_uid::text_form(), machine_uid::type(), and span_manager::update().
| contents & array< contents >::use | ( | int | index | ) | [inline] |
A non-constant version of get(); the returned object can be modified.
Definition at line 362 of file array.h.
References array< contents >::access(), bounds_halt, FUNCDEF, and array< contents >::last().
Referenced by query_handler::bind_columns(), istring::operator[](), array< letter * >::operator[](), bit_vector::resize(), and basis::char_star_array::~char_star_array().
| const contents& array< contents >::operator[] | ( | int | index | ) | const [inline] |
Synonym for get that provides the expected array indexing syntax.
Reimplemented in amorph< contents >, matrix< contents >, amorph< bucket< istring, internal_symbol_info< search_record > > >, amorph< bucket< int, mail_cabinet > >, amorph< bucket< istring, recognized_entity > >, amorph< file_transfer_record >, amorph< cromp_client >, amorph< driven_object_record >, amorph< bucket< void *, internal_pointer_hider< test_content > > >, amorph< range_record >, amorph< bucket< istring, internal_symbol_info< test_content > > >, amorph< bucket< void *, internal_pointer_hider< contents > > >, amorph< bucket< octopus_entity, entity_basket > >, amorph< nodes::internal_link >, amorph< bucket< void *, internal_pointer_hider< search_record > > >, amorph< bucket< istring, contents > >, amorph< bucket< void *, internal_pointer_hider< istring > > >, amorph< link_record >, amorph< file_info >, amorph< bucket< istring, internal_symbol_info< contents > > >, amorph< infoton_record >, amorph< bucket< void *, internal_pointer_hider< nodes::symbol_tree * > > >, amorph< bucket< void *, internal_pointer_hider< item_record > > >, amorph< infoton_id_pair >, amorph< letter >, amorph< infoton_holder >, amorph< bucket< istring, internal_symbol_info< dns_entry > > >, amorph< bucket< istring, internal_symbol_info< byte_array > > >, amorph< bucket< int, living_item > >, amorph< configlet >, amorph< buffer_base >, amorph< bucket< istring, internal_symbol_info< octenc_key_record > > >, amorph< db_row >, amorph< actor_thread >, amorph< bucket< istring, internal_symbol_info< int > > >, amorph< bucket< int, sequence_record > >, amorph< cromp_client_record >, amorph< bucket< void *, internal_pointer_hider< int > > >, amorph< bucket< void *, live_object_info > >, amorph< menu_common_base >, amorph< bucket< int, contents > >, amorph< bucket< int, value_record > >, amorph< tentacle_record >, amorph< bucket< key_type, contents > >, amorph< bucket< void *, internal_pointer_hider< string_table > > >, amorph< bucket< void *, internal_pointer_hider< dns_entry > > >, amorph< thread_record >, amorph< bucket< int, queued_zings > >, amorph< attribute_bundle >, amorph< bucket< void *, internal_pointer_hider< byte_array > > >, amorph< picture_part >, amorph< host_record >, amorph< bucket< int, data_shuttle > >, amorph< bucket< istring, internal_symbol_info< item_record > > >, amorph< bucket< istring, internal_symbol_info< istring > > >, amorph< istring >, amorph< bucket< void *, internal_pointer_hider< octenc_key_record > > >, amorph< bucket< istring, internal_symbol_info< nodes::symbol_tree * > > >, amorph< bucket< int, ml_memory_record > >, amorph< event_record >, amorph< printed_page >, amorph< socket_data >, amorph< bucket< int, connection > >, amorph< wp_menu_item >, amorph< bucket< istring, internal_symbol_info< string_table > > >, amorph< bucket< void *, contents > >, matrix< double >, matrix< int >, matrix< jethro >, and matrix< istring >.
Definition at line 118 of file array.h.
Referenced by matrix< contents >::get(), and matrix< contents >::operator[]().
| contents& array< contents >::operator[] | ( | int | index | ) | [inline] |
Synonym for use that provides the expected array indexing syntax.
Reimplemented in amorph< contents >, matrix< contents >, geometric::polygon, amorph< bucket< istring, internal_symbol_info< search_record > > >, amorph< bucket< int, mail_cabinet > >, amorph< bucket< istring, recognized_entity > >, amorph< file_transfer_record >, amorph< cromp_client >, amorph< driven_object_record >, amorph< bucket< void *, internal_pointer_hider< test_content > > >, amorph< range_record >, amorph< bucket< istring, internal_symbol_info< test_content > > >, amorph< bucket< void *, internal_pointer_hider< contents > > >, amorph< bucket< octopus_entity, entity_basket > >, amorph< nodes::internal_link >, amorph< bucket< void *, internal_pointer_hider< search_record > > >, amorph< bucket< istring, contents > >, amorph< bucket< void *, internal_pointer_hider< istring > > >, amorph< link_record >, amorph< file_info >, amorph< bucket< istring, internal_symbol_info< contents > > >, amorph< infoton_record >, amorph< bucket< void *, internal_pointer_hider< nodes::symbol_tree * > > >, amorph< bucket< void *, internal_pointer_hider< item_record > > >, amorph< infoton_id_pair >, amorph< letter >, amorph< infoton_holder >, amorph< bucket< istring, internal_symbol_info< dns_entry > > >, amorph< bucket< istring, internal_symbol_info< byte_array > > >, amorph< bucket< int, living_item > >, amorph< configlet >, amorph< buffer_base >, amorph< bucket< istring, internal_symbol_info< octenc_key_record > > >, amorph< db_row >, amorph< actor_thread >, amorph< bucket< istring, internal_symbol_info< int > > >, amorph< bucket< int, sequence_record > >, amorph< cromp_client_record >, amorph< bucket< void *, internal_pointer_hider< int > > >, amorph< bucket< void *, live_object_info > >, amorph< menu_common_base >, amorph< bucket< int, contents > >, amorph< bucket< int, value_record > >, amorph< tentacle_record >, amorph< bucket< key_type, contents > >, amorph< bucket< void *, internal_pointer_hider< string_table > > >, amorph< bucket< void *, internal_pointer_hider< dns_entry > > >, amorph< thread_record >, amorph< bucket< int, queued_zings > >, amorph< attribute_bundle >, amorph< bucket< void *, internal_pointer_hider< byte_array > > >, amorph< picture_part >, amorph< host_record >, amorph< bucket< int, data_shuttle > >, amorph< bucket< istring, internal_symbol_info< item_record > > >, amorph< bucket< istring, internal_symbol_info< istring > > >, amorph< istring >, amorph< bucket< void *, internal_pointer_hider< octenc_key_record > > >, amorph< bucket< istring, internal_symbol_info< nodes::symbol_tree * > > >, amorph< bucket< int, ml_memory_record > >, amorph< event_record >, amorph< printed_page >, amorph< socket_data >, amorph< bucket< int, connection > >, amorph< wp_menu_item >, amorph< bucket< istring, internal_symbol_info< string_table > > >, amorph< bucket< void *, contents > >, matrix< double >, matrix< int >, matrix< jethro >, and matrix< istring >.
| outcome array< contents >::put | ( | int | index, | |
| const contents & | to_put | |||
| ) | [inline] |
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 837 of file array.h.
References array< contents >::access(), bounds_halt, FUNCDEF, array< contents >::last(), and array< contents >::simple().
Referenced by amorph< contents >::adjust(), istring::istring(), istring::operator+=(), istring::to_lower(), and istring::to_upper().
| array< contents > array< contents >::concatenation | ( | const array< contents > & | to_concatenate | ) | const [inline] |
Returns the concatenation of "this" and the array "to_concatenate".
Definition at line 420 of file array.h.
References array< contents >::_flags, array< contents >::length(), NIL, and array< contents >::overwrite().
Referenced by array< letter * >::operator+().
| array< contents > array< contents >::concatenation | ( | const contents & | to_concatenate | ) | const [inline] |
Returns the concatenation of "this" and the object "to_concatenate".
Definition at line 430 of file array.h.
References array< contents >::access(), array< contents >::last(), array< contents >::length(), NIL, array< contents >::overwrite(), and array< contents >::simple().
| array< contents > & array< contents >::concatenate | ( | const array< contents > & | to_concatenate | ) | [inline] |
Appends the array "to_concatenate" onto "this" and returns "this".
Definition at line 378 of file array.h.
References array< contents >::length(), common::NEW_AT_END, array< contents >::overwrite(), and array< contents >::resize().
Referenced by basis::set< contents >::add(), attach_flat(), basis::set< contents >::intersection(), span_manager::make_missing_list(), span_manager::make_received_list(), array< letter * >::operator+=(), directory::rescan(), and string_manipulation::string_to_hex().
| array< contents > & array< contents >::concatenate | ( | const contents & | to_concatenate | ) | [inline] |
Appends the object "to_concatenate" onto "this" and returns "this".
Definition at line 393 of file array.h.
References array< contents >::access(), array< contents >::last(), array< contents >::length(), common::NEW_AT_END, array< contents >::resize(), and array< contents >::simple().
| array< contents > & array< contents >::concatenate | ( | const contents * | to_concatenate, | |
| int | length | |||
| ) | [inline] |
Concatenates a C-array "to_concatenate" onto "this" and returns "this".
There must be at least "length" elements in "to_concatenate".
Definition at line 404 of file array.h.
References array< contents >::access(), array< contents >::length(), common::NEW_AT_END, array< contents >::resize(), and array< contents >::simple().
| array& array< contents >::operator+= | ( | const contents & | to_concatenate | ) | [inline] |
Synonym for concatenate that modifies "this".
Reimplemented in basis::set< contents >, basis::set< octopus_entity >, basis::set< int >, basis::set< void * >, basis::set< octopus_request_id >, and basis::set< istring >.
| const contents* array< contents >::observe | ( | ) | const [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 153 of file array.h.
Referenced by basis::attach(), blowfish_decryption(), blowfish_encryption(), byte_format::bytes_to_shifted_string(), byte_format::bytes_to_string(), file_info::calculate(), blowfish_crypto::decrypt(), secret_string::decrypt_string(), basis::detach(), detach_flat(), buffer::dump(), blowfish_crypto::encrypt(), footer_string(), formal(), octopus_entity::from_text(), amorph< contents >::get(), array< contents >::get(), array< contents >::insert(), portable::launch_process(), file_logger::log_bytes(), main(), istring::observe(), array< contents >::operator=(), byte_array::operator==(), array< contents >::overwrite(), istring::pack(), istring::pad(), socket_minder::push_receives(), socket_minder::push_sends(), spocket::send(), cromp_common::send_buffer(), smtp_client::send_email(), spocket::send_to(), array< contents >::stuff(), array< contents >::subarray(), infoton::test_fast_unpack(), test_stack_with_objects(), test_stack_with_pointers(), byte_format::text_dump(), unpack(), stdio_redirecter::write(), byte_filer::write(), and write_build_config::write_output_file().
| contents* array< contents >::access | ( | ) | [inline] |
A non-constant access of the underlying C-array. BE REALLY CAREFUL.
Definition at line 156 of file array.h.
Referenced by istring::access(), amorph< contents >::acquire(), amorph< contents >::borrow(), buffer::buffer(), array< contents >::concatenate(), array< contents >::concatenation(), fake_amorph_unpack(), version_checker::get_language(), version_checker::get_record(), version_checker::get_version(), byte_filer::getline(), array< contents >::insert(), istring::istring(), palette::operator=(), array< contents >::overwrite(), istring::pad(), palette::palette(), nechung_oracle::pick_random(), RSA_crypto::private_decrypt(), RSA_crypto::private_encrypt(), RSA_crypto::private_key(), RSA_crypto::public_decrypt(), RSA_crypto::public_encrypt(), RSA_crypto::public_key(), amorph< contents >::put(), array< contents >::put(), byte_filer::read(), spocket::receive(), spocket::receive_from(), directory::rescan(), bit_vector::reset(), version_checker::retrieve_version_info(), rsa_private_decryption(), rsa_private_encryption(), rsa_public_decryption(), rsa_public_encryption(), RSA_crypto::set_key(), stdio_redirecter::std_thread_action(), test_byte_array_amorph(), test_stack_with_objects(), test_stack_with_pointers(), system_values::text_form(), and array< contents >::use().
| void array< contents >::swap_contents | ( | array< contents > & | other | ) | [inline] |
Exchanges the contents of "this" and "other".
No validation is performed but this should always succeed given arrays constructed properly.
Definition at line 451 of file array.h.
References array< contents >::_active_length, array< contents >::_flags, array< contents >::_mem_block, array< contents >::_offset, array< contents >::_real_length, and swap_values().
Referenced by istring::shrink(), array< contents >::shrink(), array< contents >::snarf(), and amorph< contents >::swap_contents().
| void array< contents >::snarf | ( | array< contents > & | new_contents | ) | [inline] |
Drops "this" array's contents into the dustbin and uses "new_contents".
Afterwards, "new_contents" is an empty array and what used to be stored there is now in "this" instead.
Definition at line 849 of file array.h.
References array< contents >::reset(), and array< contents >::swap_contents().
Referenced by buffer::buffer().
| array< contents > array< contents >::subarray | ( | int | start, | |
| int | end | |||
| ) | const [inline] |
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 442 of file array.h.
References bounds_return, array< contents >::last(), NIL, and array< contents >::observe().
Referenced by basis::detach(), infoton::fast_unpack(), sequence< contents >::find(), cromp_transaction::flatten(), directory_tree::jump_to(), machine_uid::native(), directory::recursive_create(), stdio_redirecter::std_thread_action(), infoton::test_fast_unpack(), cromp_transaction::unflatten(), machine_uid::unpack(), and manifest_chunk::unpack().
Adds "new_indices" new positions for objects into the array at "index".
Reimplemented in amorph< contents >, amorph< bucket< istring, internal_symbol_info< search_record > > >, amorph< bucket< int, mail_cabinet > >, amorph< bucket< istring, recognized_entity > >, amorph< file_transfer_record >, amorph< cromp_client >, amorph< driven_object_record >, amorph< bucket< void *, internal_pointer_hider< test_content > > >, amorph< range_record >, amorph< bucket< istring, internal_symbol_info< test_content > > >, amorph< bucket< void *, internal_pointer_hider< contents > > >, amorph< bucket< octopus_entity, entity_basket > >, amorph< nodes::internal_link >, amorph< bucket< void *, internal_pointer_hider< search_record > > >, amorph< bucket< istring, contents > >, amorph< bucket< void *, internal_pointer_hider< istring > > >, amorph< link_record >, amorph< file_info >, amorph< bucket< istring, internal_symbol_info< contents > > >, amorph< infoton_record >, amorph< bucket< void *, internal_pointer_hider< nodes::symbol_tree * > > >, amorph< bucket< void *, internal_pointer_hider< item_record > > >, amorph< infoton_id_pair >, amorph< letter >, amorph< infoton_holder >, amorph< bucket< istring, internal_symbol_info< dns_entry > > >, amorph< bucket< istring, internal_symbol_info< byte_array > > >, amorph< bucket< int, living_item > >, amorph< configlet >, amorph< buffer_base >, amorph< bucket< istring, internal_symbol_info< octenc_key_record > > >, amorph< db_row >, amorph< actor_thread >, amorph< bucket< istring, internal_symbol_info< int > > >, amorph< bucket< int, sequence_record > >, amorph< cromp_client_record >, amorph< bucket< void *, internal_pointer_hider< int > > >, amorph< bucket< void *, live_object_info > >, amorph< menu_common_base >, amorph< bucket< int, contents > >, amorph< bucket< int, value_record > >, amorph< tentacle_record >, amorph< bucket< key_type, contents > >, amorph< bucket< void *, internal_pointer_hider< string_table > > >, amorph< bucket< void *, internal_pointer_hider< dns_entry > > >, amorph< thread_record >, amorph< bucket< int, queued_zings > >, amorph< attribute_bundle >, amorph< bucket< void *, internal_pointer_hider< byte_array > > >, amorph< picture_part >, amorph< host_record >, amorph< bucket< int, data_shuttle > >, amorph< bucket< istring, internal_symbol_info< item_record > > >, amorph< bucket< istring, internal_symbol_info< istring > > >, amorph< istring >, amorph< bucket< void *, internal_pointer_hider< octenc_key_record > > >, amorph< bucket< istring, internal_symbol_info< nodes::symbol_tree * > > >, amorph< bucket< int, ml_memory_record > >, amorph< event_record >, amorph< printed_page >, amorph< socket_data >, amorph< bucket< int, connection > >, amorph< wp_menu_item >, amorph< bucket< istring, internal_symbol_info< string_table > > >, and amorph< bucket< void *, contents > >.
Definition at line 806 of file array.h.
References array< contents >::access(), array< contents >::last(), array< contents >::length(), common::NEW_AT_BEGINNING, common::NEW_AT_END, array< contents >::observe(), array< contents >::resize(), and array< contents >::simple().
Referenced by amorph< contents >::adjust(), basis::attach(), query_handler::bind_columns(), amorph< contents >::insert(), istring::insert(), matrix< contents >::insert_row(), istring::operator+=(), file_time::pack(), socket_minder::put_pending_server(), and matrix< contents >::reset().
| outcome array< contents >::overwrite | ( | int | index, | |
| const array< contents > & | write_with, | |||
| int | count = -1 | |||
| ) | [inline] |
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 489 of file array.h.
References array< contents >::access(), bounds_halt, FUNCDEF, array< contents >::last(), array< contents >::length(), negative(), array< contents >::observe(), and array< contents >::simple().
Referenced by array< contents >::concatenate(), array< contents >::concatenation(), buffer::dump(), ice_key::encrypt(), istring::insert(), and zing_table::pop_events().
| outcome array< contents >::stuff | ( | int | length, | |
| contents * | to_stuff | |||
| ) | const [inline] |
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 475 of file array.h.
References array< contents >::length(), minimum(), array< contents >::observe(), and array< contents >::simple().
Referenced by spocket::connect(), tcpip_stack::convert(), example_rpc_server::process_client_request(), drawing_window::push_in_mice(), tcpip_stack::resolve_any(), ipc_address::unpack(), and internet_address::unpack().
| outcome array< contents >::resize | ( | int | new_size, | |
| common::how_to_copy | way = common::NEW_AT_END | |||
| ) | [inline] |
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.
Definition at line 590 of file array.h.
References deadly_error, common::DONT_COPY, array< contents >::exponential(), array< contents >::FLUSH_INVISIBLE, FUNCDEF, minimum(), common::NEW_AT_BEGINNING, NIL, array< contents >::shift_data(), array< contents >::simple(), static_class_name, array< contents >::TO_LEFT, and array< contents >::TO_RIGHT.
Referenced by array< contents >::concatenate(), array< contents >::insert(), main(), bit_vector::resize(), array< contents >::retrain(), bit_vector::set(), version::set_component(), and array< contents >::zap().
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.
Reimplemented in amorph< contents >, amorph< bucket< istring, internal_symbol_info< search_record > > >, amorph< bucket< int, mail_cabinet > >, amorph< bucket< istring, recognized_entity > >, amorph< file_transfer_record >, amorph< cromp_client >, amorph< driven_object_record >, amorph< bucket< void *, internal_pointer_hider< test_content > > >, amorph< range_record >, amorph< bucket< istring, internal_symbol_info< test_content > > >, amorph< bucket< void *, internal_pointer_hider< contents > > >, amorph< bucket< octopus_entity, entity_basket > >, amorph< nodes::internal_link >, amorph< bucket< void *, internal_pointer_hider< search_record > > >, amorph< bucket< istring, contents > >, amorph< bucket< void *, internal_pointer_hider< istring > > >, amorph< link_record >, amorph< file_info >, amorph< bucket< istring, internal_symbol_info< contents > > >, amorph< infoton_record >, amorph< bucket< void *, internal_pointer_hider< nodes::symbol_tree * > > >, amorph< bucket< void *, internal_pointer_hider< item_record > > >, amorph< infoton_id_pair >, amorph< letter >, amorph< infoton_holder >, amorph< bucket< istring, internal_symbol_info< dns_entry > > >, amorph< bucket< istring, internal_symbol_info< byte_array > > >, amorph< bucket< int, living_item > >, amorph< configlet >, amorph< buffer_base >, amorph< bucket< istring, internal_symbol_info< octenc_key_record > > >, amorph< db_row >, amorph< actor_thread >, amorph< bucket< istring, internal_symbol_info< int > > >, amorph< bucket< int, sequence_record > >, amorph< cromp_client_record >, amorph< bucket< void *, internal_pointer_hider< int > > >, amorph< bucket< void *, live_object_info > >, amorph< menu_common_base >, amorph< bucket< int, contents > >, amorph< bucket< int, value_record > >, amorph< tentacle_record >, amorph< bucket< key_type, contents > >, amorph< bucket< void *, internal_pointer_hider< string_table > > >, amorph< bucket< void *, internal_pointer_hider< dns_entry > > >, amorph< thread_record >, amorph< bucket< int, queued_zings > >, amorph< attribute_bundle >, amorph< bucket< void *, internal_pointer_hider< byte_array > > >, amorph< picture_part >, amorph< host_record >, amorph< bucket< int, data_shuttle > >, amorph< bucket< istring, internal_symbol_info< item_record > > >, amorph< bucket< istring, internal_symbol_info< istring > > >, amorph< istring >, amorph< bucket< void *, internal_pointer_hider< octenc_key_record > > >, amorph< bucket< istring, internal_symbol_info< nodes::symbol_tree * > > >, amorph< bucket< int, ml_memory_record > >, amorph< event_record >, amorph< printed_page >, amorph< socket_data >, amorph< bucket< int, connection > >, amorph< wp_menu_item >, amorph< bucket< istring, internal_symbol_info< string_table > > >, and amorph< bucket< void *, contents > >.
Definition at line 772 of file array.h.
References bounds_return, deadly_error, common::NEW_AT_END, array< contents >::resize(), array< contents >::simple(), and static_class_name.
Referenced by command_line::command_line(), averager< contents >::compact(), recursive_file_copy::copy_hierarchy(), basis::detach(), detach_flat(), portable::exiting_child_signal_handler(), infoton::fast_unpack(), socket_minder::get_pending_server(), list_parsing::parse_csv_line(), RSA_crypto::private_decrypt(), example_rpc_server::process_client_request(), RSA_crypto::public_decrypt(), socket_minder::push_receives(), socket_minder::push_sends(), byte_filer::read(), spocket::receive(), spocket::receive_from(), basis::set< contents >::remove(), smtp_client::remove_carbon(), basis::set< istring >::remove_index(), smtp_client::remove_recipient(), rsa_private_decryption(), rsa_public_decryption(), raw_socket::select(), cromp_common::send_buffer(), basis::snag_out(), socket_minder::snoozy_select(), cromp_transaction::unflatten(), file_time::unpack(), machine_uid::unpack(), ipc_address::unpack(), serial_port_address::unpack(), internet_address::unpack(), manifest_chunk::unpack(), amorph< contents >::zap(), istring::zap(), matrix< contents >::zap_column(), and matrix< contents >::zap_row().
Cuts loose any allocated space that is beyond the real length.
Definition at line 462 of file array.h.
References array< contents >::swap_contents().
| outcome array< contents >::retrain | ( | int | new_size, | |
| const contents * | to_copy | |||
| ) | [inline] |
Resizes the C array and stuffs it with the contents in "to_copy".
Definition at line 736 of file array.h.
References continuable_error, deadly_error, common::DONT_COPY, array< contents >::FLUSH_INVISIBLE, FUNCDEF, array< contents >::resize(), array< contents >::simple(), and static_class_name.
Referenced by array< contents >::array(), array< contents >::operator=(), and array< contents >::reset().
| void array< contents >::shift_data | ( | shift_directions | where | ) | [inline] |
The valid portion of the array is moved to the left or right.
This means that the unused space (dictated by the offset where the data starts) will be adjusted. This may involve copying the data.
Definition at line 549 of file array.h.
References array< contents >::FLUSH_INVISIBLE, array< contents >::simple(), and array< contents >::TO_LEFT.
Referenced by array< contents >::resize().
| int array< contents >::internal_real_length | ( | ) | const [inline] |
Gritty Internal: the real allocated length.
Definition at line 226 of file array.h.
Referenced by run_test_35().
| int array< contents >::internal_offset | ( | ) | const [inline] |
| const contents* array< contents >::internal_block_start | ( | ) | const [inline] |
| contents* array< contents >::internal_block_start | ( | ) | [inline] |
| contents* const* array< contents >::internal_offset_mem | ( | ) | const [inline] |
Gritty Internal: the start of the actual stored data.
Definition at line 234 of file array.h.
Referenced by istring::istring().
1.5.6