From f8442ba4c9e4cc5d25e148f1452b1aa47f58968d Mon Sep 17 00:00:00 2001 From: ageay Date: Wed, 8 Feb 2012 10:23:06 +0000 Subject: [PATCH] *** empty log message *** --- src/MEDCoupling/MEDCouplingMemArray.cxx | 10 ++++++++++ src/MEDCoupling/MEDCouplingMemArray.hxx | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index df59ea7e9..2472ef59d 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -136,6 +136,16 @@ void DataArray::reprWithoutNameStream(std::ostream& stream) const stream << "\n"; } +void DataArray::setInfoOnComponents(const std::vector& info) throw(INTERP_KERNEL::Exception) +{ + if(getNumberOfComponents()!=(int)info.size()) + { + std::ostringstream oss; oss << "DataArray::setInfoOnComponents : input is of size " << info.size() << " whereas number of components is equal to " << getNumberOfComponents() << " !"; + throw INTERP_KERNEL::Exception(oss.str().c_str()); + } + _info_on_compo=info; +} + std::vector DataArray::getVarsOnComponent() const { int nbOfCompo=(int)_info_on_compo.size(); diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index 1a68abc4e..993031578 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -95,7 +95,8 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT bool areInfoEquals(const DataArray& other) const; MEDCOUPLING_EXPORT void reprWithoutNameStream(std::ostream& stream) const; MEDCOUPLING_EXPORT std::string getName() const { return _name; } - MEDCOUPLING_EXPORT const std::vector &getInfoOnComponent() const { return _info_on_compo; } + MEDCOUPLING_EXPORT const std::vector &getInfoOnComponents() const { return _info_on_compo; } + MEDCOUPLING_EXPORT void setInfoOnComponents(const std::vector& info) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT std::vector getVarsOnComponent() const; MEDCOUPLING_EXPORT std::vector getUnitsOnComponent() const; MEDCOUPLING_EXPORT std::string getInfoOnComponent(int i) const throw(INTERP_KERNEL::Exception); -- 2.39.2