blob: e40de900aa18e989c34c220bb9f02b3968568adf [file] [log] [blame]
Alexander Afanasyev2d600f72013-11-21 18:20:37 -08001.. _Interest:
2
3Interest Class
4==============
5
6:[C++]:
7 Namespace: ``ndn``
8
9:[Python]:
10 Module: ``pyndn``
11
12Interest Constructor
13--------------------
14
15Create a new Interest with the optional values.
16
17:[C++]:
18
19.. code-block:: c++
20
21 Interest(
22
23 [const Name& name]
24 [, int minSuffixComponents]
25 [, int maxSuffixComponents]
26 [, const PublisherPublicKeyDigest& publisherPublicKeyDigest]
27 [, const Exclude& exclude]
28 [, int childSelector]
29 [, int answerOriginKind]
30 [, int scope]
31 [, Milliseconds interestLifetimeMilliseconds]
32 [, const std::vector<uint8_t>& nonce]
33
34 );
35
36:[JavaScript]:
37
38.. code-block:: javascript
39
40 var Interest = function Interest (
41
42 [name // Name]
43 [, minSuffixComponents // number]
44 [, maxSuffixComponents // number]
45 [, publisherPublicKeyDigest // PublisherPublicKeyDigest]
46 [, exclude // Exclude]
47 [, childSelector // number]
48 [, answerOriginKind // number]
49 [, scope // number]
50 [, interestLifetimeMilliseconds // number]
51 [, nonce // Uint8Array]
52
53 )
54
55:[Python]:
56
57.. code-block:: python
58
59 def __init__(self
60
61 [, name // Name]
62 [, minSuffixComponents // int]
63 [, maxSuffixComponents // int]
64 [, publisherPublicKeyDigest // string]
65 [, exclude // Exclude]
66 [, childSelector // int]
67 [, answerOriginKind // int]
68 [, scope // int]
69 [, interestLifetime // float]
70 [, nonce // string]
71
72 )
73
74:Parameters:
75
76 - ``name``
77 (optional) The name of the content.
78
79.. TODO: define other parameters
80
81Interest.wireDecode Method
82--------------------------
83
Alexander Afanasyev24707862013-11-26 19:31:45 -080084Decode the input from wire format and update this Interest.
Alexander Afanasyev2d600f72013-11-21 18:20:37 -080085
86:[C++]:
87
88.. code-block:: c++
89
90 void decode(
91
92 const std::vector<uint8_t>& input
Alexander Afanasyev2d600f72013-11-21 18:20:37 -080093
94 );
95
96:[JavaScript]:
97
98.. code-block:: javascript
99
100 Interest.prototype.decode = function(
101
102 input // Uint8Array
Alexander Afanasyev2d600f72013-11-21 18:20:37 -0800103
104 )
105
106:Parameters:
107
108 - ``input``
109 The input byte array to be decoded.
110
Alexander Afanasyev2d600f72013-11-21 18:20:37 -0800111
112Interest.wireEncode Method
113--------------------------
114
Alexander Afanasyev24707862013-11-26 19:31:45 -0800115Encode this Interest to a wire format.
Alexander Afanasyev2d600f72013-11-21 18:20:37 -0800116
117:[C++]:
118
119.. code-block:: c++
120
Alexander Afanasyev24707862013-11-26 19:31:45 -0800121 Blob encode() const;
Alexander Afanasyev2d600f72013-11-21 18:20:37 -0800122
123:[JavaScript]:
124
125.. code-block:: javascript
126
127 // Returns Uint8Array
Alexander Afanasyev24707862013-11-26 19:31:45 -0800128 Interest.prototype.encode = function()
Alexander Afanasyev2d600f72013-11-21 18:20:37 -0800129
130:Returns:
131
132 The encoded byte array.
133
134Interest.matchesName Method
135---------------------------
136
137Return true if the components of this Interests name are the same as the leading components of the given name, and the name conforms to the interest selectors.
138
139:[C++]:
140
141.. code-block:: c++
142
143 bool matchesName(
144
145 const Name& name
146
147 ) const;
148
149:[JavaScript]:
150
151.. code-block:: javascript
152
153 // Returns boolean
154 Interest.prototype.matchesName = function(
155
156 name // Name
157
158 )
159
160:[Python]:
161
162.. code-block:: python
163
164 # Returns True or False
165 def matches_name(self,
166
167 name # Name
168
169 )
170
171:Parameters:
172
173 - ``name``
174 The Name to check against this Interest.
175
176:Returns:
177
178 True if this interests name and interest selectors match the name.
179