ARB
Classes | Macros | Typedefs | Enumerations | Functions | Variables
ED4_search.cxx File Reference
#include <ed4_extern.hxx>
#include "ed4_awars.hxx"
#include "ed4_class.hxx"
#include "ed4_tools.hxx"
#include "ed4_edit_string.hxx"
#include <fast_aligner.hxx>
#include <awt_config_manager.hxx>
#include <aw_awars.hxx>
#include <aw_file.hxx>
#include <aw_msg.hxx>
#include <aw_root.hxx>
#include <aw_question.hxx>
#include <arbdbt.h>
#include <climits>
#include <cctype>
#include <cerrno>
#include <map>
Include dependency graph for ED4_search.cxx:

Go to the source code of this file.

Classes

struct  SearchAwarList
 
class  SearchSettings
 
class  SearchTreeNode
 
class  SearchTree
 
struct  LoadSaveSearchParam
 
struct  search_windows
 

Macros

#define INSERT_ROOT_PATTERN(tok, com)
 
#define AWAR_NAME(t, s)   ED4_AWAR_##t##_SEARCH_##s
 
#define AWAR_LIST(t)
 
#define cb(action)   add_callback(makeRootCallback(searchParamsChanged, ED4_SearchPositionType(i), search_params_changed_action(action)));
 
#define ESC   '\\'
 

Typedefs

typedef void(* reportMatch )(int start, int end, GB_CSTR comment, int mismatches[MAX_MISMATCHES])
 
typedef std::map< ED4_window
*, SmartPtr< search_windows > > 
search_window_map
 

Enumerations

enum  search_params_changed_action {
  REFRESH_IF_SHOWN = 1, REFRESH_ALWAYS = 2, RECALC_SEARCH_TREE = 4, TEST_MIN_MISMATCH = 8,
  TEST_MAX_MISMATCH = 16, DO_AUTO_JUMP = 32
}
 

Functions

static charshortenString (char *s)
 
static void splitTokComment (char **tok, char **commentP)
 
static charappendComment (const char *s1, int l1, const char *s2)
 
static int resultsAreShown (ED4_SearchPositionType type)
 
static void searchParamsChanged (AW_root *root, ED4_SearchPositionType type, search_params_changed_action action)
 
void ED4_create_search_awars (AW_root *root)
 
static void reportSearchPosition (int start, int end, GB_CSTR comment, int mismatches[MAX_MISMATCHES])
 
void decodeSearchDescriptor (int descriptor, int *direction, ED4_SearchPositionType *pattern)
 
GB_ERROR ED4_repeat_last_search (ED4_window *ed4w)
 
void ED4_search_cb (UNFIXED, int searchDescriptor, ED4_window *ed4w)
 
static void ED4_mark_matching_species (AW_window *, ED4_SearchPositionType pattern)
 
static charpattern2str (GB_CSTR p)
 
static void str2pattern (char *s)
 
static void save_search_paras_to_file (AW_window *aw, ED4_SearchPositionType type)
 
static void load_search_paras_from_file (AW_window *aw, ED4_SearchPositionType type)
 
static void aws_init_localized (AW_root *root, AW_window_simple *aws, GB_CSTR id_format, GB_CSTR title_format, GB_CSTR typeId, int winNum)
 
static AW_windowloadsave_search_parameters (AW_root *root, const LoadSaveSearchParam *param, bool load)
 
static void setup_search_config (AWT_config_definition &cdef, ED4_SearchPositionType search_type)
 
void ED4_popup_search_window (AW_window *aww, ED4_SearchPositionType type)
 

Variables

const charED4_SearchPositionTypeId [SEARCH_PATTERNS+1]
 
static struct SearchAwarList awar_list [SEARCH_PATTERNS]
 
static SearchSettingssettings [SEARCH_PATTERNS]
 
static SearchTreetree [SEARCH_PATTERNS]
 
static ED4_SearchResultsreportToResult = NULp
 
static ED4_SearchPositionType reportType
 
static int last_searchDescriptor = -1
 

Macro Definition Documentation

#define INSERT_ROOT_PATTERN (   tok,
  com 
)
Value:
do { \
if (root) { \
root = root->insert_unified_pattern(tok, com); \
} \
else { \
root = new SearchTreeNode(tok, com); \
} \
} while (0)
T_PT_MAIN com
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:163

Referenced by SearchTree::SearchTree().

#define AWAR_NAME (   t,
  s 
)    ED4_AWAR_##t##_SEARCH_##s

Definition at line 584 of file ED4_search.cxx.

#define AWAR_LIST (   t)
Value:
AWAR_NAME(t, PATTERN), \
AWAR_NAME(t, MIN_MISMATCHES), \
AWAR_NAME(t, CASE), \
AWAR_NAME(t, TU), \
AWAR_NAME(t, PAT_GAPS), \
AWAR_NAME(t, SEQ_GAPS), \
AWAR_NAME(t, REVERSE), \
AWAR_NAME(t, COMPLEMENT), \
AWAR_NAME(t, EXACT), \
AWAR_NAME(t, SHOW), \
AWAR_NAME(t, OPEN_FOLDED), \
AWAR_NAME(t, AUTO_JUMP)
#define AWAR_NAME(t, s)
Definition: ED4_search.cxx:584
#define MAX_MISMATCHES
Definition: ed4_search.hxx:32

Definition at line 586 of file ED4_search.cxx.

#define cb (   action)    add_callback(makeRootCallback(searchParamsChanged, ED4_SearchPositionType(i), search_params_changed_action(action)));
#define ESC   '\\'

Definition at line 1386 of file ED4_search.cxx.

Referenced by pattern2str(), and str2pattern().

Typedef Documentation

typedef void(* reportMatch)(int start, int end, GB_CSTR comment, int mismatches[MAX_MISMATCHES])

Definition at line 123 of file ED4_search.cxx.

Definition at line 1654 of file ED4_search.cxx.

Enumeration Type Documentation

Enumerator
REFRESH_IF_SHOWN 
REFRESH_ALWAYS 
RECALC_SEARCH_TREE 
TEST_MIN_MISMATCH 
TEST_MAX_MISMATCH 
DO_AUTO_JUMP 

Definition at line 617 of file ED4_search.cxx.

Function Documentation

static char* shortenString ( char s)
static

Definition at line 307 of file ED4_search.cxx.

References s.

Referenced by splitTokComment().

static void splitTokComment ( char **  tok,
char **  commentP 
)
static

Definition at line 320 of file ED4_search.cxx.

References NULp, and shortenString().

Referenced by SearchTree::SearchTree().

static char* appendComment ( const char s1,
int  l1,
const char s2 
)
static

Definition at line 334 of file ED4_search.cxx.

References NULp, and s.

Referenced by SearchTree::SearchTree().

static int resultsAreShown ( ED4_SearchPositionType  type)
inlinestatic
static void searchParamsChanged ( AW_root root,
ED4_SearchPositionType  type,
search_params_changed_action  action 
)
static
void ED4_create_search_awars ( AW_root root)
static void reportSearchPosition ( int  start,
int  end,
GB_CSTR  comment,
int  mismatches[MAX_MISMATCHES] 
)
static

Definition at line 920 of file ED4_search.cxx.

References ED4_SearchResults::addSearchPosition().

Referenced by ED4_SearchResults::search().

void decodeSearchDescriptor ( int  descriptor,
int direction,
ED4_SearchPositionType pattern 
)
inline

Definition at line 1248 of file ED4_search.cxx.

Referenced by ED4_search_cb().

GB_ERROR ED4_repeat_last_search ( ED4_window ed4w)

Definition at line 1255 of file ED4_search.cxx.

References ED4_search_cb(), GBS_global_string(), and NULp.

void ED4_search_cb ( UNFIXED  ,
int  searchDescriptor,
ED4_window ed4w 
)
static void ED4_mark_matching_species ( AW_window ,
ED4_SearchPositionType  pattern 
)
static
static char* pattern2str ( GB_CSTR  p)
static

Definition at line 1388 of file ED4_search.cxx.

References ARB_strdup(), ESC, GB_give_buffer(), and s.

Referenced by save_search_paras_to_file().

static void str2pattern ( char s)
static

Definition at line 1416 of file ED4_search.cxx.

References ESC, and s.

Referenced by load_search_paras_from_file().

static void save_search_paras_to_file ( AW_window aw,
ED4_SearchPositionType  type 
)
static
static void load_search_paras_from_file ( AW_window aw,
ED4_SearchPositionType  type 
)
static
static void aws_init_localized ( AW_root root,
AW_window_simple *  aws,
GB_CSTR  id_format,
GB_CSTR  title_format,
GB_CSTR  typeId,
int  winNum 
)
static
static AW_window* loadsave_search_parameters ( AW_root root,
const LoadSaveSearchParam param,
bool  load 
)
static
static void setup_search_config ( AWT_config_definition cdef,
ED4_SearchPositionType  search_type 
)
static
void ED4_popup_search_window ( AW_window aww,
ED4_SearchPositionType  type 
)

Variable Documentation

const char* ED4_SearchPositionTypeId[SEARCH_PATTERNS+1]
Initial value:
= {
"User1", "User2",
"Probe",
"Primer (local)", "Primer (region)", "Primer (global)",
"Signature (local)", "Signature (region)", "Signature (global)",
"Any"
}

Definition at line 35 of file ED4_search.cxx.

Referenced by ED4_root::generate_window().

struct SearchAwarList awar_list[SEARCH_PATTERNS]
static
Initial value:
= {
{ AWAR_LIST(USER1) },
{ AWAR_LIST(USER2) },
{ AWAR_LIST(PRIMER1) },
{ AWAR_LIST(PRIMER2) },
{ AWAR_LIST(PRIMER3) },
{ AWAR_LIST(SIG1) },
{ AWAR_LIST(SIG2) },
{ AWAR_LIST(SIG3) },
}
#define AWAR_LIST(t)
Definition: ED4_search.cxx:586

Definition at line 601 of file ED4_search.cxx.

Referenced by MG_create_preserves_selection_window().

SearchSettings* settings[SEARCH_PATTERNS]
static

Definition at line 628 of file ED4_search.cxx.

Referenced by ArbParsimony::optimize_tree().

ED4_SearchResults* reportToResult = NULp
static

Definition at line 917 of file ED4_search.cxx.

ED4_SearchPositionType reportType
static

Definition at line 918 of file ED4_search.cxx.

int last_searchDescriptor = -1
static

Definition at line 1253 of file ED4_search.cxx.