text: // ***********************************************************************
  //                      DO NOT EDIT THIS FILE !!!
  // ***********************************************************************
  //   This file is automatically generated from the grib_api templates. All
  //   changes will be overridden. If you want to do permanent changes then
  //   you should write them into the 'ComplexGridDataRepresentationImpl.*' files.
  // ***********************************************************************
  
  #include "ComplexGridDataRepresentation.h"
  #include "../../common/GeneralDefinitions.h"
  #include "../../common/GeneralFunctions.h"
  #include <boost/functional/hash.hpp>
  #include <iostream>
  #include <macgyver/Exception.h>
  
  namespace SmartMet {
  namespace GRIB2 {
  
  /*! \brief The constructor of the class. */
  
  ComplexGridDataRepresentation::ComplexGridDataRepresentation() {
    try {
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The destructor of the class. */
  
  ComplexGridDataRepresentation::~ComplexGridDataRepresentation() {
  }
  
  /*! \brief The method reads and initializes all data related to the current object.
  
          \param memoryReader  This object controls the access to the memory mapped file.
  */
  
  void ComplexGridDataRepresentation::read(MemoryReader &memoryReader) {
    try {
      mPacking.read(memoryReader);
      mOriginalValues.read(memoryReader);
      mGroupSplittingMethodUsed = memoryReader.read_UInt8_opt();
      mMissingValueManagementUsed = memoryReader.read_UInt8_opt();
      mPrimaryMissingValueSubstitute = memoryReader.read_UInt32_opt();
      mSecondaryMissingValueSubstitute = memoryReader.read_UInt32_opt();
      mNumberOfGroupsOfDataValues = memoryReader.read_UInt32_opt();
      mReferenceForGroupWidths = memoryReader.read_UInt8_opt();
      mNumberOfBitsUsedForTheGroupWidths = memoryReader.read_UInt8_opt();
      mReferenceForGroupLengths = memoryReader.read_UInt32_opt();
      mLengthIncrementForTheGroupLengths = memoryReader.read_UInt8_opt();
      mTrueLengthOfLastGroup = memoryReader.read_UInt32_opt();
      mNumberOfBitsForScaledGroupLengths = memoryReader.read_UInt8_opt();
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method writes all data related to the current object.
  
          \param dataWriter  This object is used for writing the object data.
  */
  
  void ComplexGridDataRepresentation::write(DataWriter &dataWriter) {
    try {
      mPacking.write(dataWriter);
      mOriginalValues.write(dataWriter);
      dataWriter << mGroupSplittingMethodUsed;
      dataWriter << mMissingValueManagementUsed;
      dataWriter << mPrimaryMissingValueSubstitute;
      dataWriter << mSecondaryMissingValueSubstitute;
      dataWriter << mNumberOfGroupsOfDataValues;
      dataWriter << mReferenceForGroupWidths;
      dataWriter << mNumberOfBitsUsedForTheGroupWidths;
      dataWriter << mReferenceForGroupLengths;
      dataWriter << mLengthIncrementForTheGroupLengths;
      dataWriter << mTrueLengthOfLastGroup;
      dataWriter << mNumberOfBitsForScaledGroupLengths;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method is used for collecting the current class attributeList.
  
      \param prefix         The prefix of the each attributeList parameter.
      \param attributeList  The attributeList storage.
  */
  
  void ComplexGridDataRepresentation::getAttributeList(const std::string &prefix, T::AttributeList &attributeList) const {
    try {
      char name[300];
      sprintf(name, "%sComplexGridDataRepresentation.", prefix.c_str());
      mPacking.getAttributeList(name, attributeList);
      sprintf(name, "%sComplexGridDataRepresentation.", prefix.c_str());
      mOriginalValues.getAttributeList(name, attributeList);
      sprintf(name, "%sComplexGridDataRepresentation.GroupSplittingMethodUsed", prefix.c_str());
      attributeList.addAttribute(name, toString(mGroupSplittingMethodUsed));
      sprintf(name, "%sComplexGridDataRepresentation.MissingValueManagementUsed", prefix.c_str());
      attributeList.addAttribute(name, toString(mMissingValueManagementUsed));
      sprintf(name, "%sComplexGridDataRepresentation.PrimaryMissingValueSubstitute", prefix.c_str());
      attributeList.addAttribute(name, toString(mPrimaryMissingValueSubstitute));
      sprintf(name, "%sComplexGridDataRepresentation.SecondaryMissingValueSubstitute", prefix.c_str());
      attributeList.addAttribute(name, toString(mSecondaryMissingValueSubstitute));
      sprintf(name, "%sComplexGridDataRepresentation.NumberOfGroupsOfDataValues", prefix.c_str());
      attributeList.addAttribute(name, toString(mNumberOfGroupsOfDataValues));
      sprintf(name, "%sComplexGridDataRepresentation.ReferenceForGroupWidths", prefix.c_str());
      attributeList.addAttribute(name, toString(mReferenceForGroupWidths));
      sprintf(name, "%sComplexGridDataRepresentation.NumberOfBitsUsedForTheGroupWidths", prefix.c_str());
      attributeList.addAttribute(name, toString(mNumberOfBitsUsedForTheGroupWidths));
      sprintf(name, "%sComplexGridDataRepresentation.ReferenceForGroupLengths", prefix.c_str());
      attributeList.addAttribute(name, toString(mReferenceForGroupLengths));
      sprintf(name, "%sComplexGridDataRepresentation.LengthIncrementForTheGroupLengths", prefix.c_str());
      attributeList.addAttribute(name, toString(mLengthIncrementForTheGroupLengths));
      sprintf(name, "%sComplexGridDataRepresentation.TrueLengthOfLastGroup", prefix.c_str());
      attributeList.addAttribute(name, toString(mTrueLengthOfLastGroup));
      sprintf(name, "%sComplexGridDataRepresentation.NumberOfBitsForScaledGroupLengths", prefix.c_str());
      attributeList.addAttribute(name, toString(mNumberOfBitsForScaledGroupLengths));
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method is used for getting attribute values by their names.
  
      \param attributeName  The name of the attribute.
      \param attributeValue The value of the attribute (string).
  */
  
  bool ComplexGridDataRepresentation::getAttributeValue(const char *attributeName, std::string &attributeValue) const {
    try {
      if (attributeName == nullptr)
        return false;
      if (mPacking.getAttributeValue(attributeName, attributeValue))
        return true;
      if (mOriginalValues.getAttributeValue(attributeName, attributeValue))
        return true;
      if (strcasecmp(attributeName, "GroupSplittingMethodUsed") == 0) {
        attributeValue = toString(mGroupSplittingMethodUsed);
        return true;
      }
      if (strcasecmp(attributeName, "MissingValueManagementUsed") == 0) {
        attributeValue = toString(mMissingValueManagementUsed);
        return true;
      }
      if (strcasecmp(attributeName, "PrimaryMissingValueSubstitute") == 0) {
        attributeValue = toString(mPrimaryMissingValueSubstitute);
        return true;
      }
      if (strcasecmp(attributeName, "SecondaryMissingValueSubstitute") == 0) {
        attributeValue = toString(mSecondaryMissingValueSubstitute);
        return true;
      }
      if (strcasecmp(attributeName, "NumberOfGroupsOfDataValues") == 0) {
        attributeValue = toString(mNumberOfGroupsOfDataValues);
        return true;
      }
      if (strcasecmp(attributeName, "ReferenceForGroupWidths") == 0) {
        attributeValue = toString(mReferenceForGroupWidths);
        return true;
      }
      if (strcasecmp(attributeName, "NumberOfBitsUsedForTheGroupWidths") == 0) {
        attributeValue = toString(mNumberOfBitsUsedForTheGroupWidths);
        return true;
      }
      if (strcasecmp(attributeName, "ReferenceForGroupLengths") == 0) {
        attributeValue = toString(mReferenceForGroupLengths);
        return true;
      }
      if (strcasecmp(attributeName, "LengthIncrementForTheGroupLengths") == 0) {
        attributeValue = toString(mLengthIncrementForTheGroupLengths);
        return true;
      }
      if (strcasecmp(attributeName, "TrueLengthOfLastGroup") == 0) {
        attributeValue = toString(mTrueLengthOfLastGroup);
        return true;
      }
      if (strcasecmp(attributeName, "NumberOfBitsForScaledGroupLengths") == 0) {
        attributeValue = toString(mNumberOfBitsForScaledGroupLengths);
        return true;
      }
      return false;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method is used for checking if the attribute value matches to the given value.
  
      \param attributeName  The name of the attribute.
      \param attributeValue The value of the attribute (string).
  */
  
  bool ComplexGridDataRepresentation::hasAttributeValue(const char *attributeName, const char *attributeValue) const {
    try {
      if (attributeName == nullptr || attributeValue == nullptr)
        return false;
      if (mPacking.hasAttributeValue(attributeName, attributeValue))
        return true;
      if (mOriginalValues.hasAttributeValue(attributeName, attributeValue))
        return true;
      if (strcasecmp(attributeName, "GroupSplittingMethodUsed") == 0 && strcasecmp(attributeValue, toString(mGroupSplittingMethodUsed).c_str()) == 0)
        return true;
      if (strcasecmp(attributeName, "MissingValueManagementUsed") == 0 && strcasecmp(attributeValue, toString(mMissingValueManagementUsed).c_str()) == 0)
        return true;
      if (strcasecmp(attributeName, "PrimaryMissingValueSubstitute") == 0 && strcasecmp(attributeValue, toString(mPrimaryMissingValueSubstitute).c_str()) == 0)
        return true;
      if (strcasecmp(attributeName, "SecondaryMissingValueSubstitute") == 0 && strcasecmp(attributeValue, toString(mSecondaryMissingValueSubstitute).c_str()) == 0)
        return true;
      if (strcasecmp(attributeName, "NumberOfGroupsOfDataValues") == 0 && strcasecmp(attributeValue, toString(mNumberOfGroupsOfDataValues).c_str()) == 0)
        return true;
      if (strcasecmp(attributeName, "ReferenceForGroupWidths") == 0 && strcasecmp(attributeValue, toString(mReferenceForGroupWidths).c_str()) == 0)
        return true;
      if (strcasecmp(attributeName, "NumberOfBitsUsedForTheGroupWidths") == 0 && strcasecmp(attributeValue, toString(mNumberOfBitsUsedForTheGroupWidths).c_str()) == 0)
        return true;
      if (strcasecmp(attributeName, "ReferenceForGroupLengths") == 0 && strcasecmp(attributeValue, toString(mReferenceForGroupLengths).c_str()) == 0)
        return true;
      if (strcasecmp(attributeName, "LengthIncrementForTheGroupLengths") == 0 && strcasecmp(attributeValue, toString(mLengthIncrementForTheGroupLengths).c_str()) == 0)
        return true;
      if (strcasecmp(attributeName, "TrueLengthOfLastGroup") == 0 && strcasecmp(attributeValue, toString(mTrueLengthOfLastGroup).c_str()) == 0)
        return true;
      if (strcasecmp(attributeName, "NumberOfBitsForScaledGroupLengths") == 0 && strcasecmp(attributeValue, toString(mNumberOfBitsForScaledGroupLengths).c_str()) == 0)
        return true;
      return false;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method prints the content of the current object into the given stream.
  
      \param ostream      The output stream.
      \param level        The print level (used when printing multi-level structures).
      \param optionFlags  The printing options expressed in flag-bits.
  */
  
  void ComplexGridDataRepresentation::print(std::ostream &stream, uint level, uint optionFlags) const {
    try {
      stream << space(level) << "ComplexGridDataRepresentation\n";
      mPacking.print(stream, level + 1, optionFlags);
      mOriginalValues.print(stream, level + 1, optionFlags);
      stream << space(level) << "- GroupSplittingMethodUsed = " << toString(mGroupSplittingMethodUsed) << "\n";
      stream << space(level) << "- MissingValueManagementUsed = " << toString(mMissingValueManagementUsed) << "\n";
      stream << space(level) << "- PrimaryMissingValueSubstitute = " << toString(mPrimaryMissingValueSubstitute) << "\n";
      stream << space(level) << "- SecondaryMissingValueSubstitute = " << toString(mSecondaryMissingValueSubstitute) << "\n";
      stream << space(level) << "- NumberOfGroupsOfDataValues = " << toString(mNumberOfGroupsOfDataValues) << "\n";
      stream << space(level) << "- ReferenceForGroupWidths = " << toString(mReferenceForGroupWidths) << "\n";
      stream << space(level) << "- NumberOfBitsUsedForTheGroupWidths = " << toString(mNumberOfBitsUsedForTheGroupWidths) << "\n";
      stream << space(level) << "- ReferenceForGroupLengths = " << toString(mReferenceForGroupLengths) << "\n";
      stream << space(level) << "- LengthIncrementForTheGroupLengths = " << toString(mLengthIncrementForTheGroupLengths) << "\n";
      stream << space(level) << "- TrueLengthOfLastGroup = " << toString(mTrueLengthOfLastGroup) << "\n";
      stream << space(level) << "- NumberOfBitsForScaledGroupLengths = " << toString(mNumberOfBitsForScaledGroupLengths) << "\n";
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method counts the hash value of the current object. */
  
  T::Hash ComplexGridDataRepresentation::countHash() const {
    try {
      std::size_t seed = 0;
      if (mGroupSplittingMethodUsed)
        boost::hash_combine(seed, *mGroupSplittingMethodUsed);
      if (mMissingValueManagementUsed)
        boost::hash_combine(seed, *mMissingValueManagementUsed);
      if (mPrimaryMissingValueSubstitute)
        boost::hash_combine(seed, *mPrimaryMissingValueSubstitute);
      if (mSecondaryMissingValueSubstitute)
        boost::hash_combine(seed, *mSecondaryMissingValueSubstitute);
      if (mNumberOfGroupsOfDataValues)
        boost::hash_combine(seed, *mNumberOfGroupsOfDataValues);
      if (mReferenceForGroupWidths)
        boost::hash_combine(seed, *mReferenceForGroupWidths);
      if (mNumberOfBitsUsedForTheGroupWidths)
        boost::hash_combine(seed, *mNumberOfBitsUsedForTheGroupWidths);
      if (mReferenceForGroupLengths)
        boost::hash_combine(seed, *mReferenceForGroupLengths);
      if (mLengthIncrementForTheGroupLengths)
        boost::hash_combine(seed, *mLengthIncrementForTheGroupLengths);
      if (mTrueLengthOfLastGroup)
        boost::hash_combine(seed, *mTrueLengthOfLastGroup);
      if (mNumberOfBitsForScaledGroupLengths)
        boost::hash_combine(seed, *mNumberOfBitsForScaledGroupLengths);
      return seed;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method return the template number of the current class. */
  
  uint ComplexGridDataRepresentation::getTemplateNumber() const {
    return 2;
  }
  
  RepresentationDefinition *ComplexGridDataRepresentation::createRepresentationDefinition() const {
    try {
      return static_cast<RepresentationDefinition *>(new ComplexGridDataRepresentation(*this));
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the pointer to the {@link mPacking} attribute. */
  
  PackingSettings *ComplexGridDataRepresentation::getPacking() const {
    try {
      return static_cast<PackingSettings *>(&mPacking);
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the pointer to the {@link mOriginalValues} attribute. */
  
  OriginalValuesSettings *ComplexGridDataRepresentation::getOriginalValues() const {
    try {
      return static_cast<OriginalValuesSettings *>(&mOriginalValues);
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the value of the {@link mGroupSplittingMethodUsed} attribute. */
  
  const T::UInt8_opt &ComplexGridDataRepresentation::getGroupSplittingMethodUsed() const {
    try {
      return mGroupSplittingMethodUsed;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the value of the {@link mMissingValueManagementUsed} attribute. */
  
  const T::UInt8_opt &ComplexGridDataRepresentation::getMissingValueManagementUsed() const {
    try {
      return mMissingValueManagementUsed;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the value of the {@link mPrimaryMissingValueSubstitute} attribute. */
  
  const T::UInt32_opt &ComplexGridDataRepresentation::getPrimaryMissingValueSubstitute() const {
    try {
      return mPrimaryMissingValueSubstitute;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the value of the {@link mSecondaryMissingValueSubstitute} attribute. */
  
  const T::UInt32_opt &ComplexGridDataRepresentation::getSecondaryMissingValueSubstitute() const {
    try {
      return mSecondaryMissingValueSubstitute;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the value of the {@link mNumberOfGroupsOfDataValues} attribute. */
  
  const T::UInt32_opt &ComplexGridDataRepresentation::getNumberOfGroupsOfDataValues() const {
    try {
      return mNumberOfGroupsOfDataValues;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the value of the {@link mReferenceForGroupWidths} attribute. */
  
  const T::UInt8_opt &ComplexGridDataRepresentation::getReferenceForGroupWidths() const {
    try {
      return mReferenceForGroupWidths;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the value of the {@link mNumberOfBitsUsedForTheGroupWidths} attribute. */
  
  const T::UInt8_opt &ComplexGridDataRepresentation::getNumberOfBitsUsedForTheGroupWidths() const {
    try {
      return mNumberOfBitsUsedForTheGroupWidths;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the value of the {@link mReferenceForGroupLengths} attribute. */
  
  const T::UInt32_opt &ComplexGridDataRepresentation::getReferenceForGroupLengths() const {
    try {
      return mReferenceForGroupLengths;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the value of the {@link mLengthIncrementForTheGroupLengths} attribute. */
  
  const T::UInt8_opt &ComplexGridDataRepresentation::getLengthIncrementForTheGroupLengths() const {
    try {
      return mLengthIncrementForTheGroupLengths;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the value of the {@link mTrueLengthOfLastGroup} attribute. */
  
  const T::UInt32_opt &ComplexGridDataRepresentation::getTrueLengthOfLastGroup() const {
    try {
      return mTrueLengthOfLastGroup;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the value of the {@link mNumberOfBitsForScaledGroupLengths} attribute. */
  
  const T::UInt8_opt &ComplexGridDataRepresentation::getNumberOfBitsForScaledGroupLengths() const {
    try {
      return mNumberOfBitsForScaledGroupLengths;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setPacking(PackingSettings &packing) {
    try {
      mPacking = packing;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setOriginalValues(OriginalValuesSettings &originalValues) {
    try {
      mOriginalValues = originalValues;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setGroupSplittingMethodUsed(T::UInt8_opt groupSplittingMethodUsed) {
    try {
      mGroupSplittingMethodUsed = groupSplittingMethodUsed;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setMissingValueManagementUsed(T::UInt8_opt missingValueManagementUsed) {
    try {
      mMissingValueManagementUsed = missingValueManagementUsed;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setPrimaryMissingValueSubstitute(T::UInt32_opt primaryMissingValueSubstitute) {
    try {
      mPrimaryMissingValueSubstitute = primaryMissingValueSubstitute;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setSecondaryMissingValueSubstitute(T::UInt32_opt secondaryMissingValueSubstitute) {
    try {
      mSecondaryMissingValueSubstitute = secondaryMissingValueSubstitute;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setNumberOfGroupsOfDataValues(T::UInt32_opt numberOfGroupsOfDataValues) {
    try {
      mNumberOfGroupsOfDataValues = numberOfGroupsOfDataValues;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setReferenceForGroupWidths(T::UInt8_opt referenceForGroupWidths) {
    try {
      mReferenceForGroupWidths = referenceForGroupWidths;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setNumberOfBitsUsedForTheGroupWidths(T::UInt8_opt numberOfBitsUsedForTheGroupWidths) {
    try {
      mNumberOfBitsUsedForTheGroupWidths = numberOfBitsUsedForTheGroupWidths;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setReferenceForGroupLengths(T::UInt32_opt referenceForGroupLengths) {
    try {
      mReferenceForGroupLengths = referenceForGroupLengths;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setLengthIncrementForTheGroupLengths(T::UInt8_opt lengthIncrementForTheGroupLengths) {
    try {
      mLengthIncrementForTheGroupLengths = lengthIncrementForTheGroupLengths;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setTrueLengthOfLastGroup(T::UInt32_opt trueLengthOfLastGroup) {
    try {
      mTrueLengthOfLastGroup = trueLengthOfLastGroup;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void ComplexGridDataRepresentation::setNumberOfBitsForScaledGroupLengths(T::UInt8_opt numberOfBitsForScaledGroupLengths) {
    try {
      mNumberOfBitsForScaledGroupLengths = numberOfBitsForScaledGroupLengths;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  } // namespace GRIB2
  } // namespace SmartMet
  