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

#ifndef UHDM_CONT_ASSIGN_BIT_H
#define UHDM_CONT_ASSIGN_BIT_H

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

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




namespace UHDM {
class expr;

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

  int32_t VpiOffset() const { return vpiOffset_; }
  bool VpiOffset(int32_t data) {
    vpiOffset_ = data;
    return true;
  }

  bool VpiNetDeclAssign() const { return vpiNetDeclAssign_; }
  bool VpiNetDeclAssign(bool data) {
    vpiNetDeclAssign_ = 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;
  }

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

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

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

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

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

  virtual cont_assign_bit* 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::uhdmcont_assign_bit; }

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

private:
  int32_t vpiOffset_ = 0;

  bool vpiNetDeclAssign_ = false;

  int32_t vpiStrength0_ = 0;

  int32_t vpiStrength1_ = 0;

  SymbolId vpiValue_;

  expr* delay_ = nullptr;

  expr* rhs_ = nullptr;

  expr* lhs_ = nullptr;
};


typedef FactoryT<cont_assign_bit> cont_assign_bitFactory;


typedef FactoryT<std::vector<cont_assign_bit *>> VectorOfcont_assign_bitFactory;

}  // namespace UHDM

#endif
