flags
Francois DELOBEL 1 month ago
parent b0f5e36443
commit 9e540d0a2d

@ -7,7 +7,8 @@ struct ListString::Cell {
Cell * m_prev; Cell * m_prev;
Cell * m_next; Cell * m_next;
string m_value; string m_value;
Cell(const string &Value = "UNINITIALIZED", Cell *prev = nullptr, Cell *next = nullptr); Cell(const string &Value = "UNINITIALIZED",
Cell *prev = nullptr, Cell *next = nullptr);
bool phantom() const { return (! m_next) || (! m_prev ); } bool phantom() const { return (! m_next) || (! m_prev ); }
}; };
@ -18,6 +19,11 @@ ListString::Cell::Cell(const string & value, Cell *prev, Cell *next )
{ {
} }
unsigned int ListString::size() const
{
return m_size;
}
ListString::ListString() ListString::ListString()
: m_size{0} : m_size{0}
, m_first{new Cell} , m_first{new Cell}
@ -44,7 +50,7 @@ void ListString::push_back(const std::string &value) {
void ListString::insert(const Position & p, const std::string &value) void ListString::insert(const Position & p, const std::string &value)
{ {
Cell *before = p.m_cell; Cell *before = p.m_cell;
Cell *neo = new Cell(value, before, m_first->m_next); Cell *neo = new Cell(value, before, before->m_next);
before->m_next->m_prev = neo; before->m_next->m_prev = neo;
before->m_next = neo; before->m_next = neo;
++m_size; ++m_size;

@ -26,6 +26,7 @@ public:
Position begin() const; Position begin() const;
friend std::ostream& operator<<(std::ostream & os, const ListString & list); friend std::ostream& operator<<(std::ostream & os, const ListString & list);
unsigned int size() const;
}; };

@ -1,7 +1,7 @@
# Communication C++ / QML" # Communication C++ / QML"
L'objectif de ce TP est d'apprendre à faire interagir C++ et QML. L'objectif de ce TP est d'apprendre à faire interagir C++ et QML.
Vous utiliserez QtCreator mais **l'éditeur de GUI**. Vous pouvez utilisez si vous le souhaitez les `QtQuick.Controls.`. Vous utiliserez QtCreator. Vous pouvez utilisez si vous le souhaitez les `QtQuick.Controls.`.
## Une classe NetworkInterface ## Une classe NetworkInterface

Loading…
Cancel
Save