HashMap implementation

0
(0)
Имя:
HashMap implementation
Автор: Andrew Lord (2014.02.11 16:34)
Скачано: 6
Скачать:
HashMap implementation 1
hash.mqh (14.5 Кб) Вид

Описание:

This is a HashMap implementation. This allows something like arrays but with string indexes. It maps strings to Objects. The Objects must be a subclass of the HashValue class provided.

The Hash by default will 'adopt' the value objects. In which case it will free the memory when they are no longer in the hash. This can be disabled in the constructor.

Here is an example:

 

    
    Hash *h = new Hash();

    // Store values
    h.hPutInt("низкий",0);
    h.hPutInt("высокий",1);

    // Get values
    int high = h.gGetInt("высокий");

    // Loop
    HashLoop *l ;
    для( l = new HashLoop(час) ; l.hasNext() ; l.next()) {

        string key = l.key();

        int j = l.valInt();

        Распечатать(key," "=" ",Дж);

    }
    delete l;

    delete h;

Рекомендации:

  • Accompany the submitted code with a meaning-bearing name and a brief description.
  • Attach a brief explanation to the code for users to make head or tail of it.
  • Insert illustrating images where applicable.

Насколько полезным был этот пост?

Нажмите на звездочку, чтобы оценить!

Средний рейтинг 0 / 5. Подсчет голосов: 0

Голосов пока нет! Будьте первым, кто оценит этот пост.

Сожалеем, что этот пост не оказался для вас полезным!

Давайте улучшим этот пост!

Расскажите нам, как мы можем улучшить этот пост?



Автор: Команда Форекс Вики
Мы команда опытных трейдеров Forex. [2000-2023] которые посвящены жизни на наших собственных условиях. Наша основная цель - достижение финансовой независимости и свободы, и мы занимались самообразованием и приобрели обширный опыт на рынке Forex, чтобы достичь самодостаточного образа жизни..