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

◆ StageOfPublish

Enumerator
InitialStage 
AwaitingConnection 

Constructor & Destructor Documentation

◆ PublishingEngine()

PublishingEngine::PublishingEngine ( Controller aController,
Model aModel 
)

Constructor

Parameters
aControllerapplication controller. not owned
aModelpersistent storage.

◆ ~PublishingEngine()

PublishingEngine::~PublishingEngine ( )

Destructor

Member Function Documentation

◆ askConnectionsForNodesOnPublishList()

void PublishingEngine::askConnectionsForNodesOnPublishList ( )
private

◆ checkForSuccessfullyConnectedNodes()

void PublishingEngine::checkForSuccessfullyConnectedNodes ( )
private

◆ checkForUnSuccessfullyConnectedNodes()

void PublishingEngine::checkForUnSuccessfullyConnectedNodes ( )
private

◆ emptyNodeCandidateList()

void PublishingEngine::emptyNodeCandidateList ( )
private

◆ error

void PublishingEngine::error ( QTcpSocket::SocketError  socketError)
signal

◆ nodeConnectionAttemptStatus

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

◆ publishToNode()

void PublishingEngine::publishToNode ( const Hash aNode)
private

◆ run

void PublishingEngine::run ( )
slot

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

◆ sendPublishItemToAlreadyConnectedNodes()

void PublishingEngine::sendPublishItemToAlreadyConnectedNodes ( )
private

Member Data Documentation

◆ iController

Controller* PublishingEngine::iController
private

application controller

◆ iModel

Model& PublishingEngine::iModel
private

persistent storage

◆ iNeedsToRun

bool PublishingEngine::iNeedsToRun

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

◆ iNodeCandidatesToTryPush

QList<Node *> PublishingEngine::iNodeCandidatesToTryPush
private

list of nodes where iWorkItem might be pushed to

◆ iNodesFailurefullyConnected

QList<Hash> PublishingEngine::iNodesFailurefullyConnected
private

◆ iNodesSuccessfullyConnected

QList<Hash> PublishingEngine::iNodesSuccessfullyConnected
private

◆ iNowRunning

bool PublishingEngine::iNowRunning
private

◆ iStageOfPublish

StageOfPublish PublishingEngine::iStageOfPublish
private

◆ iWorkItem

PublishItem PublishingEngine::iWorkItem
private

what we're trying to publish


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