File: container.hpp

package info (click to toggle)
cpp-hocon 0.3.0-1.2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,320 kB
  • sloc: cpp: 12,223; makefile: 4
file content (28 lines) | stat: -rw-r--r-- 952 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include <hocon/config_value.hpp>
namespace hocon {

    /**
     * An AbstractConfigValue which contains other values. Java has no way to
     * express "this has to be an AbstractConfigValue also" other than making
     * AbstractConfigValue an interface which would be aggravating. But we can say
     * we are a ConfigValue.
     */
    class container {
    public:
        /**
         * Replace a child of this value. CAUTION if replacement is null, delete the
         * child, which may also delete the parent, or make the parent into a
         * non-container.
         */
        virtual shared_value replace_child(shared_value const& child, shared_value replacement) const = 0;

        /**
         * Super-expensive full traversal to see if descendant is anywhere
         * underneath this container.
         */
        virtual bool has_descendant(shared_value const& descendant) const = 0;
    };

}  // namespace hocon