Exemplo n.º 1
0
CGUIWebBrowser_Impl::~CGUIWebBrowser_Impl()
{
    Clear();

    DestroyElement();
}
Exemplo n.º 2
0
CGUITab_Impl::~CGUITab_Impl ( void )
{
    DestroyElement ();
}
Exemplo n.º 3
0
int TRI_RemoveElementHashArray (TRI_hash_array_t* array,
                                TRI_hash_index_element_t* element) {
  uint64_t hash;
  uint64_t i;
  uint64_t k;
  bool found;
  void* arrayElement;

  // ...........................................................................
  // compute the hash
  // ...........................................................................

  hash = HashElement(array, element);
  i = hash % array->_nrAlloc;

  // ...........................................................................
  // update statistics
  // ...........................................................................

#ifdef TRI_INTERNAL_STATS
  array->_nrRems++;
#endif

  // ...........................................................................
  // search the table
  // ...........................................................................

  while (! IsEmptyElement(array, &array->_table[i])
      && ! IsEqualElementElement(array, element, &array->_table[i])) {
    i = (i + 1) % array->_nrAlloc;

#ifdef TRI_INTERNAL_STATS
    array->_nrProbesD++;
#endif
  }

  arrayElement = &array->_table[i];

  // ...........................................................................
  // if we did not find such an item return false
  // ...........................................................................

  found = ! IsEmptyElement(array, arrayElement);

  if (! found) {
    return TRI_RESULT_ELEMENT_NOT_FOUND;
  }

  // ...........................................................................
  // remove item - destroy any internal memory associated with the element structure
  // ...........................................................................

  DestroyElement(array, arrayElement);
  array->_nrUsed--;

  // ...........................................................................
  // and now check the following places for items to move closer together
  // so that there are no gaps in the array
  // ...........................................................................

  k = (i + 1) % array->_nrAlloc;

  while (! IsEmptyElement(array, &array->_table[k])) {
    uint64_t j = HashElement(array, &array->_table[k]) % array->_nrAlloc;

    if ((i < k && !(i < j && j <= k)) || (k < i && !(i < j || j <= k))) {
      array->_table[i] = array->_table[k];
      ClearElement(array, &array->_table[k]);
      i = k;
    }

    k = (k + 1) % array->_nrAlloc;
  }

  return TRI_ERROR_NO_ERROR;
}
Exemplo n.º 4
0
int TRI_RemoveKeyHashArray (TRI_hash_array_t* array,
                            TRI_index_search_value_t* key) {
  uint64_t hash;
  uint64_t i;
  uint64_t k;
  bool found;
  void* arrayElement;

  // ...........................................................................
  // compute the hash
  // ...........................................................................

  hash = HashKey(array, key);
  i = hash % array->_nrAlloc;

  // ...........................................................................
  // update statistics
  // ...........................................................................

#ifdef TRI_INTERNAL_STATS
  array->_nrRems++;
#endif

  // ...........................................................................
  // search the table
  // ...........................................................................

  while (! IsEmptyElement(array, &array->_table[i])
      && ! IsEqualKeyElement(array, key, &array->_table[i])) {
    i = (i + 1) % array->_nrAlloc;

#ifdef TRI_INTERNAL_STATS
    array->_nrProbesD++;
#endif
  }

  arrayElement = &array->_table[i];

  // ...........................................................................
  // if we did not find such an item return false
  // ...........................................................................

  found = ! IsEmptyElement(array, arrayElement);

  if (! found) {
    return TRI_RESULT_KEY_NOT_FOUND;
  }

  // ...........................................................................
  // remove item
  // ...........................................................................

  DestroyElement(array, arrayElement);
  array->_nrUsed--;

  // ...........................................................................
  // and now check the following places for items to move here
  // ...........................................................................

  k = (i + 1) % array->_nrAlloc;

  while (! IsEmptyElement(array, &array->_table[k])) {
    uint64_t j = HashElement(array, &array->_table[k]) % array->_nrAlloc;

    if ((i < k && !(i < j && j <= k)) || (k < i && !(i < j || j <= k))) {
      array->_table[i] = array->_table[k];
      ClearElement(array, &array->_table[k]);
      i = k;
    }

    k = (k + 1) % array->_nrAlloc;
  }

  // ...........................................................................
  // return success
  // ...........................................................................

  return TRI_ERROR_NO_ERROR;
}
Exemplo n.º 5
0
int TRI_InsertElementHashArrayMulti (TRI_hash_array_t* array,
                                     TRI_hash_index_element_t* element,
                                     bool overwrite) {

  uint64_t hash;
  uint64_t i;
  bool found;
  int res;
  TRI_hash_index_element_t* arrayElement;

  // ...........................................................................
  // compute the hash
  // ...........................................................................

  hash = HashElement(array, element);
  i = hash % array->_nrAlloc;

  // ...........................................................................
  // update statistics
  // ...........................................................................

#ifdef TRI_INTERNAL_STATS
  array->_nrAdds++;
#endif

  // ...........................................................................
  // search the table
  // ...........................................................................

  while (! IsEmptyElement(array, &array->_table[i])
      && ! IsEqualElementElement(array, element, &array->_table[i])) {
    i = (i + 1) % array->_nrAlloc;

#ifdef TRI_INTERNAL_STATS
    array->_nrProbesA++;
#endif
  }

  arrayElement = &array->_table[i];

  // ...........................................................................
  // If we found an element, return. While we allow duplicate entries in the
  // hash table, we do not allow duplicate elements. Elements would refer to the
  // (for example) an actual row in memory. This is different from the
  // TRI_InsertElementMultiArray function below where we only have keys to
  // differentiate between elements.
  // ...........................................................................

  found = ! IsEmptyElement(array, arrayElement);

  if (found) {
    if (overwrite) {
      // destroy the underlying element since we are going to stomp on top if it
      DestroyElement(array, arrayElement);
      *arrayElement = *element;
    }
    else {
      DestroyElement(array, element);
    }

    return TRI_RESULT_ELEMENT_EXISTS;
  }

  // ...........................................................................
  // add a new element to the associative array
  // ...........................................................................

  *arrayElement = *element;
  array->_nrUsed++;

  // ...........................................................................
  // if we were adding and the table is more than half full, extend it
  // ...........................................................................

  if (array->_nrAlloc < 2 * array->_nrUsed) {
    res = ResizeHashArray(array);

    if (res != TRI_ERROR_NO_ERROR) {
      return res;
    }
  }

  return TRI_ERROR_NO_ERROR;
}
Exemplo n.º 6
0
int TRI_InsertKeyHashArray (TRI_hash_array_t* array,
                            TRI_index_search_value_t* key,
                            TRI_hash_index_element_t* element,
                            bool overwrite) {
  uint64_t hash;
  uint64_t i;
  bool found;
  int res;
  TRI_hash_index_element_t* arrayElement;

  // ...........................................................................
  // compute the hash
  // ...........................................................................

  hash = HashKey(array, key);
  i = hash % array->_nrAlloc;

  // ...........................................................................
  // update statistics
  // ...........................................................................

#ifdef TRI_INTERNAL_STATS
  array->_nrAdds++;
#endif

  // ...........................................................................
  // search the table
  // ...........................................................................

  while (! IsEmptyElement(array, &array->_table[i])
      && ! IsEqualKeyElement(array, key, &array->_table[i])) {
    i = (i + 1) % array->_nrAlloc;

#ifdef TRI_INTERNAL_STATS
    array->_nrProbesA++;
#endif
  }

  arrayElement = &array->_table[i];

  // ...........................................................................
  // if we found an element, return
  // ...........................................................................

  found = ! IsEmptyElement(array, arrayElement);

  if (found) {
    if (overwrite) {
      // destroy the underlying element since we are going to stomp on top if it
      DestroyElement(array, arrayElement);
      *arrayElement = *element;
    }
    else {
      DestroyElement(array, element);
    }

    return TRI_RESULT_KEY_EXISTS;
  }

  // ...........................................................................
  // add a new element to the associative array
  // ...........................................................................

  *arrayElement = *element;
  array->_nrUsed++;

  // ...........................................................................
  // we are adding and the table is more than half full, extend it
  // ...........................................................................

  if (array->_nrAlloc < 2 * array->_nrUsed) {
    res = ResizeHashArray(array);

    if (res != TRI_ERROR_NO_ERROR) {
      return res;
    }
  }

  return TRI_ERROR_NO_ERROR;
}
Exemplo n.º 7
0
CGUIGridList_Impl::~CGUIGridList_Impl ( void )
{
    Clear ();
    DestroyElement ();
}
Exemplo n.º 8
0
CGUIScrollPane_Impl::~CGUIScrollPane_Impl( void )
{
	// Destroy the element
	DestroyElement();
}
Exemplo n.º 9
0
CGUIWindow_Impl::~CGUIWindow_Impl ( void )
{
    DestroyElement ();
}
Exemplo n.º 10
0
CGUIRadioButton_Impl::~CGUIRadioButton_Impl()
{
    DestroyElement();
}
Exemplo n.º 11
0
CGUIButton_Impl::~CGUIButton_Impl( void )
{
	// Destroy the element
	DestroyElement();
}