Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / grpc / node_modules / protobufjs / src / ProtoBuf / Reflect / Service.js
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Service.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Service.js
new file mode 100644 (file)
index 0000000..025df11
--- /dev/null
@@ -0,0 +1,52 @@
+/**\r
+ * Constructs a new Service.\r
+ * @exports ProtoBuf.Reflect.Service\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Namespace} root Root\r
+ * @param {string} name Service name\r
+ * @param {Object.<string,*>=} options Options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+var Service = function(builder, root, name, options) {\r
+    Namespace.call(this, builder, root, name, options);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Service";\r
+\r
+    /**\r
+     * Built runtime service class.\r
+     * @type {?function(new:ProtoBuf.Builder.Service)}\r
+     */\r
+    this.clazz = null;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Service.prototype\r
+ * @inner\r
+ */\r
+var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);\r
+\r
+/**\r
+ * Builds the service and returns the runtime counterpart, which is a fully functional class.\r
+ * @see ProtoBuf.Builder.Service\r
+ * @param {boolean=} rebuild Whether to rebuild or not\r
+ * @return {Function} Service class\r
+ * @throws {Error} If the message cannot be built\r
+ * @expose\r
+ */\r
+ServicePrototype.build = function(rebuild) {\r
+    if (this.clazz && !rebuild)\r
+        return this.clazz;\r
+\r
+    // Create the runtime Service class in its own scope\r
+    return this.clazz = (function(ProtoBuf, T) {\r
+\r
+        //? include("../Builder/Service.js");\r
+\r
+        return Service;\r
+\r
+    })(ProtoBuf, this);\r
+};\r