Example #1
0
bool MemoriaInterna::remove(const Ponto& p) {
	bool* removeme = this->get(p);
	if (removeme == nullptr) { 
		m.erase(pontoToKey(p));
	}
	return removeme;
}
Example #2
0
void MemoriaInterna::del(const Ponto& p) {
	bool* delme = this->get(p);
	if (delme != nullptr) {
		delete [] delme;
		m.erase(pontoToKey(p));
	}
}
Example #3
0
void Pontos::del(const Ponto& p) {
	int chave = pontoToKey(p); 
	if (mapa[chave] == true) {
		mapa[chave] = false;
		sizeMapa--;
	}
}
Example #4
0
void MemoriaInterna::del(const Ponto& p) {
	int chave = pontoToKey(p);
	bool* delme = mapa[chave];
	if (delme != nullptr) {
		delete [] delme;
		mapa[chave] = nullptr;
		sizeMapa--;
	}
}
Example #5
0
bool Pontos::add(const Ponto& p) {
	int key = pontoToKey(p);
	if (mapa[key] == false) {
		mapa[key] = true;
		sizeMapa++;
		return true;
	}
	return false;
}
Example #6
0
bool* MemoriaInterna::remove(const Ponto& p) {
	int chave = pontoToKey(p);
	bool* remover = nullptr; 
	if (mapa[chave] != nullptr) {
		remover = mapa[chave];
		mapa[chave] = nullptr;
		sizeMapa--;
	}
	return remover;
}
Example #7
0
bool MemoriaInterna::add(const Ponto& p, bool* mem) {
	bool* atual = this->get(p);
	int key = pontoToKey(p);
	if (atual == nullptr)
		m[key] = mem;
	else {
		bool* swap = atual;
		m[key] = mem;
		delete [] swap;
	}
}
Example #8
0
bool Pontos::remove(const Ponto& p) {
	cerr << "remove" << p << endl; 
	int chave = pontoToKey(p); 
	cerr << chave << "!\n";
	if (mapa[chave] == true) {
		mapa[chave] = false;
		sizeMapa--;
		cerr << "retorno! t";
		return true;
	}
	cerr << "retorno! f";
	return false;
}
Example #9
0
bool MemoriaInterna::add(const Ponto& p, bool* mem) {
	cerr << "memória add\n";
	int key = pontoToKey(p);
	bool* atual = this->get(key);
	if (atual == nullptr) {
		cerr << "memória new!\n";
		mapa[key] = mem;
		sizeMapa++;
		cerr << "memória new ok!\n";
	}
	else {
		cerr << "memória swap!\n";
		bool* swap = atual;
		mapa[key] = mem;
		delete [] swap;
		cerr << "memória swap ok!\n";
	}
	cerr << "memória add ok!\n";
}
Example #10
0
bool MemoriaInterna::inKeys(const Ponto& p) {
	int key = pontoToKey(p);
	map<int,bool*>::iterator it = m.find(key);
	// bool* vector = m[pontoToKey(p)];
	return it != m.end();
}
Example #11
0
bool* MemoriaInterna::get(const Ponto& p) {
	int key = pontoToKey(p);
	return m[key];
}
Example #12
0
bool* MemoriaInterna::get(const Ponto& p) {
	int key = pontoToKey(p);
	cerr << "memória em get: " << key << endl;
	return mapa[key];
}
Example #13
0
bool MemoriaInterna::inKeys(const Ponto& p) {
	int key = pontoToKey(p);
	if (mapa[key] != nullptr)
		return true;
	return false;
}
Example #14
0
bool Pontos::in(const Ponto& p) {
	int key = pontoToKey(p);
	return mapa[key];
}