#include <array.h>
Inheritance diagram for array< contents >:


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 44 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 | |||
| ) |
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 51 of file array.cpp.
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 76 of file array.cpp.
References array< contents >::_active_length, and array< contents >::operator=().
| void array< contents >::reset | ( | int | number = 0, |
|
| const contents * | initial_contents = NIL | |||
| ) |
Resizes this array and sets the contents from an array of contents.
Definition at line 94 of file array.cpp.
References array< contents >::retrain().
Referenced by array_tester(), 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 | ) |
Copies the array in "copy_from" into this.
Definition at line 98 of file array.cpp.
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 92 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(), array_tester(), 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(), internet_address::fill(), tcpip_stack::fill_and_resolve(), sequence< contents >::find(), bit_vector::find_first(), 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(), 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(), basis::set< contents >::intersection(), 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(), list_parsing::parse_csv_line(), byte_format::parse_dump(), zing_table::peek_event(), 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(), 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(), 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(), tcpip_stack::resolve_any(), ini_parser::restate(), octopus::restore(), cromp_transaction::resynchronize(), rsa_private_decryption(), rsa_private_encryption(), rsa_public_decryption(), rsa_public_encryption(), 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(), socket_minder::snoozy_select(), stamping_spider(), string_set::string_set(), 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(), ipc_address::unpack(), serial_port_address::unpack(), internet_address::unpack(), span_manager::update(), version::version(), whacking_spider(), stdio_redirecter::write(), byte_filer::write(), grid_processor::write_data_fields(), grid_processor::write_fields_for_row(), heavy_file_operations::write_file_chunk(), zing_table::zing_event(), and scheduler::~scheduler().
| int array< contents >::last | ( | ) | const [inline] |
Returns the last valid element in the array.
Definition at line 95 of file array.h.
Referenced by directory_tree::add_path(), list_dialog::add_string(), array_tester(), basis::attach(), blowfish_decryption(), blowfish_encryption(), portable::break_line(), array< contents >::concatenate(), basis::detach(), sequence< contents >::find(), cromp_transaction::flatten(), machine_uid::native(), 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(), spocket::receive(), spocket::receive_from(), directory_tree::remove_path(), rsa_private_decryption(), rsa_private_encryption(), rsa_public_decryption(), and rsa_public_encryption().
Provides the raw flags value, without interpreting what it means.
Definition at line 98 of file array.h.
Referenced by 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 101 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 104 of file array.h.
Referenced by array< contents >::resize(), array< contents >::retrain(), array< contents >::shift_data(), and array< contents >::zap().
| const contents & 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.
Reimplemented in picture, amorph< contents >, amorph< file_transfer_record >, amorph< cromp_client >, amorph< driven_object_record >, amorph< range_record >, amorph< nodes::internal_link >, amorph< link_record >, amorph< file_info >, amorph< infoton_record >, amorph< infoton_id_pair >, amorph< letter >, amorph< infoton_holder >, amorph< configlet >, amorph< buffer_base >, amorph< actor_thread >, amorph< cromp_client_record >, amorph< menu_common_base >, amorph< tentacle_record >, amorph< bucket< key_type, contents > >, amorph< thread_record >, amorph< attribute_bundle >, amorph< picture_part >, amorph< host_record >, amorph< istring >, amorph< event_record >, amorph< printed_page >, amorph< socket_data >, and amorph< wp_menu_item >.
Definition at line 118 of file array.cpp.
References bounds_halt, FUNCDEF, array< contents >::observe(), and this.
Referenced by array_tester(), 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(), basis::set< contents >::intersection(), list_box::list_box_callback(), main(), amorph< contents >::next_valid(), machine_uid::operator==(), istring::operator[](), array< letter * >::operator[](), query_handler::print_row(), drawing_window::pull_out_mice(), smtp_client::remove_carbon(), smtp_client::remove_recipient(), smtp_client::send_email(), basis::set< contents >::set_union(), query_handler::show_this_row(), machine_uid::text_form(), machine_uid::type(), basis::set< contents >::unionize(), and span_manager::update().
| contents & array< contents >::use | ( | int | index | ) |
A non-constant version of get(); the returned object can be modified.
Definition at line 110 of file array.cpp.
References array< contents >::access(), bounds_halt, FUNCDEF, and this.
Referenced by query_handler::bind_columns(), istring::operator[](), array< letter * >::operator[](), and bit_vector::resize().
| 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< file_transfer_record >, amorph< cromp_client >, amorph< driven_object_record >, amorph< range_record >, amorph< nodes::internal_link >, amorph< link_record >, amorph< file_info >, amorph< infoton_record >, amorph< infoton_id_pair >, amorph< letter >, amorph< infoton_holder >, amorph< configlet >, amorph< buffer_base >, amorph< actor_thread >, amorph< cromp_client_record >, amorph< menu_common_base >, amorph< tentacle_record >, amorph< bucket< key_type, contents > >, amorph< thread_record >, amorph< attribute_bundle >, amorph< picture_part >, amorph< host_record >, amorph< istring >, amorph< event_record >, amorph< printed_page >, amorph< socket_data >, amorph< wp_menu_item >, matrix< double >, matrix< int >, matrix< jethro >, and matrix< istring >.
Definition at line 114 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< file_transfer_record >, amorph< cromp_client >, amorph< driven_object_record >, amorph< range_record >, amorph< nodes::internal_link >, amorph< link_record >, amorph< file_info >, amorph< infoton_record >, amorph< infoton_id_pair >, amorph< letter >, amorph< infoton_holder >, amorph< configlet >, amorph< buffer_base >, amorph< actor_thread >, amorph< cromp_client_record >, amorph< menu_common_base >, amorph< tentacle_record >, amorph< bucket< key_type, contents > >, amorph< thread_record >, amorph< attribute_bundle >, amorph< picture_part >, amorph< host_record >, amorph< istring >, amorph< event_record >, amorph< printed_page >, amorph< socket_data >, amorph< wp_menu_item >, matrix< double >, matrix< int >, matrix< jethro >, and matrix< istring >.
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 585 of file array.cpp.
References bounds_halt, FUNCDEF, common::OKAY, common::OUT_OF_RANGE, and this.
Referenced by istring::istring(), istring::operator+=(), istring::to_lower(), and istring::to_upper().
| array< contents > array< contents >::concatenation | ( | const array< contents > & | to_concatenate | ) | const |
Returns the concatenation of "this" and the array "to_concatenate".
Definition at line 168 of file array.cpp.
References array< contents >::_flags, array< contents >::length(), NIL, array< contents >::overwrite(), and this.
Referenced by array< letter * >::operator+().
| array< contents > array< contents >::concatenation | ( | const contents & | to_concatenate | ) | const |
Returns the concatenation of "this" and the object "to_concatenate".
Definition at line 178 of file array.cpp.
References NIL, array< contents >::overwrite(), and this.
| array< contents > & array< contents >::concatenate | ( | const array< contents > & | to_concatenate | ) |
Appends the array "to_concatenate" onto "this" and returns "this".
Definition at line 126 of file array.cpp.
References array< contents >::length(), common::NEW_AT_END, array< contents >::overwrite(), array< contents >::resize(), and this.
Referenced by basis::set< contents >::add(), array_tester(), 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 | ) |
Appends the object "to_concatenate" onto "this" and returns "this".
Definition at line 141 of file array.cpp.
References array< contents >::last(), common::NEW_AT_END, array< contents >::resize(), and this.
| array< contents > & array< contents >::concatenate | ( | const contents * | to_concatenate, | |
| int | length | |||
| ) |
Concatenates a C-array "to_concatenate" onto "this" and returns "this".
There must be at least "length" elements in "to_concatenate".
Definition at line 152 of file array.cpp.
References array< contents >::length(), common::NEW_AT_END, array< contents >::resize(), and this.
| 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 149 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(), socket_minder::push_receives(), spocket::send(), cromp_common::send_buffer(), smtp_client::send_email(), spocket::send_to(), array< contents >::subarray(), infoton::test_fast_unpack(), test_stack_with_objects(), test_stack_with_pointers(), byte_format::text_dump(), unpack(), stdio_redirecter::write(), and byte_filer::write().
| contents* array< contents >::access | ( | ) | [inline] |
A non-constant access of the underlying C-array. BE REALLY CAREFUL.
Definition at line 152 of file array.h.
Referenced by istring::access(), amorph< contents >::acquire(), array_tester(), amorph< contents >::borrow(), buffer::buffer(), fake_amorph_unpack(), version_checker::get_language(), version_checker::get_record(), version_checker::get_version(), byte_filer::getline(), istring::istring(), palette::operator=(), 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(), 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().
Exchanges the contents of "this" and "other".
No validation is performed but this should always succeed given arrays constructed properly.
Definition at line 199 of file array.cpp.
References array< contents >::_active_length, array< contents >::_flags, array< contents >::_mem_block, array< contents >::_offset, array< contents >::_real_length, swap_values(), and this.
Referenced by istring::shrink(), array< contents >::shrink(), array< contents >::snarf(), and amorph< contents >::swap_contents().
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 597 of file array.cpp.
References array< contents >::reset(), and array< contents >::swap_contents().
Referenced by array_tester(), and buffer::buffer().
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 190 of file array.cpp.
References bounds_return, NIL, array< contents >::observe(), and this.
Referenced by array_tester(), basis::detach(), infoton::fast_unpack(), 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< file_transfer_record >, amorph< cromp_client >, amorph< driven_object_record >, amorph< range_record >, amorph< nodes::internal_link >, amorph< link_record >, amorph< file_info >, amorph< infoton_record >, amorph< infoton_id_pair >, amorph< letter >, amorph< infoton_holder >, amorph< configlet >, amorph< buffer_base >, amorph< actor_thread >, amorph< cromp_client_record >, amorph< menu_common_base >, amorph< tentacle_record >, amorph< bucket< key_type, contents > >, amorph< thread_record >, amorph< attribute_bundle >, amorph< picture_part >, amorph< host_record >, amorph< istring >, amorph< event_record >, amorph< printed_page >, amorph< socket_data >, and amorph< wp_menu_item >.
Definition at line 554 of file array.cpp.
References common::NEW_AT_BEGINNING, common::NEW_AT_END, array< contents >::observe(), common::OKAY, common::OUT_OF_RANGE, array< contents >::resize(), and this.
Referenced by amorph< contents >::adjust(), array_tester(), 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 | |||
| ) |
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 237 of file array.cpp.
References common::BAD_INPUT, bounds_halt, FUNCDEF, array< contents >::length(), negative(), array< contents >::observe(), common::OKAY, common::OUT_OF_RANGE, and this.
Referenced by array_tester(), array< contents >::concatenate(), array< contents >::concatenation(), buffer::dump(), ice_key::encrypt(), istring::insert(), and zing_table::pop_events().
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 223 of file array.cpp.
References minimum(), common::OKAY, and this.
Referenced by array_tester(), 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 | |||
| ) |
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 338 of file array.cpp.
References deadly_error, common::DONT_COPY, array< contents >::exponential(), FUNCDEF, minimum(), common::NEW_AT_BEGINNING, NIL, common::OKAY, array< contents >::shift_data(),