Classified ads
netrequestexecutor.h
Go to the documentation of this file.
1 /* -*-C++-*- -*-coding: utf-8-unix;-*-
2  Classified Ads is Copyright (c) Antti Järvinen 2013.
3 
4  This file is part of Classified Ads.
5 
6  Classified Ads is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Classified Ads is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Classified Ads. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef CLASSIFIED_NETREQEXEC_H
21 #define CLASSIFIED_NETREQEXEC_H
22 
23 #include <QTimer>
24 #include "../net/protocol.h"
25 #include <time.h> // for time_t
26 #include "../net/connection.h"
27 
28 class MController ;
29 class Model ;
30 extern Hash KNullHash ;
31 
39 class NetworkRequestExecutor : public QTimer {
40  Q_OBJECT
41 public:
52  };
78  quint32 iTimeStampOfItem ;
83  QList<quint32> iBangPath ;
90  } ;
95  Model& aModel) ;
97 private:
153  const Hash& aNodeToSend = KNullHash ) ;
160  bool aUseContentHashNotDestination = false) ;
161 
193 
199 
207 
208 public slots:
212  void run() ;
218  const Hash aHashOfAttemptedNode );
219 private:
222  bool iNowRunning ;
224 } ;
225 #endif
QList< Hash > iWishListForNodesAround
Definition: netrequestexecutor.h:89
QList< quint32 > iBangPath
Definition: netrequestexecutor.h:83
void processPrivateMessagesForProfile(NetworkRequestQueueItem &aEntry)
void processRequestForBinaryBlob(NetworkRequestQueueItem &aEntry)
MController * iController
Definition: netrequestexecutor.h:220
Definition: netrequestexecutor.h:51
Logic for handling tasks received from other peers or from user.
Definition: netrequestexecutor.h:39
void processBinaryBlob(NetworkRequestQueueItem &aEntry)
Definition: netrequestexecutor.h:50
bool iNowRunning
Definition: netrequestexecutor.h:222
void processClassifiedAd(NetworkRequestQueueItem &aEntry)
ProtocolItemType iRequestType
Definition: netrequestexecutor.h:75
time_t iLastTimeOfNodeConnectedNodeStatusUpdate
Definition: netrequestexecutor.h:223
Definition: netrequestexecutor.h:47
Hash is class that carries 160-bit digest.
Definition: hash.h:37
ConnectionState
Definition: connection.h:45
void processUserProfileComment(NetworkRequestQueueItem &aEntry)
ProtocolItemType
Definition: protocol.h:124
void processNodeGreeting(NetworkRequestQueueItem &aEntry)
void processRequestForClassifiedAd(NetworkRequestQueueItem &aEntry)
void doSendRequestToNode(NetworkRequestQueueItem &aEntry, const Hash &aNodeToSend=KNullHash)
Definition: netrequestexecutor.h:48
void processUserProfile(NetworkRequestQueueItem &aEntry)
quint32 iTimeStampOfItem
Definition: netrequestexecutor.h:78
void processRequestForUserProfileComment(NetworkRequestQueueItem &aEntry)
Pure-virtual interface class for controller. This is spammed across parties needing access to applica...
Definition: mcontroller.h:39
void nodeConnectionAttemptStatus(Connection::ConnectionState aStatus, const Hash aHashOfAttemptedNode)
Hash KNullHash
void processRequestForProfilePoll(NetworkRequestQueueItem &aEntry)
NetworkRequestExecutor(MController *aController, Model &aModel)
M of the MVC pattern. Handles permanent storage.
Definition: model.h:47
void processUserProfileCommentsForProfile(NetworkRequestQueueItem &entry)
void processAdsClassified(NetworkRequestQueueItem &aEntry)
void sendRequestToNodesAroundHash(NetworkRequestQueueItem &aEntry, bool aUseContentHashNotDestination=false)
Work queue item.
Definition: netrequestexecutor.h:59
void processRequestForPrivateMessagePublish(NetworkRequestQueueItem &aEntry)
Hash iDestinationNode
Definition: netrequestexecutor.h:76
void processRequestForUserProfile(NetworkRequestQueueItem &aEntry)
int iMaxNumberOfItems
Definition: netrequestexecutor.h:81
NetworkRequestState
Definition: netrequestexecutor.h:46
void processRequestForNodesAroundHash(NetworkRequestQueueItem &entry)
Hash iRequestedItem
Definition: netrequestexecutor.h:77
NetworkRequestState iState
Definition: netrequestexecutor.h:80
void processPrivateMessage(NetworkRequestQueueItem &aEntry)
Definition: netrequestexecutor.h:49
Model & iModel
Definition: netrequestexecutor.h:221
quint32 iTimeStampOfLastActivity
Definition: netrequestexecutor.h:79
void processRequestForContentPublish(NetworkRequestQueueItem &entry)