* Template of Module [#a8bfd1e8]

#codeh(cpp){{
//===========================================================================================
//!\brief XX module
class MXxModule
    : public MParentModule
//===========================================================================================
{
public:
  typedef MParentModule       TParent;  // optional
  typedef MXxModule           TThis;    // optional
  HMRL_MODULE_NAMES(MXxModule)  // mandatory

  MXxModule (const std::string &v_instance_name)
    : TParent        (v_instance_name),   // mandatory
      slot_slot1     (*this),   // optional
      signal_signal1 (*this),   // optional
      out_out1       (*this),   // optional
      in_in1         (*this)    // optional
    {
      add_slot_port (slot_slot1);         // optional
      add_signal_port (signal_signal1);   // optional
      add_out_port (out_out1);            // optional
      add_in_port (in_in1);               // optional
    }

protected:

  MAKE_SLOT_PORT(slot_slot1, TOutType, (const TInType &x), (x), TThis);        // optional

  MAKE_SIGNAL_PORT(signal_signal1, const TOutType& (const TInType &), TThis);  // optional

  MAKE_OUT_PORT(out_out1, const TOutType&, (const TInType &x), (x), TThis);    // optional

  MAKE_IN_PORT(in_in1, const TOutType& (const TInType &), TThis);              // optional

  virtual TOutType slot_slot1_exec (const TInType &x)                          // optional
    {
      ...
    }

  virtual const TOutType& out_out1_get (const TInType &x) const                // optional
    {
      ...
    }
};  // end of MXxModule
//-------------------------------------------------------------------------------------------
}}


Front page   New List of pages Search Recent changes   Help   RSS of recent changes