Go to the source code of this file.
Functions | |
void | SyncTreeWorkerInit (struct SyncTreeWorkerHead *head, struct SyncHashCacheEntry *ent, int remote) |
initialize an existing worker from the cache entry resulting level will be 1 | |
struct SyncTreeWorkerHead * | SyncTreeWorkerCreate (struct SyncHashCacheHead *cache, struct SyncHashCacheEntry *ent, int remote) |
create a new tree worker, based on the given cache ent != NULL: initialize from the given node ent == NULL: create an empty worker, to be externally initialized | |
struct SyncTreeWorkerEntry * | SyncTreeWorkerTop (struct SyncTreeWorkerHead *head) |
struct SyncNodeElem * | SyncTreeWorkerGetElem (struct SyncTreeWorkerHead *head) |
requires that the node be present | |
struct SyncTreeWorkerEntry * | SyncTreeWorkerPush (struct SyncTreeWorkerHead *head) |
pushes into the node at the current position | |
struct SyncTreeWorkerEntry * | SyncTreeWorkerPop (struct SyncTreeWorkerHead *head) |
pops the stack and returns the top entry popping an empty stack has no effect and returns NULL | |
void | SyncTreeWorkerReset (struct SyncTreeWorkerHead *head, int level) |
Reset the worker to the given level (or the current level if that is less). | |
struct SyncTreeWorkerHead * | SyncTreeWorkerFree (struct SyncTreeWorkerHead *head) |
Free the storage for the worker. | |
enum SyncCompareResult | SyncTreeLookupName (struct SyncTreeWorkerHead *head, struct ccn_charbuf *name, int minLevel) |
Lookup the name in the tree, starting at the current point, with backtrack while the level is greater than the given minimum. | |
enum SyncCompareResult | SyncTreeGenerateNames (struct SyncTreeWorkerHead *head, struct SyncNameAccum *accum, int minLevel) |
Generate the names in the tree, starting at the current point, with backtrack while the level is greater than the given minimum. | |
int | SyncTreeMarkReachable (struct SyncTreeWorkerHead *head, int minLevel) |
Mark all reachable cache entries using the current tree worker head, with backtrack while the level is greater than the given minimum. |
Copyright (C) 2011 Palo Alto Research Center, Inc.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Definition in file SyncTreeWorker.c.
enum SyncCompareResult SyncTreeGenerateNames | ( | struct SyncTreeWorkerHead * | head, | |
struct SyncNameAccum * | accum, | |||
int | minLevel | |||
) |
Generate the names in the tree, starting at the current point, with backtrack while the level is greater than the given minimum.
When SCR_missing is returned, SyncTreeWorkerTop(head) is missing.
Definition at line 218 of file SyncTreeWorker.c.
enum SyncCompareResult SyncTreeLookupName | ( | struct SyncTreeWorkerHead * | head, | |
struct ccn_charbuf * | name, | |||
int | minLevel | |||
) |
Lookup the name in the tree, starting at the current point, with backtrack while the level is greater than the given minimum.
The lookup can be restarted when a missing node is encountered. When SCR_missing is returned, SyncTreeWorkerTop(head) is missing.
Definition at line 163 of file SyncTreeWorker.c.
int SyncTreeMarkReachable | ( | struct SyncTreeWorkerHead * | head, | |
int | minLevel | |||
) |
Mark all reachable cache entries using the current tree worker head, with backtrack while the level is greater than the given minimum.
When SCR_missing is returned, SyncTreeWorkerTop(head) is missing.
Definition at line 271 of file SyncTreeWorker.c.
Referenced by purgeOldEntries().
struct SyncTreeWorkerHead* SyncTreeWorkerCreate | ( | struct SyncHashCacheHead * | cache, | |
struct SyncHashCacheEntry * | ent, | |||
int | remote | |||
) | [read] |
create a new tree worker, based on the given cache ent != NULL: initialize from the given node ent == NULL: create an empty worker, to be externally initialized
Definition at line 43 of file SyncTreeWorker.c.
Referenced by purgeOldEntries(), SyncStartCompareAction(), testReadBuilder(), and UpdateAction().
struct SyncTreeWorkerHead* SyncTreeWorkerFree | ( | struct SyncTreeWorkerHead * | head | ) | [read] |
Free the storage for the worker.
Definition at line 153 of file SyncTreeWorker.c.
Referenced by destroyCompareData(), purgeOldEntries(), testReadBuilder(), and UpdateAction().
struct SyncNodeElem* SyncTreeWorkerGetElem | ( | struct SyncTreeWorkerHead * | head | ) | [read] |
requires that the node be present
NULL if not valid
Definition at line 65 of file SyncTreeWorker.c.
Referenced by doComparison(), and SyncTreeWorkerPush().
void SyncTreeWorkerInit | ( | struct SyncTreeWorkerHead * | head, | |
struct SyncHashCacheEntry * | ent, | |||
int | remote | |||
) |
initialize an existing worker from the cache entry resulting level will be 1
Definition at line 28 of file SyncTreeWorker.c.
Referenced by CompareAction(), SyncTreeWorkerCreate(), and testReadBuilder().
struct SyncTreeWorkerEntry* SyncTreeWorkerPop | ( | struct SyncTreeWorkerHead * | head | ) | [read] |
pops the stack and returns the top entry popping an empty stack has no effect and returns NULL
Definition at line 127 of file SyncTreeWorker.c.
Referenced by doComparison(), doPreload(), printTreeInner(), SyncTreeGenerateNames(), SyncTreeLookupName(), SyncTreeMarkReachable(), SyncTreeMergeNames(), and SyncTreeWorkerReset().
struct SyncTreeWorkerEntry* SyncTreeWorkerPush | ( | struct SyncTreeWorkerHead * | head | ) | [read] |
pushes into the node at the current position
Definition at line 79 of file SyncTreeWorker.c.
Referenced by doComparison(), doPreload(), printTreeInner(), SyncTreeGenerateNames(), SyncTreeLookupName(), SyncTreeMarkReachable(), and SyncTreeMergeNames().
void SyncTreeWorkerReset | ( | struct SyncTreeWorkerHead * | head, | |
int | level | |||
) |
Reset the worker to the given level (or the current level if that is less).
Resets the position at the new level to 0.
Definition at line 141 of file SyncTreeWorker.c.
Referenced by SyncTreeWorkerFree(), and SyncTreeWorkerInit().
struct SyncTreeWorkerEntry* SyncTreeWorkerTop | ( | struct SyncTreeWorkerHead * | head | ) | [read] |
NULL if no valid current entry
Definition at line 57 of file SyncTreeWorker.c.
Referenced by addNameFromCompare(), doComparison(), doPreload(), printTreeInner(), SyncTreeGenerateNames(), SyncTreeLookupName(), SyncTreeMarkReachable(), SyncTreeMergeNames(), SyncTreeWorkerGetElem(), and SyncTreeWorkerPush().