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

#ifndef UHDM_NAMED_EVENT_H
#define UHDM_NAMED_EVENT_H

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

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




namespace UHDM {
class ref_typespec;

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

  bool VpiArrayMember() const { return vpiArrayMember_; }
  bool VpiArrayMember(bool data) {
    vpiArrayMember_ = 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 VpiAutomatic() const { return vpiAutomatic_; }
  bool VpiAutomatic(bool data) {
    vpiAutomatic_ = data;
    return true;
  }

  int32_t VpiAllocScheme() const { return vpiAllocScheme_; }
  bool VpiAllocScheme(int32_t data) {
    vpiAllocScheme_ = data;
    return true;
  }

  VectorOfattribute* Attributes() const { return attributes_; }
  bool Attributes(VectorOfattribute* data) {
    attributes_ = data;
    return true;
  }

  ref_typespec* Event_typespec()  { return event_typespec_; }
  const ref_typespec* Event_typespec() const { return event_typespec_; }
  template <typename T>
  T* Event_typespec() {
    return (event_typespec_ == nullptr) ? nullptr : any_cast<T*>(event_typespec_);
  }
  template <typename T>
  const T* Event_typespec() const {
    return (event_typespec_ == nullptr) ? nullptr : any_cast<const T*>(event_typespec_);
  }
  bool Event_typespec(ref_typespec* data) {
    event_typespec_ = data;
    return true;
  }

  VectorOfthread_obj* Threads() const { return threads_; }
  bool Threads(VectorOfthread_obj* data) {
    threads_ = data;
    return true;
  }

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

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

  virtual named_event* 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::uhdmnamed_event; }

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

private:
  bool vpiArrayMember_ = false;

  SymbolId vpiName_;

  SymbolId vpiFullName_;

  bool vpiAutomatic_ = false;

  int32_t vpiAllocScheme_ = 0;

  VectorOfattribute* attributes_ = nullptr;

  ref_typespec* event_typespec_ = nullptr;

  VectorOfthread_obj* threads_ = nullptr;

  SymbolId vpiEndLabel_;
};


typedef FactoryT<named_event> named_eventFactory;


typedef FactoryT<std::vector<named_event *>> VectorOfnamed_eventFactory;

}  // namespace UHDM

#endif
