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

#ifndef UHDM_CLASS_DEFN_H
#define UHDM_CLASS_DEFN_H

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

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




namespace UHDM {
class extends;

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

  bool VpiVirtual() const { return vpiVirtual_; }
  bool VpiVirtual(bool data) {
    vpiVirtual_ = data;
    return true;
  }

  bool VpiAutomatic() const { return vpiAutomatic_; }
  bool VpiAutomatic(bool data) {
    vpiAutomatic_ = data;
    return true;
  }

  extends* Extends()  { return extends_; }
  const extends* Extends() const { return extends_; }
  template <typename T>
  T* Extends() {
    return (extends_ == nullptr) ? nullptr : any_cast<T*>(extends_);
  }
  template <typename T>
  const T* Extends() const {
    return (extends_ == nullptr) ? nullptr : any_cast<const T*>(extends_);
  }
  bool Extends(extends* data) {
    extends_ = data;
    return true;
  }

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

  VectorOfconstraint* Constraints() const { return constraints_; }
  bool Constraints(VectorOfconstraint* data) {
    constraints_ = data;
    return true;
  }

  VectorOfclass_defn* Deriveds() const { return deriveds_; }
  bool Deriveds(VectorOfclass_defn* data) {
    deriveds_ = data;
    return true;
  }

  VectorOfclass_typespec* Class_typespecs() const { return class_typespecs_; }
  bool Class_typespecs(VectorOfclass_typespec* data) {
    class_typespecs_ = data;
    return true;
  }

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

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

  virtual class_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::uhdmclass_defn; }

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

private:
  bool vpiVirtual_ = false;

  bool vpiAutomatic_ = false;

  extends* extends_ = nullptr;

  VectorOftask_func* task_funcs_ = nullptr;

  VectorOfconstraint* constraints_ = nullptr;

  VectorOfclass_defn* deriveds_ = nullptr;

  VectorOfclass_typespec* class_typespecs_ = nullptr;

  SymbolId vpiEndLabel_;
};


typedef FactoryT<class_defn> class_defnFactory;


typedef FactoryT<std::vector<class_defn *>> VectorOfclass_defnFactory;

}  // namespace UHDM

#endif
