ERIS CORE

◆ update() [4/4]

bool SvcDataDictionary::update ( const char *  key,
int32_t  val,
uint32_t *  owner 
)

update the value of an owned 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 107 of file svcDataDictionary.cpp.

107  {
108  uint32_t h;
109  h = hash(key);
110 
111  for(int i=0;i<DATADICT_KEYVALUE_PAIRS;i++){
112  //key found
113  if (record[i].key_hash == h){
114  //if ((0==strncmp(record[i].key,key,DATADICT_MAX_KEY_LEN))){
115  if (record[next].owner == owner && record[next].data_type == DDDT_INT32){
116  record[i].val.int32_val = val;
117  //arm_dcache_flush_delete(&record[i], sizeof(record[i]));
118  return true;
119  } else return false;
120  }
121  }
122  //key not found - try to create a new record
123  return create(key, val, owner);
124 }
@ DDDT_INT32
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_INT32, hash(), value_container::int32_val, next, record, and svcDataDictionaryRecord::val.

Referenced by dataDictUpdateCallback(), dataDictUpdateFloatCallback(), AppWren::enablePixelOP(), handleClockCallback(), SvcSerialCommandInterface::messageHandler_UPDATE_DD(), AppScope::render(), AppWren::render(), AppManager::requestArmSetClock(), AppManager::update(), and AppScope::update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: