Ejemplo n.º 1
0
GxxValuePtr GxxValueMap::ValueForKey( CGxxKey& _key )
{
	for (TyMap::iterator it = FirstValue(); !IsLastValue(it); NextValue(it))
	{
		Pair *p = *it;
		if (p->key.compare(_key) == 0)
			return p->value;
	}
	return GxxValuePtr();
}
Ejemplo n.º 2
0
void GxxValueMap::objectReleased()
{
	for (TyMap::iterator it = FirstValue(); !IsLastValue(it); NextValue(it))
	{
		Pair* pair = (*it);
		if (pair)
		{
			delete pair;
		}
	}
	__pMap->clear();
	delete __pMap;
}
Ejemplo n.º 3
0
void GxxValueMap::PutValue( CGxxKey& _key, GxxValuePtr& _value )
{
	for (TyMap::iterator it = FirstValue(); !IsLastValue(it); NextValue(it))
	{
		Pair *p = *it;
		if (p->key.compare(_key) == 0)
		{
			p->value = _value;
			return;
		}
	}
	Pair *p = new Pair;
	p->key = _key;
	p->value = _value;
	__pMap->push_back(p);
}
Ejemplo n.º 4
0
void procFeeScaleFromTier(std::string &line,std::vector<FeeScaleXML*> &FeeSclaeList)
{
	FeeScaleXML * xml = new FeeScaleXML();
	
	
	std::string name(line, 0, 10);
	std::string firstPos(line, 32, 7);
	std::string secondPos(line, 32, 7);
	std::string lowerLimit(line, 10, 5);
	std::string upperLimit(line, 15, 5);

	std::string FirstValue(line, 20, 8);
	std::string SecondValue(line, 28, 8);

	std::string val="0";

	if (FirstValue != "0000.00") {
		val = FirstValue;
	}
	else if (SecondValue != "0000.00"){
		val = SecondValue;
	}



	if (FeeSclaeList.size() != 0){

		interval feeInterval;
		feeInterval.value = val;
		feeInterval.upperLimit = upperLimit;

		std::vector<FeeScaleXML*>::iterator it = FeeSclaeList.end();
		--it;
		if (name.compare((*it)->name) != 0) { //New Fee tier ,set upper limit of last fee as "true"
			std::vector<interval>::iterator feeIt = (*it)->intervals.end();
			--feeIt;
			
			feeIt->upperLimit = "true";
			feeInterval.lowerLimit = "true";

			xml->name = name;
			xml->description = "description";
			xml->currency = "THB";
			xml->baseValue = "F";
			xml->calculationBase = "A";
			xml->calculationMethod = "L";
			xml->orderEstimationMode = "F";
			xml->overlappingIntervals = "N";
			xml->intervals.push_back(feeInterval);
			xml->FeeAggregationScheme="Client Aggregation";
		

			FeeSclaeList.push_back(xml);
		}
		else { // Fee existed ,adds more tier
			std::vector<interval>::iterator feeIt = (*it)->intervals.end();
			--feeIt;
			feeInterval.lowerLimit = lowerLimit;
			(*it)->intervals.push_back(feeInterval);


		}

	}
	/*
	
	*/
	
}