Method: AutoC::List#render_interface

Defined in:
lib/autoc/list.rb

#render_interface(stream) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/autoc/list.rb', line 40

def render_interface(stream)
  stream << %{
    /** @private */
    typedef struct #{_node} #{_node};
  }
  if public?
    stream << %{
      /**
        #{defgroup}
  
        @brief Singly linked list of elements of type #{element}
  
        For iteration over the list elements refer to @ref #{range}.
  
        @see C++ [std::forward_list<T>](https://en.cppreference.com/w/cpp/container/forward_list)
  
        @since 2.0
      */
    }
    stream << %{
      /**
        #{ingroup}

        @brief Opaque structure holding state of the list

        @since 2.0
      */
    }
  else
    stream << PRIVATE
  end
  stream << %{
    typedef struct {
      #{_node_p} front; /**< @private */
      #{'size_t size; /**< @private */' if maintain_size?}
    } #{signature};
    /** @private */
    struct #{_node} {
      #{element} element;
      #{_node_p} next;
    };
  }
end