blob: 614b354216c2d212e3bc749a90b63a55867e3bf9 [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
84Decode the input using a particular wire format and update this Interest.
85
86:[C++]:
87
88.. code-block:: c++
89
90 void decode(
91
92 const std::vector<uint8_t>& input
93 [,WireFormat& wireFormat]
94
95 );
96
97:[JavaScript]:
98
99.. code-block:: javascript
100
101 Interest.prototype.decode = function(
102
103 input // Uint8Array
104 [, wireFormat // WireFormat]
105
106 )
107
108:Parameters:
109
110 - ``input``
111 The input byte array to be decoded.
112
113 - ``wireFormat``
114 (optional) A WireFormat object used to decode the input. If omitted, use WireFormat getDefaultWireFormat ().
115
116
117Interest.wireEncode Method
118--------------------------
119
120Encode this Interest for a particular wire format.
121
122:[C++]:
123
124.. code-block:: c++
125
126 Blob encode(
127
128 [WireFormat& wireFormat]
129
130 ) const;
131
132:[JavaScript]:
133
134.. code-block:: javascript
135
136 // Returns Uint8Array
137 Interest.prototype.encode = function(
138
139 [wireFormat // WireFormat]
140
141 )
142
143:Parameters:
144
145 - ``wireFormat``
146 (optional) A WireFormat object used to encode the input. If omitted, use use WireFormat getDefaultWireFormat ().
147
148:Returns:
149
150 The encoded byte array.
151
152Interest.matchesName Method
153---------------------------
154
155Return 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.
156
157:[C++]:
158
159.. code-block:: c++
160
161 bool matchesName(
162
163 const Name& name
164
165 ) const;
166
167:[JavaScript]:
168
169.. code-block:: javascript
170
171 // Returns boolean
172 Interest.prototype.matchesName = function(
173
174 name // Name
175
176 )
177
178:[Python]:
179
180.. code-block:: python
181
182 # Returns True or False
183 def matches_name(self,
184
185 name # Name
186
187 )
188
189:Parameters:
190
191 - ``name``
192 The Name to check against this Interest.
193
194:Returns:
195
196 True if this interests name and interest selectors match the name.
197