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 'RotatedGaussianImpl.*' files.
  // ***********************************************************************
  
  #include "RotatedGaussian.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. */
  
  RotatedGaussian::RotatedGaussian() {
    try {
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The destructor of the class. */
  
  RotatedGaussian::~RotatedGaussian() {
  }
  
  /*! \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 RotatedGaussian::read(MemoryReader &memoryReader) {
    try {
      mEarthShape.read(memoryReader);
      mGaussian.read(memoryReader);
      mRotation.read(memoryReader);
    } 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 RotatedGaussian::write(DataWriter &dataWriter) {
    try {
      mEarthShape.write(dataWriter);
      mGaussian.write(dataWriter);
      mRotation.write(dataWriter);
    } 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 RotatedGaussian::getAttributeList(const std::string &prefix, T::AttributeList &attributeList) const {
    try {
      char name[300];
      sprintf(name, "%sRotatedGaussian.", prefix.c_str());
      mEarthShape.getAttributeList(name, attributeList);
      sprintf(name, "%sRotatedGaussian.", prefix.c_str());
      mGaussian.getAttributeList(name, attributeList);
      sprintf(name, "%sRotatedGaussian.", prefix.c_str());
      mRotation.getAttributeList(name, attributeList);
    } 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 RotatedGaussian::getAttributeValue(const char *attributeName, std::string &attributeValue) const {
    try {
      if (attributeName == nullptr)
        return false;
      if (mEarthShape.getAttributeValue(attributeName, attributeValue))
        return true;
      if (mGaussian.getAttributeValue(attributeName, attributeValue))
        return true;
      if (mRotation.getAttributeValue(attributeName, attributeValue))
        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 RotatedGaussian::hasAttributeValue(const char *attributeName, const char *attributeValue) const {
    try {
      if (attributeName == nullptr || attributeValue == nullptr)
        return false;
      if (mEarthShape.hasAttributeValue(attributeName, attributeValue))
        return true;
      if (mGaussian.hasAttributeValue(attributeName, attributeValue))
        return true;
      if (mRotation.hasAttributeValue(attributeName, attributeValue))
        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 RotatedGaussian::print(std::ostream &stream, uint level, uint optionFlags) const {
    try {
      stream << space(level) << "RotatedGaussian\n";
      mEarthShape.print(stream, level + 1, optionFlags);
      mGaussian.print(stream, level + 1, optionFlags);
      mRotation.print(stream, level + 1, optionFlags);
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method counts the hash value of the current object. */
  
  T::Hash RotatedGaussian::countHash() const {
    try {
      std::size_t seed = 0;
      return seed;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method return the template number of the current class. */
  
  uint RotatedGaussian::getTemplateNumber() const {
    return 41;
  }
  
  GridDefinition *RotatedGaussian::createGridDefinition() const {
    try {
      return static_cast<GridDefinition *>(new RotatedGaussian(*this));
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the pointer to the {@link mEarthShape} attribute. */
  
  EarthShapeSettings *RotatedGaussian::getEarthShape() const {
    try {
      return static_cast<EarthShapeSettings *>(&mEarthShape);
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the pointer to the {@link mGaussian} attribute. */
  
  GaussianSettings *RotatedGaussian::getGaussian() const {
    try {
      return static_cast<GaussianSettings *>(&mGaussian);
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  /*! \brief The method returns the pointer to the {@link mRotation} attribute. */
  
  RotationSettings *RotatedGaussian::getRotation() const {
    try {
      return static_cast<RotationSettings *>(&mRotation);
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void RotatedGaussian::setEarthShape(EarthShapeSettings &earthShape) {
    try {
      mEarthShape = earthShape;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void RotatedGaussian::setGaussian(GaussianSettings &gaussian) {
    try {
      mGaussian = gaussian;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  void RotatedGaussian::setRotation(RotationSettings &rotation) {
    try {
      mRotation = rotation;
    } catch (...) {
      throw Fmi::Exception(BCP, "Operation failed", nullptr);
    }
  }
  
  } // namespace GRIB2
  } // namespace SmartMet
  