Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
bb3276c8
Commit
bb3276c8
authored
19 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
Add function to remove a feature set from the hash.
parent
10cb222b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zmapWindow/zmapWindowItemHash.c
+53
-7
53 additions, 7 deletions
src/zmapWindow/zmapWindowItemHash.c
with
53 additions
and
7 deletions
src/zmapWindow/zmapWindowItemHash.c
+
53
−
7
View file @
bb3276c8
...
...
@@ -30,9 +30,9 @@
*
* Exported functions: See zMapWindow_P.h
* HISTORY:
* Last edited: Oct
7 09:3
5 2005 (edgrif)
* Last edited: Oct
12 11:5
5 2005 (edgrif)
* Created: Mon Jun 13 10:06:49 2005 (edgrif)
* CVS info: $Id: zmapWindowItemHash.c,v 1.1
0
2005-10-
07 08:36:32
edgrif Exp $
* CVS info: $Id: zmapWindowItemHash.c,v 1.1
1
2005-10-
13 13:34:18
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -41,9 +41,6 @@
#include
<zmapWindow_P.h>
/* The plan is to expand the functions here to provide a kind of querying service so that
* we can look for all features in a column for instance. */
/* Used to hold coord information + return a result the child search callback function. */
typedef
struct
...
...
@@ -108,11 +105,9 @@ typedef struct
static
void
destroyIDHash
(
gpointer
data
)
;
static
void
doHashSet
(
GHashTable
*
hash_table
,
GList
*
search
,
GList
**
result
)
;
static
void
searchItemHash
(
gpointer
key
,
gpointer
value
,
gpointer
user_data
)
;
static
void
addItem
(
gpointer
key
,
gpointer
value
,
gpointer
user_data
)
;
static
void
childSearchCB
(
gpointer
data
,
gpointer
user_data
)
;
static
void
printGlist
(
gpointer
data
,
gpointer
user_data
)
;
...
...
@@ -309,6 +304,57 @@ gboolean zmapWindowFToIAddFeature(GHashTable *feature_to_context_hash,
}
/* Remove functions...not quite as simple as they seem, because removing an item may imply
* removing its hash table and the hash table below that and the hash table below that.... */
/* Remove a hash for the given feature set.
* The set may already exist if we are merging more data from another server,
* if so then no action is taken otherwise we would lose all our existing feature hashes !
* Returns FALSE if the set_id cannot be found, otherwise it returns TRUE and removes
* the set_id and its hash tables. */
gboolean
zmapWindowFToIRemoveSet
(
GHashTable
*
feature_to_context_hash
,
GQuark
align_id
,
GQuark
block_id
,
GQuark
set_id
,
ZMapStrand
set_strand
)
{
gboolean
result
=
FALSE
;
ID2Canvas
align
;
ID2Canvas
block
;
ID2Canvas
set
;
/* We need special quarks that incorporate strand indication as the hashes are per column. */
set_id
=
zmapWindowFToIMakeSetID
(
set_id
,
set_strand
)
;
if
((
align
=
(
ID2Canvas
)
g_hash_table_lookup
(
feature_to_context_hash
,
GUINT_TO_POINTER
(
align_id
)))
&&
(
block
=
(
ID2Canvas
)
g_hash_table_lookup
(
align
->
hash_table
,
GUINT_TO_POINTER
(
block_id
)))
&&
(
set
=
(
ID2Canvas
)
g_hash_table_lookup
(
block
->
hash_table
,
GUINT_TO_POINTER
(
set_id
))))
{
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
/* I DON'T THINK THIS IS NEEDED, GETS TRIGGERED BY THE REMOVE BELOW...BUT I BET THIS
* DOESN'T WORK IF YOU DO IT UP AT SAY THE ALIGN LEVEL, I DON'T THINK IT WILL CASCADE
* DOWN PROPERLY....PERHAPS TIME FOR A TEST.... */
if
(
set
->
hash_table
)
g_hash_table_destroy
(
set
->
hash_table
)
;
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
result
=
g_hash_table_remove
(
block
->
hash_table
,
GUINT_TO_POINTER
(
set_id
))
;
zMapAssert
(
result
==
TRUE
)
;
}
return
result
;
}
/* RENAME TO FINDFEATUREITEM.... */
FooCanvasItem
*
zmapWindowFToIFindFeatureItem
(
GHashTable
*
feature_to_context_hash
,
ZMapFeature
feature
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment