28 #ifndef __RenderSystemCapabilitiesSerializer_H__
29 #define __RenderSystemCapabilitiesSerializer_H__
71 enum CapabilityKeywordType {UNDEFINED_CAPABILITY_TYPE = 0, SET_STRING_METHOD, SET_INT_METHOD, SET_BOOL_METHOD, SET_REAL_METHOD,
105 mCapabilitiesMap.insert(CapabilitiesMap::value_type(name, cap));
122 mKeywordTypeMap.insert(KeywordTypeMap::value_type(keyword, type));
127 KeywordTypeMap::const_iterator it = mKeywordTypeMap.find(keyword);
128 if(it != mKeywordTypeMap.end())
132 logParseError(
"Can't find the type for keyword: " + keyword);
133 return UNDEFINED_CAPABILITY_TYPE;
139 mSetStringMethodDispatchTable.insert(SetStringMethodDispatchTable::value_type(keyword, method));
144 SetStringMethodDispatchTable::iterator methodIter = mSetStringMethodDispatchTable.find(keyword);
145 if (methodIter != mSetStringMethodDispatchTable.end())
147 SetStringMethod m = (*methodIter).second;
148 (mCurrentCapabilities->*m)(val);
152 logParseError(
"undefined keyword: " + keyword);
159 mSetIntMethodDispatchTable.insert(SetIntMethodDispatchTable::value_type(keyword, method));
164 SetIntMethodDispatchTable::iterator methodIter = mSetIntMethodDispatchTable.find(keyword);
165 if (methodIter != mSetIntMethodDispatchTable.end())
167 SetIntMethod m = (*methodIter).second;
168 (mCurrentCapabilities->*m)(val);
172 logParseError(
"undefined keyword: " + keyword);
179 mSetBoolMethodDispatchTable.insert(SetBoolMethodDispatchTable::value_type(keyword, method));
184 SetBoolMethodDispatchTable::iterator methodIter = mSetBoolMethodDispatchTable.find(keyword);
185 if (methodIter != mSetBoolMethodDispatchTable.end())
187 SetBoolMethod m = (*methodIter).second;
188 (mCurrentCapabilities->*m)(val);
192 logParseError(
"undefined keyword: " + keyword);
199 mSetRealMethodDispatchTable.insert(SetRealMethodDispatchTable::value_type(keyword, method));
204 SetRealMethodDispatchTable::iterator methodIter = mSetRealMethodDispatchTable.find(keyword);
205 if (methodIter != mSetRealMethodDispatchTable.end())
207 SetRealMethod m = (*methodIter).second;
208 (mCurrentCapabilities->*m)(val);
212 logParseError(
"undefined keyword: " + keyword);
218 mCurrentCapabilities->addShaderProfile(val);
224 if(mCapabilitiesMap.find(name) == mCapabilitiesMap.end())
226 logParseError(
"Undefined capability: " + name);
233 mCurrentCapabilities->setCapability(cap);
237 void initialiaseDispatchTables();
239 void parseCapabilitiesLines(CapabilitiesLinesList& linesList);
241 void logParseError(
const String& error)
const;