Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | |
2 /* | |
3 * Copyright (c) 2009 University of Pennsylvania | |
4 * | |
5 * This program is free software; you can redistribute it and/or modify | |
6 * it under the terms of the GNU General Public License version 2 as | |
7 * published by the Free Software Foundation; | |
8 * | |
9 * This program is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License | |
15 * along with this program; if not, write to the Free Software | |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
17 */ | |
18 | |
19 #ifndef DHASH_TRANSACTION_H | |
20 #define DHASH_TRANSACTION_H | |
21 | |
22 #include "ns3/object.h" | |
23 #include "ns3/timer.h" | |
24 #include "dhash-message.h" | |
25 #include "dhash-connection.h" | |
26 | |
27 namespace ns3 { | |
28 | |
29 /** | |
30 * \ingroup chordipv4 | |
31 * \class DHashTransaction | |
32 * \brief Class to store and operate on DHash Transaction | |
33 */ | |
34 | |
35 class DHashTransaction : public Object | |
Mathieu Lacage
2010/01/13 12:51:12
why exactly are you deriving from Object here ? If
taher007saeed
2010/01/24 20:47:01
Done.
| |
36 { | |
37 | |
38 public: | |
39 | |
40 enum Originator { | |
41 APPLICATION = 1, | |
42 DHASH = 2, | |
43 }; | |
44 | |
45 /** | |
46 * \brief Constructor | |
47 * \param transactionId | |
48 * \param Ptr to ChordIdentifier of DHashObject | |
49 * \param dHashMessage DHashMessage | |
50 */ | |
51 DHashTransaction (uint32_t transactionId, Ptr<ChordIdentifier> objectIdentif ier,DHashMessage dHashMessage); | |
52 virtual ~DHashTransaction (); | |
53 virtual void DoDispose (); | |
54 //Storage | |
55 //Retrieval | |
56 /** | |
57 * \returns transactionId | |
58 */ | |
59 uint32_t GetTransactionId (); | |
60 /** | |
61 * \returns DHashMessage | |
62 */ | |
63 DHashMessage GetDHashMessage (); | |
64 /** | |
65 * \returns Ptr to ChordIdentifier of DHashObject | |
66 */ | |
67 Ptr<ChordIdentifier> GetObjectIdentifier (); | |
68 /** | |
69 * \brief Set flag to mark transaction as active | |
70 */ | |
71 void SetActiveFlag (bool activeFlag); | |
72 /** | |
73 * \brief Set Connection on which transaction is running | |
74 */ | |
75 void SetDHashConnection (Ptr<DHashConnection> dHashConnection); | |
76 /** | |
77 * \brief Set originator of transaction | |
78 */ | |
79 void SetOriginator (DHashTransaction::Originator originator); | |
80 /** | |
81 * \returns DHashTransaction::Originator | |
82 */ | |
83 DHashTransaction::Originator GetOriginator (); | |
84 /** | |
85 * \returns Active flag | |
86 */ | |
87 bool GetActiveFlag (); | |
88 /** | |
89 * \returns Ptr to DHashConnection | |
90 */ | |
91 Ptr<DHashConnection> GetDHashConnection (); | |
92 private: | |
93 /** | |
94 * \cond | |
95 */ | |
96 uint32_t m_transactionId; | |
97 bool m_activeFlag; | |
98 DHashMessage m_dHashMessage; | |
99 Ptr<ChordIdentifier> m_objectIdentifier; | |
100 Ptr<DHashConnection> m_dHashConnection; | |
101 DHashTransaction::Originator m_originator; | |
102 /** | |
103 * \endcond | |
104 */ | |
105 }; | |
106 | |
107 } //namespace ns3 | |
108 | |
109 #endif | |
OLD | NEW |