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

#ifndef UHDM_GEN_SCOPE_H
#define UHDM_GEN_SCOPE_H

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

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

#include "assertion.h"


namespace UHDM {
class expr;

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

  expr* VpiIndex()  { return vpiIndex_; }
  const expr* VpiIndex() const { return vpiIndex_; }
  template <typename T>
  T* VpiIndex() {
    return (vpiIndex_ == nullptr) ? nullptr : any_cast<T*>(vpiIndex_);
  }
  template <typename T>
  const T* VpiIndex() const {
    return (vpiIndex_ == nullptr) ? nullptr : any_cast<const T*>(vpiIndex_);
  }
  bool VpiIndex(expr* data) {
    vpiIndex_ = data;
    return true;
  }

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

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

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

  VectorOfnet* Nets() const { return nets_; }
  bool Nets(VectorOfnet* data) {
    nets_ = data;
    return true;
  }

  VectorOfarray_net* Array_nets() const { return array_nets_; }
  bool Array_nets(VectorOfarray_net* data) {
    array_nets_ = data;
    return true;
  }

  VectorOfprocess_stmt* Process() const { return process_; }
  bool Process(VectorOfprocess_stmt* data) {
    process_ = data;
    return true;
  }

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

  VectorOfmodule_inst* Modules() const { return modules_; }
  bool Modules(VectorOfmodule_inst* data) {
    modules_ = data;
    return true;
  }

  VectorOfmodule_array* Module_arrays() const { return module_arrays_; }
  bool Module_arrays(VectorOfmodule_array* data) {
    module_arrays_ = data;
    return true;
  }

  VectorOfprimitive* Primitives() const { return primitives_; }
  bool Primitives(VectorOfprimitive* data) {
    primitives_ = data;
    return true;
  }

  VectorOfprimitive_array* Primitive_arrays() const { return primitive_arrays_; }
  bool Primitive_arrays(VectorOfprimitive_array* data) {
    primitive_arrays_ = data;
    return true;
  }

  VectorOfdef_param* Def_params() const { return def_params_; }
  bool Def_params(VectorOfdef_param* data) {
    def_params_ = data;
    return true;
  }

  VectorOfgen_scope_array* Gen_scope_arrays() const { return gen_scope_arrays_; }
  bool Gen_scope_arrays(VectorOfgen_scope_array* data) {
    gen_scope_arrays_ = data;
    return true;
  }

  VectorOfprogram* Programs() const { return programs_; }
  bool Programs(VectorOfprogram* data) {
    programs_ = data;
    return true;
  }

  VectorOfprogram* Program_arrays() const { return program_arrays_; }
  bool Program_arrays(VectorOfprogram* data) {
    program_arrays_ = data;
    return true;
  }

  VectorOfany* Assertions() const { return assertions_; }
  bool Assertions(VectorOfany* data) {
    if (!assertionGroupCompliant(data)) return false;
    assertions_ = data;
    return true;
  }

  VectorOfinterface_inst* Interfaces() const { return interfaces_; }
  bool Interfaces(VectorOfinterface_inst* data) {
    interfaces_ = data;
    return true;
  }

  VectorOfinterface_array* Interface_arrays() const { return interface_arrays_; }
  bool Interface_arrays(VectorOfinterface_array* data) {
    interface_arrays_ = data;
    return true;
  }

  VectorOfalias_stmt* Alias_stmts() const { return alias_stmts_; }
  bool Alias_stmts(VectorOfalias_stmt* data) {
    alias_stmts_ = data;
    return true;
  }

  VectorOfclocking_block* Clocking_blocks() const { return clocking_blocks_; }
  bool Clocking_blocks(VectorOfclocking_block* data) {
    clocking_blocks_ = data;
    return true;
  }

  VectorOftask_func* Task_funcs() const { return task_funcs_; }
  bool Task_funcs(VectorOftask_func* data) {
    task_funcs_ = data;
    return true;
  }

  VectorOftf_call* Elab_tasks() const { return elab_tasks_; }
  bool Elab_tasks(VectorOftf_call* data) {
    elab_tasks_ = data;
    return true;
  }

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

  virtual gen_scope* 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::uhdmgen_scope; }

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

private:
  expr* vpiIndex_ = nullptr;

  bool vpiArrayMember_ = false;

  bool vpiProtected_ = false;

  bool vpiImplicitDecl_ = false;

  VectorOfnet* nets_ = nullptr;

  VectorOfarray_net* array_nets_ = nullptr;

  VectorOfprocess_stmt* process_ = nullptr;

  VectorOfcont_assign* cont_assigns_ = nullptr;

  VectorOfmodule_inst* modules_ = nullptr;

  VectorOfmodule_array* module_arrays_ = nullptr;

  VectorOfprimitive* primitives_ = nullptr;

  VectorOfprimitive_array* primitive_arrays_ = nullptr;

  VectorOfdef_param* def_params_ = nullptr;

  VectorOfgen_scope_array* gen_scope_arrays_ = nullptr;

  VectorOfprogram* programs_ = nullptr;

  VectorOfprogram* program_arrays_ = nullptr;

  VectorOfany* assertions_ = nullptr;

  VectorOfinterface_inst* interfaces_ = nullptr;

  VectorOfinterface_array* interface_arrays_ = nullptr;

  VectorOfalias_stmt* alias_stmts_ = nullptr;

  VectorOfclocking_block* clocking_blocks_ = nullptr;

  VectorOftask_func* task_funcs_ = nullptr;

  VectorOftf_call* elab_tasks_ = nullptr;
};


typedef FactoryT<gen_scope> gen_scopeFactory;


typedef FactoryT<std::vector<gen_scope *>> VectorOfgen_scopeFactory;

}  // namespace UHDM

#endif
