Classified ads
Public Slots | Signals | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
PublishingEngine Class Reference

Network-connection logic relating content publish demands. More...

#include <publishingengine.h>

Inheritance diagram for PublishingEngine:
Inheritance graph
[legend]
Collaboration diagram for PublishingEngine:
Collaboration graph
[legend]

Public Slots

void nodeConnectionAttemptStatus (Connection::ConnectionState aStatus, const Hash aHashOfAttemptedNode)
 
void run ()
 

Signals

void error (QTcpSocket::SocketError socketError)
 

Public Member Functions

 PublishingEngine (Controller *aController, Model &aModel)
 
 ~PublishingEngine ()
 

Public Attributes

bool iNeedsToRun
 

Private Types

enum  StageOfPublish { InitialStage, AwaitingConnection }
 

Private Member Functions

void emptyNodeCandidateList ()
 
void askConnectionsForNodesOnPublishList ()
 
void sendPublishItemToAlreadyConnectedNodes ()
 
void publishToNode (const Hash &aNode)
 
void checkForSuccessfullyConnectedNodes ()
 
void checkForUnSuccessfullyConnectedNodes ()
 

Private Attributes

ControlleriController
 
ModeliModel
 
PublishItem iWorkItem
 
QList< Node * > iNodeCandidatesToTryPush
 
QList< HashiNodesSuccessfullyConnected
 
QList< HashiNodesFailurefullyConnected
 
StageOfPublish iStageOfPublish
 
bool iNowRunning
 

Detailed Description

Network-connection logic relating content publish demands.

Class that will ask for connections to nodes destined to be holders of stuff published in this node. Once connection is established, stuff to be published is copied into send-queue of the newly-connected node.

Member Enumeration Documentation

Enumerator
InitialStage 
AwaitingConnection 

Constructor & Destructor Documentation

PublishingEngine::PublishingEngine ( Controller aController,
Model aModel 
)

Constructor

Parameters
aControllerapplication controller. not owned
aModelpersistent storage.
PublishingEngine::~PublishingEngine ( )

Destructor

Member Function Documentation

void PublishingEngine::askConnectionsForNodesOnPublishList ( )
private
void PublishingEngine::checkForSuccessfullyConnectedNodes ( )
private
void PublishingEngine::checkForUnSuccessfullyConnectedNodes ( )
private
void PublishingEngine::emptyNodeCandidateList ( )
private
void PublishingEngine::error ( QTcpSocket::SocketError  socketError)
signal
void PublishingEngine::nodeConnectionAttemptStatus ( Connection::ConnectionState  aStatus,
const Hash  aHashOfAttemptedNode 
)
slot

when connection is attempted, NetworkListener will emit the status (failed or success) of the connection, emitted signal is connected here

void PublishingEngine::publishToNode ( const Hash aNode)
private
void PublishingEngine::run ( )
slot

this class is a not a thread, but QTimer, thus run.

void PublishingEngine::sendPublishItemToAlreadyConnectedNodes ( )
private

Member Data Documentation

Controller* PublishingEngine::iController
private

application controller

Model& PublishingEngine::iModel
private

persistent storage

bool PublishingEngine::iNeedsToRun

when this is set to false, thread will terminate and run() return

QList<Node *> PublishingEngine::iNodeCandidatesToTryPush
private

list of nodes where iWorkItem might be pushed to

QList<Hash> PublishingEngine::iNodesFailurefullyConnected
private
QList<Hash> PublishingEngine::iNodesSuccessfullyConnected
private
bool PublishingEngine::iNowRunning
private
StageOfPublish PublishingEngine::iStageOfPublish
private
PublishItem PublishingEngine::iWorkItem
private

what we're trying to publish


The documentation for this class was generated from the following file: