-// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// -------------------------------------------------------
-Field::Field(const XAO::Dimension& dimension,
- const int& nbElements, const int& nbComponents, const std::string& name)
- : m_name(name), m_dimension(dimension), m_nbElements(nbElements), m_nbComponents(nbComponents)
+Field::Field(XAO::Dimension dimension,
+ int nbElements, int nbComponents, const std::string& name)
+ : m_name(name), m_dimension(dimension),
+ m_nbComponents(nbComponents), m_components(nbComponents, ""),
+ m_nbElements(nbElements)
{
- m_components.reserve(nbComponents);
- for (int i = 0; i < nbComponents; ++i)
- m_components.push_back("");
}
Field::~Field()
{
- for (unsigned int i = 0; i < m_steps.size(); ++i)
- delete m_steps[i];
+ for (unsigned int i = 0; i < m_steps.size(); ++i)
+ delete m_steps[i];
}
-Field* Field::createField(const XAO::Type& type, const XAO::Dimension& dimension,
- const int& nbElements, const int& nbComponents, const std::string& name)
-throw (XAO_Exception)
+Field* Field::createField(XAO::Type type, XAO::Dimension dimension,
+ int nbElements, int nbComponents, const std::string& name)
{
if (type == XAO::BOOLEAN)
return new BooleanField(dimension, nbElements, nbComponents, name);
throw XAO_Exception(MsgBuilder() << "Bad Type: " << type);
}
-const std::string Field::getComponentName(const int& index)
-throw (XAO_Exception)
+const std::string Field::getComponentName(int index)
{
checkComponent(index);
return m_components[index];
}
-void Field::setComponentName(const int& index, const std::string& name)
-throw (XAO_Exception)
+void Field::setComponentName(int index, const std::string& name)
{
checkComponent(index);
m_components[index] = name;
}
void Field::setComponentsNames(const std::vector<std::string>& names)
-throw (XAO_Exception)
{
for (unsigned int i = 0; i < names.size(); ++i)
{
- if (i < m_nbComponents)
+ if ((int)i < m_nbComponents)
m_components[i] = names[i];
}
}
return false;
}
-bool Field::hasStep(const int& step)
+bool Field::hasStep(int step)
{
std::vector<Step*>::iterator it = m_steps.begin();
for (; it != m_steps.end(); ++it)
return false;
}
-void Field::checkComponent(const int& component)
-throw (XAO_Exception)
+void Field::checkComponent(int component)
{
if (component < m_nbComponents && component >= 0)
return;
<< m_nbComponents-1 << "]: " << component);
}
-void Field::checkStepIndex(const int& step)
-throw (XAO_Exception)
+void Field::checkStepIndex(int step)
{
- if (step < m_steps.size() && step >= 0)
+ if (step < (int)m_steps.size() && step >= 0)
return;
throw XAO_Exception(MsgBuilder() << "Step index is out of range [0, "