ARB
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CharPtrArray Class Referenceabstract

#include <arb_strarray.h>

Inheritance diagram for CharPtrArray:
Inheritance graph
[legend]
Collaboration diagram for CharPtrArray:
Collaboration graph
[legend]

Public Member Functions

void reserve (size_t forElems)
 
void optimize_space ()
 
size_t size () const
 
bool empty () const
 
const charoperator[] (int i) const
 
void swap (int i1, int i2)
 
void move (int from, int to)
 
void remove (int i)
 
void safe_remove (int i)
 
void resize (int newsize)
 
void clear ()
 
void sort (CharPtrArray_compare_fun compare, void *client_data)
 
void uniq (CharPtrArray_compare_fun compare, void *client_data)
 
void sort_and_uniq (CharPtrArray_compare_fun compare, void *client_data)
 
int index_of (const char *search_for) const
 

Protected Member Functions

bool ok () const
 
bool elem_index (int i) const
 
bool allocated_index (int i) const
 
void set_space (size_t new_allocated)
 
void reserve_space (size_t forElems, bool alloc_ahead)
 
 CharPtrArray ()
 
virtual ~CharPtrArray ()
 
virtual void free_elem (int i)=0
 
void erase_elems ()
 

Protected Attributes

char ** str
 
size_t elems
 

Detailed Description

Definition at line 31 of file arb_strarray.h.

Constructor & Destructor Documentation

CharPtrArray::CharPtrArray ( )
inlineprotected

Definition at line 67 of file arb_strarray.h.

virtual CharPtrArray::~CharPtrArray ( )
inlineprotectedvirtual

Definition at line 68 of file arb_strarray.h.

Member Function Documentation

bool CharPtrArray::ok ( ) const
inlineprotected
bool CharPtrArray::elem_index ( int  i) const
inlineprotected

Definition at line 45 of file arb_strarray.h.

References elems.

Referenced by remove(), FINAL_TYPE< SEQTYPE >::replace(), ConstStrArray::replace(), safe_remove(), and swap().

bool CharPtrArray::allocated_index ( int  i) const
inlineprotected

Definition at line 46 of file arb_strarray.h.

Referenced by FINAL_TYPE< SEQTYPE >::put(), and ConstStrArray::put().

void CharPtrArray::set_space ( size_t  new_allocated)
inlineprotected

Definition at line 48 of file arb_strarray.h.

References arb_assert, ARB_calloc(), ARB_recalloc(), and ok().

Referenced by optimize_space(), and reserve_space().

void CharPtrArray::reserve_space ( size_t  forElems,
bool  alloc_ahead 
)
inlineprotected

Definition at line 60 of file arb_strarray.h.

References set_space().

Referenced by FINAL_TYPE< SEQTYPE >::put(), ConstStrArray::put(), and reserve().

virtual void CharPtrArray::free_elem ( int  i)
protectedpure virtual

Referenced by erase_elems(), and remove().

void CharPtrArray::erase_elems ( )
inlineprotected

Definition at line 72 of file arb_strarray.h.

References arb_assert, elems, empty(), free_elem(), and ok().

Referenced by FINAL_TYPE< SEQTYPE >::erase(), and ConstStrArray::erase().

void CharPtrArray::reserve ( size_t  forElems)
inline

Definition at line 82 of file arb_strarray.h.

References reserve_space().

Referenced by GBT_get_configuration_names(), GBT_get_tree_names(), and GEN_read_position().

void CharPtrArray::optimize_space ( )
inline

Definition at line 83 of file arb_strarray.h.

References set_space().

size_t CharPtrArray::size ( ) const
inline

Definition at line 85 of file arb_strarray.h.

References elems.

Referenced by RefEntries::addRefsTo(), SaiBoolchainOperator::apply(), SaiAciApplicator::apply(), AW_create_fileselection_awars(), aw_help_history(), AWT_insert_DBcompression_selector(), AWT_modify_managed_configs(), AWT_trigger_remote_action(), boolchain_gui_changed_cb(), build_consensus_tree(), clear_comment_cb(), clearMacroExecutionAuthorization(), config_modified_cb(), LocationEditor::create_GEN_position_from_fields(), create_probe_design_variables(), ArbImporter::detect_format(), elemOr(), export_nds_cb(), FieldTransfer::RuleSet::extractUsedFields(), File_selection::fill(), AWT_configuration_selection::fill(), AW_subset_selection::fill_entries_matching_values(), gb_hierarchy_location::gb_hierarchy_location(), GBT_commit_rename_session(), GBT_save_colorset(), File_selection::get_newest_dir_modtime(), AWT_configuration::keep_changed_fields(), ListDisplayRow::ListDisplayRow(), MG_equal_alignments(), ConfigModifier::modifyConfig(), move(), move_field_cb(), mp_file2list(), mp_list2file(), new_input_window(), NT_alltree_remove_leafs(), nt_build_sai_string(), NT_database_optimization(), parse_helix_list(), parseCSV(), GBL_IMPL::print_trace(), probe_design_event(), PT_start_design(), FINAL_TYPE< SEQTYPE >::put_before(), ConstStrArray::put_before(), readableUnknownNames(), FieldTransfer::ReadRule::readFrom(), resize(), restore_colorset_representation(), sort(), SpeciesSpace::SpeciesSpace(), split_ali_cb(), standard_file2list(), standard_list2file(), uniq(), and update_colorset_selection_list().

bool CharPtrArray::empty ( ) const
inline
const char* CharPtrArray::operator[] ( int  i) const
inline

Definition at line 88 of file arb_strarray.h.

References arb_assert, NULp, and ok().

void CharPtrArray::swap ( int  i1,
int  i2 
)
inline

Definition at line 94 of file arb_strarray.h.

References arb_assert, elem_index(), ok(), and swap().

Referenced by move().

void CharPtrArray::move ( int  from,
int  to 
)

moves an array-entry from 'oidx' to 'nidx' (entries between get shifted by one) -1 means "last entry" if 'nidx' is out of bounds, it'll be moved to start of array

Definition at line 132 of file arb_strarray.cxx.

References arb_assert, size(), and swap().

Referenced by add_selected_cb(), lower_reference_cb(), move_field_cb(), FINAL_TYPE< SEQTYPE >::put_before(), ConstStrArray::put_before(), and raise_reference_cb().

void CharPtrArray::remove ( int  i)
void CharPtrArray::safe_remove ( int  i)
inline

like remove, but does NOOP if index out of bounds

Definition at line 103 of file arb_strarray.h.

References elem_index().

Referenced by clear_comment_cb(), del_boolrule_cb(), and del_reference_cb().

void CharPtrArray::resize ( int  newsize)
inline

Definition at line 108 of file arb_strarray.h.

References size().

Referenced by clear().

void CharPtrArray::clear ( )
inline

Definition at line 114 of file arb_strarray.h.

References resize().

Referenced by AW_getColorRangeNames(), and clear_comment_cb().

void CharPtrArray::sort ( CharPtrArray_compare_fun  compare,
void *  client_data 
)

sort the array

See also
sort_and_uniq for parameters

Definition at line 18 of file arb_strarray.cxx.

References GB_sort(), and size().

Referenced by sort_and_uniq().

void CharPtrArray::uniq ( CharPtrArray_compare_fun  compare,
void *  client_data 
)

remove consecutive equal elements

See also
sort_and_uniq for parameters

Definition at line 25 of file arb_strarray.cxx.

References size().

Referenced by sort_and_uniq().

void CharPtrArray::sort_and_uniq ( CharPtrArray_compare_fun  compare,
void *  client_data 
)
inline

sort the array and remove all duplicates

Parameters
comparefunction defining order on elements (
See also
e.g. GB_string_comparator)
Parameters
client_datauser parameter forwarded to compare

Definition at line 118 of file arb_strarray.h.

References sort(), and uniq().

Referenced by get_SAI_groups().

int CharPtrArray::index_of ( const char search_for) const

Member Data Documentation

char** CharPtrArray::str
protected

Definition at line 35 of file arb_strarray.h.

size_t CharPtrArray::elems
protected

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