Revision fed93cda include/MarketPlaceAppPool.h

View differences:

include/MarketPlaceAppPool.h
145 145
    {
146 146
        return new MarketPlaceApp(-1,-1,"","", 0, 0);
147 147
    };
148

  
149
    /**
150
     * Erease map element
151
     */
152
    void drop_map_check(const std::string& name){
153
        if (map_check.find( name ) != map_check.end()){
154
            map<std::string,int>::iterator it;
155
            it=map_check.find(name);
156
            map_check.erase (it);
157
        }
158
    }
159

  
160
    /**
161
     * Check an element into map
162
     */
163
    bool test_map_check(const std::string& name){
164
        map_check[name]++;
165
        if (map_check[name] > 0){
166
            return true;
167
        }
168
        return false;
169
    }
170
private:
171
    map<std::string, int> map_check;
172

  
173
    
174
    void insert_map_check(const std::string& name){
175
        map_check.insert(make_pair(name, -1));
176
    }
177
    void reset_map_check(const std::string& name){
178
        if (name != "") {
179
            if (map_check.find( name ) != map_check.end()){
180
                map_check[name] = -1;
181
            }
182
            else{
183
                insert_map_check(name);
184
            }
185
        }
186
    }
148 187
};
149 188

  
150 189
#endif /*MARKETPLACE_POOL_H_*/

Also available in: Unified diff