Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7761 Next »

FB::variant FB::JSAPIAuto::GetProperty ( const std::string &  propertyName)
virtual

Gets a property value.

Parameters
propertyNameName of the property.
Returns
The property value

Implements FB::JSAPI.

Definition at line 191 of file JSAPIAuto.cpp.

192 {
193  boost::recursive_mutex::scoped_lock lock(m_zoneMutex);
194  if(!m_valid)
195  throw object_invalidated();
196 
197  ZoneMap::const_iterator zoneName = m_zoneMap.find(propertyName);
198  PropertyFunctorsMap::const_iterator it = m_propertyFunctorsMap.find(propertyName);
199  if(it != m_propertyFunctorsMap.end() && memberAccessible(zoneName)) {
200  return it->second.get();
201  } else if (memberAccessible(zoneName)) {
202  if (HasMethodObject(propertyName))
203  return GetMethodObject(propertyName);
204 
205  AttributeMap::iterator fnd = m_attributes.find(propertyName);
206  if (fnd != m_attributes.end())
207  return fnd->second.value;
208  else if (m_allowDynamicAttributes) {
209  return FB::FBVoid(); // If we allow dynamic attributes then we need to
210  // return void if the property doesn't exist;
211  // otherwise checking a property will throw an exception
212  } else {
213  throw invalid_member(propertyName);
214  }
215  } else {
216  if (m_allowDynamicAttributes) {
217  return FB::FBVoid();
218  } else {
219  throw invalid_member(propertyName);
220  }
221  }
222 }
virtual bool HasMethodObject(const std::string &methodObjName) const
Query if 'methodObjName' is a valid methodObj.
Definition: JSAPIAuto.cpp:155
virtual JSAPIPtr GetMethodObject(const std::string &methodObjName)
Gets a method object (JSAPI object that has a default method)
Definition: JSAPIAuto.cpp:363
  • No labels