server: Make some SimpleContainer methods protected and documented.
authorMurray Cumming <murrayc@openismus.com>
Thu, 13 Sep 2012 10:27:50 +0000 (12:27 +0200)
committerMurray Cumming <murrayc@murrayc.com>
Mon, 24 Sep 2012 10:11:33 +0000 (12:11 +0200)
Make get_all_children() and is_child_id_unique() protected and
document them as being useful when implementing derived classes,
because they are only used in plugins that derive their own
containers.

src/librygel-server/rygel-simple-container.vala

index 6f3fa3b..13a10fb 100644 (file)
@@ -72,7 +72,17 @@ public class Rygel.SimpleContainer : Rygel.MediaContainer,
         this.add_child (child);
     }
 
-    public MediaObjects get_all_children () {
+    /**
+     * Get all children, including the empty children.
+     *
+     * This is useful when all children are empty,
+     * so get_children() would return no objects,
+     * but when you need to add items to the empty
+     * items.
+     *
+     * This is useful only when implementing derived classes.
+     */
+    protected MediaObjects get_all_children () {
         var all = new MediaObjects ();
         all.add_all (this.children);
         all.add_all (this.empty_children);
@@ -122,7 +132,15 @@ public class Rygel.SimpleContainer : Rygel.MediaContainer,
         this.child_count = 0;
     }
 
-    public bool is_child_id_unique (string child_id) {
+    /**
+     * Check that the ID is unique within this container.
+     *
+     * This is useful only when implementing derived classes.
+     *
+     * @param child_id The ID to check for uniqueness.
+     * @return true if the child ID is unique within this container.
+     */
+    protected bool is_child_id_unique (string child_id) {
         var unique = true;
 
         foreach (var child in this.children) {