Mapping* FGeoSession::mapping(const SiPrefix* o) { (void) o; String mn = "SiPrefix"; if (hasMapping(mn)) { return mappingByName(mn); } Table* t = connection()->database()->table("core.si_prefixes"); Mapping* m = createMapping(mn, t); m->createProperty("id", t->column("id")); m->createProperty("name", t->column("name")); m->createProperty("code", t->column("code")); m->createProperty("symbol", t->column("symbol")); m->createProperty("description", t->column("description")); m->createProperty("factor", t->column("factor")); return mapping(o); }
bool ValueInfoMap::add(const Value& value, const bool isOpUniform, const bool isOpVarying, const bool isOpSequential, const bool isOpSequentialGuarded, const bool isResultUniform, const bool isResultVector, const bool isResultScalars, const bool isAligned, const bool isIndexSame, const bool isIndexConsecutive) { if (hasMapping(value)) { errs() << "ERROR: adding more than one mapping for scalar value '" << value.getName() << "' is not allowed!\n"; return false; } ValueInfo* info = new ValueInfo(isOpUniform, isOpVarying, isOpSequential, isOpSequentialGuarded, isResultUniform, isResultVector, isResultScalars, isAligned, isIndexSame, isIndexConsecutive); const std::pair<ValueMapType::iterator, bool>& result = mValueMap.insert(std::make_pair(&value, info)); return result.second; }
const ValueInfo& ValueInfoMap::get(const Value& value) const { assert (hasMapping(value)); return *mValueMap.find(&value)->second; }