a.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright 2018-present Facebook, Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <folly/experimental/settings/test/a.h>
  17. #include <folly/experimental/settings/Settings.h>
  18. namespace a_ns {
  19. FOLLY_SETTING_DEFINE(follytest, public_flag_to_a, int, 456, "Public flag to a");
  20. namespace {
  21. FOLLY_SETTING_DEFINE(follytest, internal_flag_to_a, int, 789, "Desc of int");
  22. }
  23. int a_func() {
  24. return *FOLLY_SETTING(follytest, public_flag_to_a) +
  25. *FOLLY_SETTING(follytest, internal_flag_to_a);
  26. }
  27. void setRemote(int value) {
  28. FOLLY_SETTING(follytest, public_flag_to_a).set(value, "remote_set");
  29. }
  30. int getRemote() {
  31. return *FOLLY_SETTING(follytest, public_flag_to_a);
  32. }
  33. } // namespace a_ns