Loading tools/aconfig/src/codegen_cpp.rs +3 −5 Original line number Diff line number Diff line Loading @@ -151,12 +151,9 @@ mod tests { #ifdef __cplusplus #include <memory> #include <vector> namespace com::android::aconfig::test { extern std::vector<int8_t> cache_; class flag_provider_interface { public: virtual ~flag_provider_interface() = default; Loading Loading @@ -359,6 +356,7 @@ void com_android_aconfig_test_reset_flags(); const PROD_SOURCE_FILE_EXPECTED: &str = r#" #include "com_android_aconfig_test.h" #include <server_configurable_flags/get_flags.h> #include <vector> namespace com::android::aconfig::test { Loading Loading @@ -407,9 +405,9 @@ namespace com::android::aconfig::test { return cache_[2]; } }; private: std::vector<int8_t> cache_ = std::vector<int8_t>(3, -1); }; std::unique_ptr<flag_provider_interface> provider_ = std::make_unique<flag_provider>(); Loading tools/aconfig/templates/cpp_exported_header.template +0 −7 Original line number Diff line number Diff line Loading @@ -18,16 +18,9 @@ #ifdef __cplusplus #include <memory> {{ if not for_test- }} #include <vector> {{ -endif }} namespace {cpp_namespace} \{ {{ if not for_test- }} extern std::vector<int8_t> cache_; {{ -endif }} class flag_provider_interface \{ public: virtual ~flag_provider_interface() = default; Loading tools/aconfig/templates/cpp_source_file.template +4 −3 Original line number Diff line number Diff line Loading @@ -5,6 +5,8 @@ {{ if for_test }} #include <unordered_map> #include <string> {{ -else- }} #include <vector> {{ endif }} namespace {cpp_namespace} \{ Loading Loading @@ -69,16 +71,15 @@ namespace {cpp_namespace} \{ {{ -endif }} } {{ endfor }} private: std::vector<int8_t> cache_ = std::vector<int8_t>({readwrite_count}, -1); }; std::vector<int8_t> cache_ = std::vector<int8_t>({readwrite_count}, -1); {{ -endif }} std::unique_ptr<flag_provider_interface> provider_ = std::make_unique<flag_provider>(); } Loading Loading
tools/aconfig/src/codegen_cpp.rs +3 −5 Original line number Diff line number Diff line Loading @@ -151,12 +151,9 @@ mod tests { #ifdef __cplusplus #include <memory> #include <vector> namespace com::android::aconfig::test { extern std::vector<int8_t> cache_; class flag_provider_interface { public: virtual ~flag_provider_interface() = default; Loading Loading @@ -359,6 +356,7 @@ void com_android_aconfig_test_reset_flags(); const PROD_SOURCE_FILE_EXPECTED: &str = r#" #include "com_android_aconfig_test.h" #include <server_configurable_flags/get_flags.h> #include <vector> namespace com::android::aconfig::test { Loading Loading @@ -407,9 +405,9 @@ namespace com::android::aconfig::test { return cache_[2]; } }; private: std::vector<int8_t> cache_ = std::vector<int8_t>(3, -1); }; std::unique_ptr<flag_provider_interface> provider_ = std::make_unique<flag_provider>(); Loading
tools/aconfig/templates/cpp_exported_header.template +0 −7 Original line number Diff line number Diff line Loading @@ -18,16 +18,9 @@ #ifdef __cplusplus #include <memory> {{ if not for_test- }} #include <vector> {{ -endif }} namespace {cpp_namespace} \{ {{ if not for_test- }} extern std::vector<int8_t> cache_; {{ -endif }} class flag_provider_interface \{ public: virtual ~flag_provider_interface() = default; Loading
tools/aconfig/templates/cpp_source_file.template +4 −3 Original line number Diff line number Diff line Loading @@ -5,6 +5,8 @@ {{ if for_test }} #include <unordered_map> #include <string> {{ -else- }} #include <vector> {{ endif }} namespace {cpp_namespace} \{ Loading Loading @@ -69,16 +71,15 @@ namespace {cpp_namespace} \{ {{ -endif }} } {{ endfor }} private: std::vector<int8_t> cache_ = std::vector<int8_t>({readwrite_count}, -1); }; std::vector<int8_t> cache_ = std::vector<int8_t>({readwrite_count}, -1); {{ -endif }} std::unique_ptr<flag_provider_interface> provider_ = std::make_unique<flag_provider>(); } Loading