Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1cd83be authored by Dennis Shen's avatar Dennis Shen Committed by Gerrit Code Review
Browse files

Merge "aconfig: update cpp codegen to use static methods"

parents 3d58caa1 4f78f100
Loading
Loading
Loading
Loading
+14 −26
Original line number Diff line number Diff line
@@ -134,19 +134,13 @@ mod tests {

        namespace com::example {

            class my_flag_one {
                public:
                    virtual const bool value() {
            static const bool my_flag_one() {
                return false;
            }
            }

            class my_flag_two {
                public:
                    virtual const bool value() {
            static const bool my_flag_two() {
                return true;
            }
            }

        }
        #endif
@@ -201,25 +195,19 @@ mod tests {

        namespace com::example {

            class my_flag_one {
                public:
                    virtual const bool value() {
            static const bool my_flag_one() {
                return GetServerConfigurableFlag(
                    "ns",
                    "com.example.my_flag_one",
                    "false") == "true";
            }
            }

            class my_flag_two {
                public:
                    virtual const bool value() {
            static const bool my_flag_two() {
                return GetServerConfigurableFlag(
                    "ns",
                    "com.example.my_flag_two",
                    "true") == "true";
            }
            }

        }
        #endif
+9 −12
Original line number Diff line number Diff line
@@ -6,9 +6,7 @@ using namespace server_configurable_flags;
{{ endif }}
namespace {cpp_namespace} \{
    {{ for item in class_elements}}
    class {item.flag_name} \{
        public:
            virtual const bool value() \{
    static const bool {item.flag_name}() \{
        {{ if item.readwrite- }}
        return GetServerConfigurableFlag(
            "{item.device_config_namespace}",
@@ -18,7 +16,6 @@ namespace {cpp_namespace} \{
            return {item.default_value};
        {{ -endif }}
    }
    }
    {{ endfor }}
}
#endif