#ifndef EFL_GENERATED_ECORE_POLLER_HH
#define EFL_GENERATED_ECORE_POLLER_HH

extern "C"
{
#include <Efl.h>
}
#include <Eo.hh>

#include <eo_cxx_interop.hh>

extern "C"
{
#include "ecore_poller.eo.h"
}

#include "eo_base.eo.hh"
#include <Ecore.h>

namespace ecore {

struct poller;

}

namespace eo_cxx {

namespace ecore {

struct poller
{
   /// @brief @brief Gets the polling interval rate of @p poller.
   /// @return Returns the interval, in ticks, that @p poller polls at.
   ///
   /// This returns a poller's polling interval, or 0 on error.
   ///
   /// @param interval The tick interval to set; must be a power of 2 and <= 32768.
   ///
   int interval_get() const;


   /// @brief @brief Changes the polling interval rate of @p poller.
   /// @return Returns true on success, false on failure.
   ///
   /// This allows the changing of a poller's polling interval. It is useful when
   /// you want to alter a poll rate without deleting and re-creating a poller.
   ///
   /// @param interval The tick interval to set; must be a power of 2 and <= 32768.
   ///
   bool interval_set(int interval_) const;



   static Eo_Class const* _eo_class()
   {
      return(ECORE_POLLER_CLASS);
   }

   operator ::ecore::poller() const;
   operator ::ecore::poller&();
   operator ::ecore::poller const&() const;

   template <typename D>
   struct address_of
   {
      operator ::ecore::poller*() const { return static_cast<::ecore::poller*>(static_cast<D const*>(this)->p); }
      operator ::ecore::poller const*() const { return static_cast<::ecore::poller const*>(static_cast<D const*>(this)->p); }
   };

   template <typename D>
   struct address_const_of
   {
      operator ::ecore::poller const*() const { return static_cast<::ecore::poller const*>(static_cast<D const*>(this)->p); }
   };

private:
   Eo* _concrete_eo_ptr() const
   {
      return static_cast<::efl::eo::concrete const*>(static_cast<void const*>(this))->_eo_ptr();
   }

};

}

}

namespace ecore {

struct poller
      : ::efl::eo::concrete
      , ::eo_cxx::eo::base
{
   template <typename F_func_>
   struct _c_ecore_poller_constructor
   {
      typedef typename std::remove_reference<F_func_>::type _no_ref_F_func_;

      _c_ecore_poller_constructor(Ecore_Poller_Type type_, int interval_, F_func_ && func_)
         : type_(type_), interval_(interval_), _tmp_func_(new F_func_(std::forward<F_func_>(func_)))
      {}
      void operator()()
      {
         ::ecore_poller_constructor(type_, interval_, ::efl::eolian::get_callback<Ecore_Task_Cb, _no_ref_F_func_ >(), _tmp_func_);
      }

      Ecore_Poller_Type type_;
      int interval_;
      _no_ref_F_func_* _tmp_func_;
   };

   template <typename F0>
   poller(_c_ecore_poller_constructor<F0> _c0, ::efl::eo::parent_type _p = (::efl::eo::parent = nullptr))
      : poller(_ctors_call(_c0, _p))
   {}

   /// @brief Eo Constructor.
   ///
   /// Constructs the object from an Eo* pointer stealing its ownership.
   ///
   /// @param eo The Eo object pointer.
   ///
   explicit poller(Eo* eo)
      : ::efl::eo::concrete(eo)
   {}

   /// @brief nullptr_t Constructor.
   ///
   /// Constructs an empty (null) object.
   ///
   explicit poller(std::nullptr_t)
      : ::efl::eo::concrete(nullptr)
   {}

   /// @brief Copy Constructor.
   ///
   poller(poller const& other)
      : poller(eo_ref(other._eo_ptr()))
   {}

   ~poller() {}

/// @brief Constructor with parameters for Ecore Poller.
///
/// @param type 
/// @param interval 
/// @param func 
/// @param data 
///
   template <typename F_func_>
   _c_ecore_poller_constructor<F_func_> ecore_poller_constructor(Ecore_Poller_Type type_, int interval_, F_func_ && func_) const;

   /// @brief @brief Gets the polling interval rate of @p poller.
   /// @return Returns the interval, in ticks, that @p poller polls at.
   ///
   /// This returns a poller's polling interval, or 0 on error.
   ///
   /// @param interval The tick interval to set; must be a power of 2 and <= 32768.
   ///
   int interval_get() const;


   /// @brief @brief Changes the polling interval rate of @p poller.
   /// @return Returns true on success, false on failure.
   ///
   /// This allows the changing of a poller's polling interval. It is useful when
   /// you want to alter a poll rate without deleting and re-creating a poller.
   ///
   /// @param interval The tick interval to set; must be a power of 2 and <= 32768.
   ///
   bool interval_set(int interval_) const;



   static Eo_Class const* _eo_class()
   {
      return(ECORE_POLLER_CLASS);
   }

   struct address_of
      : ::eo_cxx::ecore::poller::address_of<address_of>
      , ::eo_cxx::eo::base::address_of<address_of>
      , ::efl::eo::detail::concrete_address_of
   {
      explicit address_of(::ecore::poller* p)
         : ::efl::eo::detail::concrete_address_of(p)
      {}
   };
   address_of operator&() { return address_of(this); }

   struct address_const_of
      : ::eo_cxx::ecore::poller::address_const_of<address_const_of>
      , ::eo_cxx::eo::base::address_const_of<address_const_of>
      , ::efl::eo::detail::concrete_address_const_of
   {
      explicit address_const_of(::ecore::poller const* p)
         : ::efl::eo::detail::concrete_address_const_of(p)
      {}
   };
   address_const_of operator&() const { return address_const_of(this); }

private:
   template <typename F0>
   static Eo* _ctors_call(_c_ecore_poller_constructor<F0> _c0, ::efl::eo::parent_type _p)
   {
      Eo* _ret_eo = eo_add_ref(ECORE_POLLER_CLASS, _p._eo_raw, _c0(); );

      eo_do(_ret_eo,
         eo_event_callback_add(EO_EV_DEL, &::efl::eolian::free_callback_calback<F0>, _c0._tmp_func_));

      return _ret_eo;
   }

      Eo* _concrete_eo_ptr() const { return _eo_ptr(); }
};

static_assert(sizeof(::ecore::poller) == sizeof(Eo*), "");
static_assert(std::is_standard_layout<::ecore::poller>::value, "");

}

template <typename F_func_>
inline ::ecore::poller::_c_ecore_poller_constructor<F_func_> ecore::poller::ecore_poller_constructor(Ecore_Poller_Type type_, int interval_, F_func_ && func_) const
{
   return _c_ecore_poller_constructor<F_func_>(type_, interval_, std::forward<F_func_>(func_));
}

inline int ecore::poller::interval_get() const
{
   int _tmp_ret;
   eo_do(_concrete_eo_ptr(), _tmp_ret = ::ecore_poller_interval_get());
   return _tmp_ret;
}


inline bool ecore::poller::interval_set(int interval_) const
{
   Eina_Bool _tmp_ret;
   eo_do(_concrete_eo_ptr(), _tmp_ret = ::ecore_poller_interval_set(interval_));
   return ::efl::eolian::to_cxx<bool>(_tmp_ret, std::tuple<std::false_type>());
}


inline int eo_cxx::ecore::poller::interval_get() const
{
   int _tmp_ret;
   eo_do(_concrete_eo_ptr(), _tmp_ret = ::ecore_poller_interval_get());
   return _tmp_ret;
}


inline bool eo_cxx::ecore::poller::interval_set(int interval_) const
{
   Eina_Bool _tmp_ret;
   eo_do(_concrete_eo_ptr(), _tmp_ret = ::ecore_poller_interval_set(interval_));
   return ::efl::eolian::to_cxx<bool>(_tmp_ret, std::tuple<std::false_type>());
}


inline ::eo_cxx::ecore::poller::operator ::ecore::poller() const
{
   return *static_cast<::ecore::poller const*>(static_cast<void const*>(this));
}

inline ::eo_cxx::ecore::poller::operator ::ecore::poller&()
{
   return *static_cast<::ecore::poller*>(static_cast<void*>(this));
}

inline ::eo_cxx::ecore::poller::operator ::ecore::poller const&() const
{
   return *static_cast<::ecore::poller const*>(static_cast<void const*>(this));
}

template <typename T>
int ecore_poller_interval_get_wrapper(Eo* objid EINA_UNUSED, ::efl::eo::detail::Inherit_Private_Data* self)
{
   int _tmp_ret{};
   try
      {
         _tmp_ret = static_cast<T*>(self->this_)->interval_get();
      }
   catch (...)
      {
         eina_error_set( ::efl::eina::unknown_error() );
      }
   return _tmp_ret;
}

template <typename T>
bool ecore_poller_interval_set_wrapper(Eo* objid EINA_UNUSED, ::efl::eo::detail::Inherit_Private_Data* self, int interval_)
{
   bool _tmp_ret{};
   try
      {
         _tmp_ret = static_cast<T*>(self->this_)->interval_set(interval_);
      }
   catch (...)
      {
         eina_error_set( ::efl::eina::unknown_error() );
      }
   return _tmp_ret;
}

namespace efl { namespace eo { namespace detail {

template<>
struct operations< ::ecore::poller >
{
   template <typename T>
   struct type
         : virtual operations< ::eo::base >::template type<T>
   {
      virtual int interval_get()
      {
         int _tmp_ret = {};

         eo_do_super(dynamic_cast<T*>(this)->_eo_ptr(),
               dynamic_cast<T*>(this)->_eo_class(),
               _tmp_ret = ::ecore_poller_interval_get());
            return _tmp_ret;
      }

      virtual bool interval_set(int interval_)
      {
         Eina_Bool _tmp_ret = {};

         eo_do_super(dynamic_cast<T*>(this)->_eo_ptr(),
               dynamic_cast<T*>(this)->_eo_class(),
               _tmp_ret = ::ecore_poller_interval_set(interval_));
            return ::efl::eolian::to_cxx<bool>(_tmp_ret, std::tuple<std::false_type>());
      }

   };
};


template<>
struct operation_description_class_size< ::ecore::poller >
{
   static const int value = 2 + operation_description_class_size<::eo::base >::value;
};

template <typename T>
int initialize_operation_description(::efl::eo::detail::tag<::ecore::poller>
                                 , Eo_Op_Description* ops)
{
   (void)ops;
   ops[0].func = reinterpret_cast<void*>(& ::ecore_poller_interval_get_wrapper<T>);
   ops[0].api_func = reinterpret_cast<void*>(& ::ecore_poller_interval_get);
   ops[0].op = EO_OP_OVERRIDE;
   ops[0].op_type = EO_OP_TYPE_REGULAR;
   ops[0].doc = NULL;

   ops[1].func = reinterpret_cast<void*>(& ::ecore_poller_interval_set_wrapper<T>);
   ops[1].api_func = reinterpret_cast<void*>(& ::ecore_poller_interval_set);
   ops[1].op = EO_OP_OVERRIDE;
   ops[1].op_type = EO_OP_TYPE_REGULAR;
   ops[1].doc = NULL;

   initialize_operation_description<T>(::efl::eo::detail::tag<::eo::base>(), &ops[2]);
   return 0;
}
inline void
call_constructor(::efl::eo::detail::tag< ::ecore::poller >
               , Eo* eo, Eo_Class const* cls EINA_UNUSED,
               ::efl::eo::detail::args_class<::ecore::poller, ::std::tuple<Ecore_Poller_Type, int, Ecore_Task_Cb, const void *> > const& args)
{
   (void)args;
   eo_do_super(eo, cls, ::ecore_poller_constructor(::efl::eolian::to_c(args.get<0>()), ::efl::eolian::to_c(args.get<1>()), ::efl::eolian::to_c(args.get<2>()), ::efl::eolian::to_c(args.get<3>())));
}

inline void
call_constructor(::efl::eo::detail::tag< ::ecore::poller >
               , Eo* eo, Eo_Class const* cls EINA_UNUSED,
               ::efl::eo::detail::args_class<::ecore::poller, ::std::tuple<::efl::eo::parent_type> > const& args)
{
   eo_do(eo, ::eo_parent_set(args.get<0>()._eo_raw));
}

inline Eo_Class const* get_eo_class(tag<::ecore::poller>)
{
   return (ECORE_POLLER_CLASS);
}

} } }
#endif // EFL_GENERATED_ECORE_POLLER_HH

