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
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (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 GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with Classified Ads; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #ifndef CLASSIFIED_NETREQEXEC_H
22 #define CLASSIFIED_NETREQEXEC_H
23 
24 #include <QTimer>
25 #include "../net/protocol.h"
26 #include <time.h> // for time_t
27 #include "../net/connection.h"
28 
29 class MController ;
30 class Model ;
31 extern Hash KNullHash ;
32 
40 class NetworkRequestExecutor : public QTimer {
41  Q_OBJECT
42 public:
53  };
79  quint32 iTimeStampOfItem ;
84  QList<quint32> iBangPath ;
91  } ;
96  Model& aModel) ;
98 private:
154  const Hash& aNodeToSend = KNullHash ) ;
161  bool aUseContentHashNotDestination = false) ;
162 
194 
200 
208 
209 public slots:
213  void run() ;
219  const Hash aHashOfAttemptedNode );
220 private:
223  bool iNowRunning ;
225 } ;
226 #endif
QList< Hash > iWishListForNodesAround
Definition: netrequestexecutor.h:90
QList< quint32 > iBangPath
Definition: netrequestexecutor.h:84
void processPrivateMessagesForProfile(NetworkRequestQueueItem &aEntry)
void processRequestForBinaryBlob(NetworkRequestQueueItem &aEntry)
MController * iController
Definition: netrequestexecutor.h:221
Definition: netrequestexecutor.h:52
Logic for handling tasks received from other peers or from user.
Definition: netrequestexecutor.h:40
void processBinaryBlob(NetworkRequestQueueItem &aEntry)
Definition: netrequestexecutor.h:51
bool iNowRunning
Definition: netrequestexecutor.h:223
void processClassifiedAd(NetworkRequestQueueItem &aEntry)
ProtocolItemType iRequestType
Definition: netrequestexecutor.h:76
time_t iLastTimeOfNodeConnectedNodeStatusUpdate
Definition: netrequestexecutor.h:224
Definition: netrequestexecutor.h:48
Hash is class that carries 160-bit digest.
Definition: hash.h:38
ConnectionState
Definition: connection.h:47
void processUserProfileComment(NetworkRequestQueueItem &aEntry)
ProtocolItemType
Definition: protocol.h:150
void processNodeGreeting(NetworkRequestQueueItem &aEntry)
void processRequestForClassifiedAd(NetworkRequestQueueItem &aEntry)
void doSendRequestToNode(NetworkRequestQueueItem &aEntry, const Hash &aNodeToSend=KNullHash)
Definition: netrequestexecutor.h:49
void processUserProfile(NetworkRequestQueueItem &aEntry)
quint32 iTimeStampOfItem
Definition: netrequestexecutor.h:79
void processRequestForUserProfileComment(NetworkRequestQueueItem &aEntry)
Pure-virtual interface class for controller. This is spammed across parties needing access to applica...
Definition: mcontroller.h:43
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:48
void processUserProfileCommentsForProfile(NetworkRequestQueueItem &entry)
void processAdsClassified(NetworkRequestQueueItem &aEntry)
void sendRequestToNodesAroundHash(NetworkRequestQueueItem &aEntry, bool aUseContentHashNotDestination=false)
Work queue item.
Definition: netrequestexecutor.h:60
void processRequestForPrivateMessagePublish(NetworkRequestQueueItem &aEntry)
Hash iDestinationNode
Definition: netrequestexecutor.h:77
void processRequestForUserProfile(NetworkRequestQueueItem &aEntry)
int iMaxNumberOfItems
Definition: netrequestexecutor.h:82
NetworkRequestState
Definition: netrequestexecutor.h:47
void processRequestForNodesAroundHash(NetworkRequestQueueItem &entry)
Hash iRequestedItem
Definition: netrequestexecutor.h:78
NetworkRequestState iState
Definition: netrequestexecutor.h:81
void processPrivateMessage(NetworkRequestQueueItem &aEntry)
Definition: netrequestexecutor.h:50
Model & iModel
Definition: netrequestexecutor.h:222
quint32 iTimeStampOfLastActivity
Definition: netrequestexecutor.h:80
void processRequestForContentPublish(NetworkRequestQueueItem &entry)