]> Git Repo - qemu.git/commitdiff
qom: Introduce object_class_is_abstract()
authorAndreas Färber <[email protected]>
Wed, 23 Jan 2013 11:20:18 +0000 (12:20 +0100)
committerAndreas Färber <[email protected]>
Sun, 27 Jan 2013 22:33:34 +0000 (23:33 +0100)
This lets a caller check if an ObjectClass as returned by, e.g.,
object_class_by_name() is instantiatable.

Signed-off-by: Andreas Färber <[email protected]>
Cc: Anthony Liguori <[email protected]>
include/qom/object.h
qom/object.c

index 8e16ea8a44551458211b95d0579c90822a29e119..48e80ba229ce984d6f4065cc271b424323bb4e42 100644 (file)
@@ -690,6 +690,14 @@ ObjectClass *object_class_get_parent(ObjectClass *klass);
  */
 const char *object_class_get_name(ObjectClass *klass);
 
+/**
+ * object_class_is_abstract:
+ * @klass: The class to obtain the abstractness for.
+ *
+ * Returns: %true if @klass is abstract, %false otherwise.
+ */
+bool object_class_is_abstract(ObjectClass *klass);
+
 /**
  * object_class_by_name:
  * @typename: The QOM typename to obtain the class for.
index 03e6f24d284539de43f5cd6731e21db54c4b03fc..e2002821725578f0edd09808ceed3cc863175d07 100644 (file)
@@ -501,6 +501,11 @@ ObjectClass *object_get_class(Object *obj)
     return obj->class;
 }
 
+bool object_class_is_abstract(ObjectClass *klass)
+{
+    return klass->type->abstract;
+}
+
 const char *object_class_get_name(ObjectClass *klass)
 {
     return klass->type->name;
This page took 0.025975 seconds and 4 git commands to generate.