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

#ifndef UHDM_CLOCKING_IO_DECL_H
#define UHDM_CLOCKING_IO_DECL_H

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

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

#include "nets_vars_ref_obj_group.h"


namespace UHDM {
class delay_control;

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

  int32_t VpiDirection() const { return vpiDirection_; }
  bool VpiDirection(int32_t data) {
    vpiDirection_ = data;
    return true;
  }

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

  int32_t VpiInputEdge() const { return vpiInputEdge_; }
  bool VpiInputEdge(int32_t data) {
    vpiInputEdge_ = data;
    return true;
  }

  int32_t VpiOutputEdge() const { return vpiOutputEdge_; }
  bool VpiOutputEdge(int32_t data) {
    vpiOutputEdge_ = data;
    return true;
  }

  delay_control* Input_skew()  { return input_skew_; }
  const delay_control* Input_skew() const { return input_skew_; }
  template <typename T>
  T* Input_skew() {
    return (input_skew_ == nullptr) ? nullptr : any_cast<T*>(input_skew_);
  }
  template <typename T>
  const T* Input_skew() const {
    return (input_skew_ == nullptr) ? nullptr : any_cast<const T*>(input_skew_);
  }
  bool Input_skew(delay_control* data) {
    input_skew_ = data;
    return true;
  }

  delay_control* Output_skew()  { return output_skew_; }
  const delay_control* Output_skew() const { return output_skew_; }
  template <typename T>
  T* Output_skew() {
    return (output_skew_ == nullptr) ? nullptr : any_cast<T*>(output_skew_);
  }
  template <typename T>
  const T* Output_skew() const {
    return (output_skew_ == nullptr) ? nullptr : any_cast<const T*>(output_skew_);
  }
  bool Output_skew(delay_control* data) {
    output_skew_ = data;
    return true;
  }

  any* Expr()  { return expr_; }
  const any* Expr() const { return expr_; }
  template <typename T>
  T* Expr() {
    return (expr_ == nullptr) ? nullptr : any_cast<T*>(expr_);
  }
  template <typename T>
  const T* Expr() const {
    return (expr_ == nullptr) ? nullptr : any_cast<const T*>(expr_);
  }
  bool Expr(any* data) {
    if (!nets_vars_ref_obj_groupGroupCompliant(data)) return false;
    expr_ = data;
    return true;
  }

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

  virtual clocking_io_decl* 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::uhdmclocking_io_decl; }

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

private:
  int32_t vpiDirection_ = 0;

  SymbolId vpiName_;

  int32_t vpiInputEdge_ = 0;

  int32_t vpiOutputEdge_ = 0;

  delay_control* input_skew_ = nullptr;

  delay_control* output_skew_ = nullptr;

  any* expr_ = nullptr;
};


typedef FactoryT<clocking_io_decl> clocking_io_declFactory;


typedef FactoryT<std::vector<clocking_io_decl *>> VectorOfclocking_io_declFactory;

}  // namespace UHDM

#endif
