Skip to content

Commit babd1d5

Browse files
author
Emile Joubert
committed
Rename all instances of no-wait, revision defaults to 0
1 parent b8a7a73 commit babd1d5

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

projects/client/Apigen/src/apigen/Apigen.cs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public static XmlNodeList GetNodes(XmlNode n0, string path) {
8282

8383
public static string GetString(XmlNode n0, string path, string d) {
8484
XmlNode n = n0.SelectSingleNode(path);
85-
return (n == null) ? d : n.InnerText;
85+
string pathOrDefault = (n == null) ? d : n.InnerText;
86+
return xmlStringMapper(pathOrDefault);
8687
}
8788

8889
public static string GetString(XmlNode n0, string path) {
@@ -102,6 +103,18 @@ public static int GetInt(XmlNode n0, string path) {
102103
return int.Parse(GetString(n0, path));
103104
}
104105

106+
private static string xmlStringMapper(string name)
107+
{
108+
switch (name)
109+
{
110+
case "no-wait":
111+
return "nowait";
112+
default:
113+
return name;
114+
115+
}
116+
}
117+
105118
///////////////////////////////////////////////////////////////////////////
106119
// Name manipulation and mangling for C#
107120

@@ -165,7 +178,7 @@ public static string MangleMethodClass(AmqpClass c, AmqpMethod m) {
165178
public bool m_versionOverridden = false;
166179
public int m_majorVersion;
167180
public int m_minorVersion;
168-
public int? m_revision;
181+
public int m_revision = 0;
169182
public string m_apiName;
170183
public bool m_emitComments = false;
171184
public bool m_supportsRedirect;
@@ -426,10 +439,8 @@ public void EmitPublic() {
426439
EmitLine(" public override int MajorVersion { get { return " + m_majorVersion + "; } }");
427440
EmitLine(" ///<summary>Protocol minor version (= "+m_minorVersion+")</summary>");
428441
EmitLine(" public override int MinorVersion { get { return " + m_minorVersion + "; } }");
429-
EmitLine(" ///<summary>Protocol revision (= " +
430-
(m_revision.HasValue ? m_revision.ToString() : "not specified") + ")</summary>");
431-
EmitLine(" public override int? Revision { get { return " +
432-
(m_revision.HasValue ? m_revision.ToString() : "null") + "; } }");
442+
EmitLine(" ///<summary>Protocol revision (= " + m_revision + ")</summary>");
443+
EmitLine(" public override int? Revision { get { return " + m_revision + "; } }");
433444
EmitLine(" ///<summary>Protocol API name (= "+m_apiName+")</summary>");
434445
EmitLine(" public override string ApiName { get { return \"" + m_apiName + "\"; } }");
435446
int port = GetInt(m_spec, "/amqp/@port");

projects/client/RabbitMQ.Client/src/client/api/IModel.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,13 @@ void ExchangeDeclare(string exchange,
178178
[AmqpFieldMapping("RabbitMQ.Client.Framing.v0_9_1", "reserved3")]
179179
bool @internal,
180180
[AmqpNowaitArgument(null)]
181-
[AmqpFieldMapping("RabbitMQ.Client.Framing.v0_9_1", "noWait")]
182181
bool nowait,
183182
IDictionary arguments);
184183

185184
///<summary>(Spec method) Delete an exchange.</summary>
186185
void ExchangeDelete(string exchange,
187186
bool ifUnused,
188187
[AmqpNowaitArgument(null)]
189-
[AmqpFieldMapping("RabbitMQ.Client.Framing.v0_9_1", "noWait")]
190188
bool nowait);
191189

192190
///<summary>(Spec method) Declare a queue.</summary>
@@ -227,8 +225,6 @@ string QueueDeclare(string queue,
227225
bool exclusive,
228226
bool autoDelete,
229227
[AmqpNowaitArgument(null)]
230-
[AmqpFieldMapping("RabbitMQ.Client.Framing.v0_9_1",
231-
"noWait")]
232228
bool nowait,
233229
IDictionary arguments);
234230

@@ -237,8 +233,6 @@ void QueueBind(string queue,
237233
string exchange,
238234
string routingKey,
239235
[AmqpNowaitArgument(null)]
240-
[AmqpFieldMapping("RabbitMQ.Client.Framing.v0_9_1",
241-
"noWait")]
242236
bool nowait,
243237
IDictionary arguments);
244238

@@ -263,8 +257,6 @@ void QueueUnbind(string queue,
263257
[return: AmqpFieldMapping(null, "messageCount")]
264258
uint QueuePurge(string queue,
265259
[AmqpNowaitArgument(null, "0xFFFFFFFF")]
266-
[AmqpFieldMapping("RabbitMQ.Client.Framing.v0_9_1",
267-
"noWait")]
268260
bool nowait);
269261

270262
///<summary>(Spec method) Delete a queue.</summary>
@@ -278,8 +270,6 @@ uint QueueDelete(string queue,
278270
bool ifUnused,
279271
bool ifEmpty,
280272
[AmqpNowaitArgument(null, "0xFFFFFFFF")]
281-
[AmqpFieldMapping("RabbitMQ.Client.Framing.v0_9_1",
282-
"noWait")]
283273
bool nowait);
284274

285275
///<summary>Start a Basic content-class consumer.</summary>
@@ -557,8 +547,6 @@ void _Private_BasicConsume(string queue,
557547
bool noLocal,
558548
bool noAck,
559549
bool exclusive,
560-
[AmqpFieldMapping("RabbitMQ.Client.Framing.v0_9_1",
561-
"noWait")]
562550
bool nowait,
563551
[AmqpUnsupported("RabbitMQ.Client.Framing.v0_8")]
564552
[AmqpFieldMapping("RabbitMQ.Client.Framing.v0_8qpid",
@@ -576,8 +564,6 @@ void _Private_BasicConsume(string queue,
576564
[AmqpForceOneWay]
577565
[AmqpMethodMapping(null, "basic", "cancel")]
578566
void _Private_BasicCancel(string consumerTag,
579-
[AmqpFieldMapping("RabbitMQ.Client.Framing.v0_9_1",
580-
"noWait")]
581567
bool nowait);
582568

583569
///<summary>Handle incoming Basic.CancelOk methods.</summary>

0 commit comments

Comments
 (0)