/*
 Do not modify, auto-generated by classes.py

 Copyright 2019 Alain Dargelas

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

/*
 * File:   udp_defn.h
 * Author:
 *
 * Created on December 14, 2019, 10:03 PM
 */

#ifndef UHDM_UDP_DEFN_H
#define UHDM_UDP_DEFN_H

#include <uhdm/sv_vpi_user.h>
#include <uhdm/uhdm_vpi_user.h>

#include <uhdm/containers.h>
#include <uhdm/BaseClass.h>




namespace UHDM {
class initial;

class udp_defn final : public BaseClass {
  UHDM_IMPLEMENT_RTTI(udp_defn, BaseClass)
public:
  // Implicit constructor used to initialize all members,
  // comment: udp_defn();
  virtual ~udp_defn() final = default;

  virtual bool VpiDefName(std::string_view data) final;
  virtual std::string_view VpiDefName() const final;

  int32_t VpiSize() const { return vpiSize_; }
  bool VpiSize(int32_t data) {
    vpiSize_ = data;
    return true;
  }

  bool VpiProtected() const { return vpiProtected_; }
  bool VpiProtected(bool data) {
    vpiProtected_ = data;
    return true;
  }

  int32_t VpiPrimType() const { return vpiPrimType_; }
  bool VpiPrimType(int32_t data) {
    vpiPrimType_ = data;
    return true;
  }

  VectorOfattribute* Attributes() const { return attributes_; }
  bool Attributes(VectorOfattribute* data) {
    attributes_ = data;
    return true;
  }

  VectorOfio_decl* Io_decls() const { return io_decls_; }
  bool Io_decls(VectorOfio_decl* data) {
    io_decls_ = data;
    return true;
  }

  VectorOftable_entry* Table_entrys() const { return table_entrys_; }
  bool Table_entrys(VectorOftable_entry* data) {
    table_entrys_ = data;
    return true;
  }

  initial* Initial()  { return initial_; }
  const initial* Initial() const { return initial_; }
  template <typename T>
  T* Initial() {
    return (initial_ == nullptr) ? nullptr : any_cast<T*>(initial_);
  }
  template <typename T>
  const T* Initial() const {
    return (initial_ == nullptr) ? nullptr : any_cast<const T*>(initial_);
  }
  bool Initial(initial* data) {
    initial_ = data;
    return true;
  }

  virtual uint32_t VpiType() const final { return vpiUdpDefn; }

  virtual udp_defn* DeepClone(BaseClass* parent, CloneContext* context) const override;

  virtual const BaseClass* GetByVpiName(std::string_view name) const override;

  virtual std::tuple<const BaseClass*, UHDM_OBJECT_TYPE, const std::vector<const BaseClass*>*> GetByVpiType(int32_t type) const override;

  virtual vpi_property_value_t GetVpiPropertyValue(int32_t property) const override;

  virtual int32_t Compare(const BaseClass* other, CompareContext* context) const override;

  virtual  UHDM_OBJECT_TYPE UhdmType() const final { return UHDM_OBJECT_TYPE::uhdmudp_defn; }

protected:
  void DeepCopy(udp_defn* clone, BaseClass* parent, CloneContext* context) const;

private:
  SymbolId vpiDefName_;

  int32_t vpiSize_ = 0;

  bool vpiProtected_ = false;

  int32_t vpiPrimType_ = 0;

  VectorOfattribute* attributes_ = nullptr;

  VectorOfio_decl* io_decls_ = nullptr;

  VectorOftable_entry* table_entrys_ = nullptr;

  initial* initial_ = nullptr;
};


typedef FactoryT<udp_defn> udp_defnFactory;


typedef FactoryT<std::vector<udp_defn *>> VectorOfudp_defnFactory;

}  // namespace UHDM

#endif
