feisty meow concerns codebase  2.140
basis::array< contents > Class Template Reference

Represents a sequential, ordered, contiguous collection of objects. More...

#include <array.h>

Inheritance diagram for basis::array< contents >:
Collaboration diagram for basis::array< contents >:

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 > &copy_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...
 
arrayoperator= (const array< contents > &copy_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...
 
arrayconcatenate (const array &to_concatenate)
 Appends the array "to_concatenate" onto "this" and returns "this". More...
 
arrayconcatenate (const contents &to_concatenate)
 Appends the object "to_concatenate" onto "this" and returns "this". More...
 
arrayconcatenate (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...
 
arrayoperator+= (const array &to_concatenate)
 Synonym for concatenate that modifies "this". More...
 
arrayoperator+= (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...
 

Detailed Description

template<class contents>
class basis::array< contents >

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.

Definition at line 53 of file array.h.

Member Enumeration Documentation

◆ how_to_copy

template<class contents >
enum basis::array::how_to_copy
Enumerator
NEW_AT_END 
NEW_AT_BEGINNING 
DONT_COPY 

Definition at line 67 of file array.h.

◆ shift_directions

template<class contents >
enum basis::array::shift_directions
Enumerator
TO_LEFT 
TO_RIGHT 

Definition at line 235 of file array.h.

◆ specialc_flags

template<class contents >
enum basis::array::specialc_flags

the flags specify how the array treats its contents and its length.

Enumerator
NO_SPECIAL_MODES 

do nothing extra; only valid by itself.

SIMPLE_COPY 

the contents can be memcpy'd and are not deep.

EXPONENTIAL_GROWTH 

length is doubled when reallocation happens.

EXPONE 

synonym for EXPONENTIAL_GROWTH.

FLUSH_INVISIBLE 

blanks out allocated but inaccessible elements.

Definition at line 57 of file array.h.

Constructor & Destructor Documentation

◆ array() [1/2]

template<class contents >
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().

◆ array() [2/2]

template<class contents >
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=().

◆ ~array()

template<class contents >
basis::array< contents >::~array
virtual

destroys the memory allocated for the objects.

Definition at line 339 of file array.h.

References NULL_POINTER.

Member Function Documentation

◆ access()

◆ concatenate() [1/3]

template<class contents >
array< contents > & basis::array< contents >::concatenate ( const array< contents > &  to_concatenate)

◆ concatenate() [2/3]

template<class contents >
array< contents > & basis::array< contents >::concatenate ( const contents &  to_concatenate)

Appends the object "to_concatenate" onto "this" and returns "this".

Definition at line 394 of file array.h.

References access.

◆ concatenate() [3/3]

template<class contents >
array< contents > & basis::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 405 of file array.h.

References access.

◆ concatenation() [1/2]

template<class contents >
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+().

◆ concatenation() [2/2]

template<class contents >
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().

◆ DEFINE_CLASS_NAME()

template<class contents >
basis::array< contents >::DEFINE_CLASS_NAME ( "array< contents >"  )

◆ exponential()

template<class contents >
bool basis::array< contents >::exponential ( ) const
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.

◆ flags()

template<class contents >
int basis::array< contents >::flags ( ) const
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().

◆ get()

◆ insert()

template<class contents >
outcome basis::array< contents >::insert ( int  index,
int  new_indices 
)

◆ internal_block_start() [1/2]

template<class contents >
contents* basis::array< contents >::internal_block_start ( )
inline

Gritty Internal: the real allocated pointer made accessible.

Definition at line 251 of file array.h.

◆ internal_block_start() [2/2]

template<class contents >
const contents* basis::array< contents >::internal_block_start ( ) const
inline

Gritty Internal: constant peek at the real allocated pointer.

Definition at line 249 of file array.h.

◆ internal_offset()

template<class contents >
int basis::array< contents >::internal_offset ( ) const
inline

Gritty Internal: the offset from real start to stored data.

Definition at line 247 of file array.h.

◆ internal_offset_mem()

template<class contents >
contents* const* basis::array< contents >::internal_offset_mem ( ) const
inline

Gritty Internal: the start of the actual stored data.

Definition at line 253 of file array.h.

Referenced by basis::astring::astring().

◆ internal_real_length()

template<class contents >
int basis::array< contents >::internal_real_length ( ) const
inline

Gritty Internal: the real allocated length.

Definition at line 245 of file array.h.

◆ last()

◆ length()

template<class contents >
int basis::array< contents >::length ( ) const
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().

◆ observe()

◆ operator+() [1/2]

template<class contents >
array basis::array< contents >::operator+ ( const array< contents > &  to_cat) const
inline

Synonym for concatenation.

Definition at line 159 of file array.h.

References basis::array< contents >::concatenation().

◆ operator+() [2/2]

template<class contents >
array basis::array< contents >::operator+ ( const contents &  to_concatenate) const
inline

Synonym for concatenation.

Definition at line 162 of file array.h.

References basis::array< contents >::concatenation().

◆ operator+=() [1/2]

template<class contents >
array& basis::array< contents >::operator+= ( const array< contents > &  to_concatenate)
inline

Synonym for concatenate that modifies "this".

Definition at line 165 of file array.h.

References basis::array< contents >::concatenate().

◆ operator+=() [2/2]

template<class contents >
array& basis::array< contents >::operator+= ( const contents &  to_concatenate)
inline

Synonym for concatenate that modifies "this".

Definition at line 168 of file array.h.

References basis::array< contents >::concatenate().

◆ operator=()

template<class contents >
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=().

◆ operator[]() [1/2]

template<class contents >
contents& basis::array< contents >::operator[] ( int  index)
inline

Synonym for use that provides the expected array indexing syntax.

Definition at line 139 of file array.h.

References basis::array< contents >::use().

◆ operator[]() [2/2]

template<class contents >
const contents& basis::array< contents >::operator[] ( int  index) const
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[]().

◆ overwrite()

template<class contents >
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().

◆ put()

template<class contents >
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().

◆ reset()

template<class contents >
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().

◆ resize()

template<class contents >
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().

◆ retrain()

template<class contents >
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().

◆ shift_data()

template<class contents >
void basis::array< contents >::shift_data ( shift_directions  where)

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 544 of file array.h.

◆ shrink()

template<class contents >
outcome basis::array< contents >::shrink

Cuts loose any allocated space that is beyond the real length.

Definition at line 463 of file array.h.

◆ simple()

template<class contents >
bool basis::array< contents >::simple ( ) const
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.

◆ snarf()

template<class contents >
void basis::array< contents >::snarf ( array< contents > &  new_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 845 of file array.h.

◆ stuff()

template<class 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().

◆ subarray()

template<class contents >
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().

◆ swap_contents()

template<class contents >
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().

◆ use()

template<class contents >
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().

◆ zap()

template<class contents >
outcome basis::array< contents >::zap ( int  start,
int  end 
)

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