Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 18 pages
Exam (elaborations)

COS3711 Assignment 3 2025

Document preview thumbnail
Preview 3 out of 18 pages

COS3711 Assignment 3 2025 100% solved answers.Stop starting from scratch.Download your copy today and get a head start.

Content preview

COS3711
Assignment 3
Unique No:
Due 2025

,Part A — Client side: serializing pallets and sending over TCP (threaded)

Design overview

 Use QXmlStreamWriter to construct the XML document in a structured and
efficient manner.
 Perform both serialization and network transmission inside a worker object that is
executed on a QThread so the GUI remains responsive.
 The worker communicates with the UI through signals that report progress,
success, or error conditions.
 When the TCP connection to the server is established and the XML data has
been transmitted, the resulting XML string is displayed inside a QTextEdit widget
in the serialization tab.

Container code validation

The server uses this regular expression to check container identifiers:

^(20[0-9]{2})/(0[1-9]|1[0-2])/[BC](\d{1,4})$

 Year: 2000–2099
 Month: 01–12
 Category: B or C
 Serial number: 1–9999

Client: SerializationWorker (Header)
// SerializationWorker.h
#ifndef SERIALIZATIONWORKER_H
#define SERIALIZATIONWORKER_H


#include <QObject>
#include <QString>
#include <map>

, #include <memory>
#include <vector>


// Forward declarations
class Pallet;
class QTcpSocket;


/*
* SerializationWorker
*
* This worker is designed to run on a background thread.
* It handles XML construction from pallet data and
* transmits the result to a remote server.
*/
class SerializationWorker : public QObject {
Q_OBJECT
public:
explicit SerializationWorker(const std::map<int, Pallet*>& pallets);
~SerializationWorker();


public slots:
// Entry point for execution when moved to a thread
void process();


signals:
// Triggered when XML has been built and sent successfully
void finished(const QString& xml);


// Triggered when an error occurs
void error(const QString& message);

Document information

Uploaded on
September 14, 2025
Number of pages
18
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$2.76

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
AcademicAnchor
3.6
(11)
Sold
50
Followers
1
Items
382
Last sold
1 month ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions