Menu

Tree [d07884] master /
 History

HTTPS access


File Date Author Commit
 .settings 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 bin 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 html 2019-01-28 Phil Gillaspy Phil Gillaspy [ac0ae0] README.md
 obj 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 .cproject 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 .project 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 Defines.mk 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 Doxyfile 2019-01-28 Phil Gillaspy Phil Gillaspy [ac0ae0] README.md
 Makefile 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 Patterns.mk 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 README.md 2019-02-04 Phil Gillaspy Phil Gillaspy [d07884] README updated
 Targets.mk 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 guidefs.hh 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 guidisplay.cc 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 guidisplay.hh 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 moc_netmngr.cc 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 netmngr.cc 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 netmngr.hh 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 usIRSatellite.cc 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 usIRSatellite.hh 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 usRadar.cc 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 usRadar.hh 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 wxpc_web.cc 2019-01-28 Phil Gillaspy Phil Gillaspy [0ccad0] Initial commit
 wxweb.zip 2019-01-28 Phil Gillaspy Phil Gillaspy [f3fd3a] updated zip

Read Me

Qt Based Network Manager {#mainpage}

The Qt based Network Manager is a simple network services module which can
be expanded upon and customized as needed by the developer. The heart of the
manager is the NetMngr class implemented on top of the Qt based
QNetworkAccessManager class. The primary function of the added layering is to provide a means whereby the NetMngr class can provide network services without special regard to who or how many users are making web requests.

Although the network manager is built on top of QtNetworkAccessManager, the implementation does not use the slot/signal connection mechanism used by Qt.
An explanation of the mechanism is given below in the second to last
paragraph.

The Qt based Network Manager is written in C++ and compiles and runs under
either Qt4 or Qt5. There are no dependencies on operating system, compiler,
or linker. A sample application with code and Makefile is provided. This code
is provided as is and may be freely used by anyone without any restriction.

Given that the class NetMngr is instantiated as a globally visible object,
the NetMngr class is used as follows:

  1. The user (ie, the requesting object of network services) must first
    register with the network manager-

mMyID = pNetMngr->registerRequestor(this);

where mMyID is data member of the requesting object, this.

  1. The requesting object dynamically assigns mMyID as a property of its base
    inherited class, RequestingObject-

this->RequestingObject::setProperty(SIGEMIT, QVariant(mMyID));

It is required that the requesting object inherit from the RequestingObject
class which is defined in netmngr.hh.

  1. The requesting object must contain a public member function as follows:

void replyReceived(QNetworkReply *);

replyReceived() is effectively a signal handling slot, however, it is not
declared as such and not 'connected' as such to the network manager's
reply received slot.

  1. The requesting object may now issue web requests to the network manager.
    For example-

pNetMngr->requestInitiate(&netRequest, this);

where\par
QNetworkRequest netRequest;\par
this - pointer to requesting object

  1. The requesting object's replyReceived member function is called by
    the network manager when the network reply is received by the network
    manager.

Behind the scenes the network manager is handling multiple requests from
multiple objects. The following describes how this is managed.

The mMyID is a random number generated by the network manager and handed back
to the requesting object. mMyID serves as a unique identifier of the requesting
object. The requesting object also passes it's this pointer to the network
manager when registering. The network manager takes both the mMyID and this
and adds them as a pair to a STL based map object, mMyID being the key and
this being the value. The network manager also adds the mMyID as a dynamic property to the network reply. Upon receiving the network reply, the network
manager extracts the mMyID key from the reply, looks up the corresponding
this pointer to the requesting object, and calls the requesting object's
replyReceived() member function. Since mMyID is unique, the proper requesting
object will be called irregardless of the order in which replies are received.

The prospective user may wish to peruse the sample application code provided
to clarify details and inner workings. For example, see usIRSatellite.cc/hh
and usRadar.cc/hh which are examples of requesting objects.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.