tmm_cache_entry_add()
Note: Requires Terrain Modeling Module functionality
Abstract
Adds data about a position pair into the cache, as well as the status of the path loss calculation and the value of the path loss, if calculated.
Syntax
tmm_cache_entry_add (cache, users_entry_ptr)
| Argument | Type | Description |
|---|---|---|
cache |
TmmT_Cache |
the cache to which data is added. |
users_entry_ptr |
TmmT_Cache_Entry * |
pointer to the user-created entry to be added to the specified cache. |
Return Value
void
No return value.
Header
tmm.h
Example
TmmT_Cache_Entry loss_entry;
/* prepare the key used to search the cache with */
/* our Tx/Rx positions and heights */
loss_entry.tx_quantized_position = *tx_pos_ptr;
loss_entry.rx_quantized_position = *rx_pos_ptr;
/* Search cache for a value that has already been computed */
if (tmm_cache_entry_find (cache_ptr, &loss_entry) == OPC_FALSE)
{
/* Do work needed to calculate the loss */
...
/* Add the newly calculated value to our cache */
tmm_cache_entry_add (cache_ptr, &loss_entry);
}
FRET (loss_entry.loss_value);
Details
The data to be added should be in a data structure of type TmmT_Cache_Entry. The contents of this structure are the same as an individual cache entry, as shown in the Details section of tmm_cache_create().
This function makes a copy of the user's entry and adds it to the specified cache.
Purpose
This function adds information about a position pair and the associated path loss calculation to the specified cache. This information can then be reused by new positions that are within a certain tolerance area, so that the path loss does not have to be recalculated.
Errors
- Pointer to Entry key data structure is NULL. You should be calling tmm_cache_entry_find() with a cache and the address of a TmmT_Cache_Entry.
Reference
- Use the function tmm_cache_create() to create a new cache.
- Use the function tmm_cache_destroy() to destroy a specified cache.
- Use the function tmm_cache_entry_find() to search the TmmT_Cache data structure and return a path loss for the specified position pair, if one exists.