ERIS CORE

◆ update() [1/4]

bool FASTRUN SvcDataDictionary::update ( const char *  key,
float32_t  val 
)

update the value of a global record
creates a new record if one does not exist and
initializes its value to zero

Parameters
key
val
owner
Returns
true
false

Definition at line 164 of file svcDataDictionary.cpp.

164  {
165  uint32_t h;
166  h = hash(key);
167 
168  for(int i=0;i<DATADICT_KEYVALUE_PAIRS;i++){
169  //key found
170  if (record[i].key_hash == h){
171  //if ((0==strncmp(record[i].key,key,DATADICT_MAX_KEY_LEN))){
172  if (record[i].record_type == DDRT_READWRITE && record[i].data_type == DDDT_FLOAT32){
173  record[i].val.float32_val = val;
174  //arm_dcache_flush_delete(&record[i], sizeof(record[i]));
175  return true;
176  } else return false;
177  }
178  }
179  //key not found - try to create a new record
180  return create(key, val);
181 }
@ DDRT_READWRITE
@ DDDT_FLOAT32
bool create(const char *key, int32_t val, uint32_t *owner)
create a record with ownership
svcDataDictionaryRecord record[DATADICT_KEYVALUE_PAIRS]
uint32_t hash(const char *s)
hashing function used to accelerate searches

References create(), DDDT_FLOAT32, DDRT_READWRITE, value_container::float32_val, hash(), record, and svcDataDictionaryRecord::val.

+ Here is the call graph for this function: