#include #include #include class Msgs { public: inline Msgs() {} inline ~Msgs() {} inline int Send(Buffer* buf, const list& about1) { unsigned int headCount = 0; headCount = about1.size(); if (!buf->Receive(&headCount, sizeof(int))) { buf->ews_.SetErrorWords(1, __FILE__, __LINE__); return 0; } list::const_iterator mediator1 = about1.begin(); list::const_iterator omega1 = about1.end(); for (; mediator1 != omega1; ++mediator1) { if (!buf->Receive(&(*mediator1), sizeof(int))) { buf->ews_.SetErrorWords(1, __FILE__, __LINE__); return 0; } } if (!buf->SendStoredData()) { buf->ews_.SetErrorWords(2, __FILE__, __LINE__); return 0; } return 1; } inline int Send(Buffer* buf, const list& about1, const deque& about2) { unsigned int headCount = 0; headCount = about1.size(); if (!buf->Receive(&headCount, sizeof(int))) { buf->ews_.SetErrorWords(1, __FILE__, __LINE__); return 0; } list::const_iterator mediator3 = about1.begin(); list::const_iterator omega3 = about1.end(); for (; mediator3 != omega3; ++mediator3) { if (!buf->Receive(&(*mediator3), sizeof(int))) { buf->ews_.SetErrorWords(1, __FILE__, __LINE__); return 0; } } headCount = about2.size(); if (!buf->Receive(&headCount, sizeof(int))) { buf->ews_.SetErrorWords(2, __FILE__, __LINE__); return 0; } deque::const_iterator mediator4 = about2.begin(); deque::const_iterator omega4 = about2.end(); for (; mediator4 != omega4; ++mediator4) { if (!buf->Receive(&(*mediator4), sizeof(int))) { buf->ews_.SetErrorWords(2, __FILE__, __LINE__); return 0; } } if (!buf->SendStoredData()) { buf->ews_.SetErrorWords(3, __FILE__, __LINE__); return 0; } return 1; } };