27 {
28
29 const TrackGradesDefinition & myTrackGradesDefinition = trackGradeFactory.getTrackGradesDefinition();
30
31
32 const std::string delim("+");
33 std::string::size_type sPos, sEnd, sLen;
34 sPos = definition.find_first_not_of(delim);
35 while ( sPos != std::string::npos ) {
36 sEnd = definition.find_first_of(delim, sPos);
37 if(sEnd==std::string::npos) sEnd = definition.length();
38 sLen = sEnd - sPos;
39 std::string grade = definition.substr(sPos,sLen);
40
41 const TrackGrade* tgrade(myTrackGradesDefinition.getGrade(grade));
42 if (tgrade==0)
43 {
44 throw std::string("#BTAG# Error: the following grade ") + grade + std::string(" could not be found in the list from TrackGradeFactory ");
45 }
46 m_grades.push_back(TrackGrade(*tgrade));
47 sPos = definition.find_first_not_of(delim, sEnd);
48 }
49 }
std::vector< TrackGrade > m_grades