/*
 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:   nets.h
 * Author:
 *
 * Created on December 14, 2019, 10:03 PM
 */

#ifndef UHDM_NETS_H
#define UHDM_NETS_H

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

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




namespace UHDM {
class module_inst;
class nets;

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

  bool VpiArrayMember() const { return vpiArrayMember_; }
  bool VpiArrayMember(bool data) {
    vpiArrayMember_ = data;
    return true;
  }

  bool VpiConstantSelect() const { return vpiConstantSelect_; }
  bool VpiConstantSelect(bool data) {
    vpiConstantSelect_ = data;
    return true;
  }

  bool VpiExpanded() const { return vpiExpanded_; }
  bool VpiExpanded(bool data) {
    vpiExpanded_ = data;
    return true;
  }

  bool VpiImplicitDecl() const { return vpiImplicitDecl_; }
  bool VpiImplicitDecl(bool data) {
    vpiImplicitDecl_ = data;
    return true;
  }

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

  bool VpiFullName(std::string_view data);
  std::string_view VpiFullName() const;

  bool VpiNetDeclAssign() const { return vpiNetDeclAssign_; }
  bool VpiNetDeclAssign(bool data) {
    vpiNetDeclAssign_ = data;
    return true;
  }

  int32_t VpiNetType() const { return vpiNetType_; }
  bool VpiNetType(int32_t data) {
    vpiNetType_ = data;
    return true;
  }

  int32_t VpiResolvedNetType() const { return vpiResolvedNetType_; }
  bool VpiResolvedNetType(int32_t data) {
    vpiResolvedNetType_ = data;
    return true;
  }

  bool VpiScalar() const { return vpiScalar_; }
  bool VpiScalar(bool data) {
    vpiScalar_ = data;
    return true;
  }

  bool VpiExplicitScalared() const { return vpiExplicitScalared_; }
  bool VpiExplicitScalared(bool data) {
    vpiExplicitScalared_ = data;
    return true;
  }

  bool VpiSigned() const { return vpiSigned_; }
  bool VpiSigned(bool data) {
    vpiSigned_ = data;
    return true;
  }

  int32_t VpiStrength0() const { return vpiStrength0_; }
  bool VpiStrength0(int32_t data) {
    vpiStrength0_ = data;
    return true;
  }

  int32_t VpiStrength1() const { return vpiStrength1_; }
  bool VpiStrength1(int32_t data) {
    vpiStrength1_ = data;
    return true;
  }

  int32_t VpiChargeStrength() const { return vpiChargeStrength_; }
  bool VpiChargeStrength(int32_t data) {
    vpiChargeStrength_ = data;
    return true;
  }

  bool VpiVector() const { return vpiVector_; }
  bool VpiVector(bool data) {
    vpiVector_ = data;
    return true;
  }

  bool VpiExplicitVectored() const { return vpiExplicitVectored_; }
  bool VpiExplicitVectored(bool data) {
    vpiExplicitVectored_ = data;
    return true;
  }

  bool VpiStructUnionMember() const { return vpiStructUnionMember_; }
  bool VpiStructUnionMember(bool data) {
    vpiStructUnionMember_ = data;
    return true;
  }

  VectorOfports* Ports() const { return ports_; }
  bool Ports(VectorOfports* data) {
    ports_ = data;
    return true;
  }

  VectorOfnet_drivers* Drivers() const { return drivers_; }
  bool Drivers(VectorOfnet_drivers* data) {
    drivers_ = data;
    return true;
  }

  VectorOfnet_loads* Loads() const { return loads_; }
  bool Loads(VectorOfnet_loads* data) {
    loads_ = data;
    return true;
  }

  VectorOfnet_drivers* Local_drivers() const { return local_drivers_; }
  bool Local_drivers(VectorOfnet_drivers* data) {
    local_drivers_ = data;
    return true;
  }

  VectorOfnet_loads* Local_loads() const { return local_loads_; }
  bool Local_loads(VectorOfnet_loads* data) {
    local_loads_ = data;
    return true;
  }

  VectorOfprim_term* Prim_terms() const { return prim_terms_; }
  bool Prim_terms(VectorOfprim_term* data) {
    prim_terms_ = data;
    return true;
  }

  VectorOfcont_assign* Cont_assigns() const { return cont_assigns_; }
  bool Cont_assigns(VectorOfcont_assign* data) {
    cont_assigns_ = data;
    return true;
  }

  VectorOfpath_term* Path_terms() const { return path_terms_; }
  bool Path_terms(VectorOfpath_term* data) {
    path_terms_ = data;
    return true;
  }

  VectorOftchk_term* Tchk_terms() const { return tchk_terms_; }
  bool Tchk_terms(VectorOftchk_term* data) {
    tchk_terms_ = data;
    return true;
  }

  nets* Sim_net()  { return sim_net_; }
  const nets* Sim_net() const { return sim_net_; }
  template <typename T>
  T* Sim_net() {
    return (sim_net_ == nullptr) ? nullptr : any_cast<T*>(sim_net_);
  }
  template <typename T>
  const T* Sim_net() const {
    return (sim_net_ == nullptr) ? nullptr : any_cast<const T*>(sim_net_);
  }
  bool Sim_net(nets* data) {
    sim_net_ = data;
    return true;
  }

  module_inst* Module_inst()  { return module_inst_; }
  const module_inst* Module_inst() const { return module_inst_; }
  template <typename T>
  T* Module_inst() {
    return (module_inst_ == nullptr) ? nullptr : any_cast<T*>(module_inst_);
  }
  template <typename T>
  const T* Module_inst() const {
    return (module_inst_ == nullptr) ? nullptr : any_cast<const T*>(module_inst_);
  }
  bool Module_inst(module_inst* data) {
    module_inst_ = data;
    return true;
  }

  virtual nets* DeepClone(BaseClass* parent, CloneContext* context) const override = 0;

  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 override { return UHDM_OBJECT_TYPE::uhdmnets; }

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

private:
  bool vpiArrayMember_ = false;

  bool vpiConstantSelect_ = false;

  bool vpiExpanded_ = false;

  bool vpiImplicitDecl_ = false;

  SymbolId vpiName_;

  SymbolId vpiFullName_;

  bool vpiNetDeclAssign_ = false;

  int32_t vpiNetType_ = 0;

  int32_t vpiResolvedNetType_ = 0;

  bool vpiScalar_ = false;

  bool vpiExplicitScalared_ = false;

  bool vpiSigned_ = false;

  int32_t vpiStrength0_ = 0;

  int32_t vpiStrength1_ = 0;

  int32_t vpiChargeStrength_ = 0;

  bool vpiVector_ = false;

  bool vpiExplicitVectored_ = false;

  bool vpiStructUnionMember_ = false;

  VectorOfports* ports_ = nullptr;

  VectorOfnet_drivers* drivers_ = nullptr;

  VectorOfnet_loads* loads_ = nullptr;

  VectorOfnet_drivers* local_drivers_ = nullptr;

  VectorOfnet_loads* local_loads_ = nullptr;

  VectorOfprim_term* prim_terms_ = nullptr;

  VectorOfcont_assign* cont_assigns_ = nullptr;

  VectorOfpath_term* path_terms_ = nullptr;

  VectorOftchk_term* tchk_terms_ = nullptr;

  nets* sim_net_ = nullptr;

  module_inst* module_inst_ = nullptr;
};

#if 0 // This class cannot be instantiated
typedef FactoryT<nets> netsFactory;
#endif

typedef FactoryT<std::vector<nets *>> VectorOfnetsFactory;

}  // namespace UHDM

#endif
