std::vector<unsigned> IdfExtensibleGroup::mf_indices() const {
  UnsignedVector result;
  if (!empty()) {
    for (unsigned i = 0, n = numFields(); i < n; ++i) {
      result.push_back(mf_toIndex(i));
    }
  }
  return result;
}
bool WorkspaceExtensibleGroup::canBeSource() const {
  bool result = false;
  if (empty()) { return result; }
  for (unsigned fieldIndex = 0, n = numFields(); fieldIndex < n; ++fieldIndex) {
    result = getImpl<detail::WorkspaceObject_Impl>()->canBeSource(mf_toIndex(fieldIndex));
    if (result) { break; }
  }
  return result; 
}
 boost::optional<T> getModelObjectTarget(unsigned fieldIndex) const {
   if (!isValid(fieldIndex)) { return boost::none; }
   return ModelObject(getImpl<detail::ModelObject_Impl>()).getModelObjectTarget<T>(mf_toIndex(fieldIndex));
 }
bool IdfExtensibleGroup::setFieldComment(unsigned fieldIndex, const std::string& cmnt) {
  return isValid(fieldIndex) && m_impl->setFieldComment(mf_toIndex(fieldIndex),cmnt);
}
OptionalInt IdfExtensibleGroup::getInt(unsigned fieldIndex, bool returnDefault) const {
  if (!isValid(fieldIndex)) { return boost::none; }
  return m_impl->getInt(mf_toIndex(fieldIndex),returnDefault);
}
OptionalString IdfExtensibleGroup::fieldComment(unsigned fieldIndex, bool returnDefault) const {
  if (!isValid(fieldIndex)) { return boost::none; }
  return m_impl->fieldComment(mf_toIndex(fieldIndex),returnDefault);
}
bool IdfExtensibleGroup::setInt(unsigned fieldIndex, int value) {
  if (!isValid(fieldIndex)) { return false; }
  return m_impl->setInt(mf_toIndex(fieldIndex),value);
}
bool IdfExtensibleGroup::setString(unsigned fieldIndex, const std::string& value, bool checkValidity) {
  // private method for internal use
  if (!isValid(fieldIndex)) { return false; }
  return m_impl->setString(mf_toIndex(fieldIndex),value,checkValidity);
}
// SETTERS
bool WorkspaceExtensibleGroup::setPointer(unsigned fieldIndex, const Handle& targetHandle) {
  if (!isValid(fieldIndex)) { return false; }
  return getImpl<detail::WorkspaceObject_Impl>()->setPointer(mf_toIndex(fieldIndex),targetHandle);
}
OptionalWorkspaceObject WorkspaceExtensibleGroup::getTarget(unsigned fieldIndex) const {
  if (!isValid(fieldIndex)) { return boost::none; }
  return getImpl<detail::WorkspaceObject_Impl>()->getTarget(mf_toIndex(fieldIndex));
}