]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: client_pool: add object to represent memory pool in client
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Wed, 1 Apr 2020 09:13:28 +0000 (18:13 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Fri, 3 Apr 2020 13:06:25 +0000 (22:06 +0900)
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/seq/alsaseq.map
src/seq/client-pool.c [new file with mode: 0644]
src/seq/client-pool.h [new file with mode: 0644]
src/seq/meson.build
tests/alsaseq-client-pool [new file with mode: 0644]
tests/meson.build

index 3e4ee3643008d0381bc67219e1b728e65e9a32e0..d64a61b043501a8fe1bbbae88b94ba274bedc70f 100644 (file)
@@ -47,6 +47,8 @@ ALSA_GOBJECT_0_0_0 {
 
     "alsaseq_port_info_get_type";
     "alsaseq_port_info_new";
+
+    "alsaseq_client_pool_get_type";
   local:
     *;
 };
diff --git a/src/seq/client-pool.c b/src/seq/client-pool.c
new file mode 100644 (file)
index 0000000..ba85eff
--- /dev/null
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#include "client-pool.h"
+
+G_DEFINE_TYPE(ALSASeqClientPool, alsaseq_client_pool, G_TYPE_OBJECT)
+
+static void alsaseq_client_pool_class_init(ALSASeqClientPoolClass *klass)
+{
+    return;
+}
+
+static void alsaseq_client_pool_init(ALSASeqClientPool *self)
+{
+    return;
+}
diff --git a/src/seq/client-pool.h b/src/seq/client-pool.h
new file mode 100644 (file)
index 0000000..7437565
--- /dev/null
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: LGPL-3.0-or-later
+#ifndef __ALSA_GOBJECT_ALSASEQ_CLIENT_POOL__H__
+#define __ALSA_GOBJECT_ALSASEQ_CLIENT_POOL__H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define ALSASEQ_TYPE_CLIENT_POOL        (alsaseq_client_pool_get_type())
+
+#define ALSASEQ_CLIENT_POOL(obj)                            \
+    (G_TYPE_CHECK_INSTANCE_CAST((obj),                      \
+                                ALSASEQ_TYPE_CLIENT_POOL,   \
+                                ALSASeqClientPool))
+#define ALSASEQ_IS_CLIENT_POOL(obj)                         \
+    (G_TYPE_CHECK_INSTANCE_TYPE((obj),                      \
+                                ALSASEQ_TYPE_CLIENT_POOL))
+
+#define ALSASEQ_CLIENT_POOL_CLASS(klass)                    \
+    (G_TYPE_CHECK_CLASS_CAST((klass),                       \
+                             ALSASEQ_TYPE_CLIENT_POOL,      \
+                             ALSASeqClientPoolClass))
+#define ALSASEQ_IS_CLIENT_POOL_CLASS(klass)                 \
+    (G_TYPE_CHECK_CLASS_TYPE((klass),                       \
+                             ALSASEQ_TYPE_CLIENT_POOL))
+#define ALSASEQ_CLIENT_POOL_GET_CLASS(obj)                  \
+    (G_TYPE_INSTANCE_GET_CLASS((obj),                       \
+                               ALSASEQ_TYPE_CLIENT_POOL,    \
+                               ALSASeqClientPoolClass))
+
+typedef struct _ALSASeqClientPool           ALSASeqClientPool;
+typedef struct _ALSASeqClientPoolClass      ALSASeqClientPoolClass;
+
+struct _ALSASeqClientPool {
+    GObject parent_instance;
+};
+
+struct _ALSASeqClientPoolClass {
+    GObjectClass parent_class;
+};
+
+GType alsaseq_client_pool_get_type() G_GNUC_CONST;
+
+ALSASeqClientPool *alsaseq_client_pool_new();
+
+G_END_DECLS
+
+#endif
index cea2452fbe72ee6a0d3c0131c46abcfa36f984ed..282a0c398f60ca6b686c66f3c3e241f8c12f75d9 100644 (file)
@@ -15,6 +15,7 @@ sources = files(
   'user-client.c',
   'addr.c',
   'port-info.c',
+  'client-pool.c',
 )
 
 headers = files(
@@ -24,6 +25,7 @@ headers = files(
   'user-client.h',
   'addr.h',
   'port-info.h',
+  'client-pool.h',
 )
 
 privates = files(
diff --git a/tests/alsaseq-client-pool b/tests/alsaseq-client-pool
new file mode 100644 (file)
index 0000000..6a494ab
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+from sys import exit
+from errno import ENXIO
+
+from helper import test
+
+import gi
+gi.require_version('ALSASeq', '0.0')
+from gi.repository import ALSASeq
+
+target = ALSASeq.ClientPool()
+props = ()
+methods = ()
+signals = ()
+
+if not test(target, props, methods, signals):
+    exit(ENXIO)
index a682172d58236564d678f489ce47f3445a87128e..0cddeb50c0ad68933e3b95e4b40d8d7c4e6d6992 100644 (file)
@@ -34,6 +34,7 @@ tests = {
     'alsaseq-client-info',
     'alsaseq-user-client',
     'alsaseq-port-info',
+    'alsaseq-client-pool',
   ],
 }