Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
42a776d
base data structures fot hook implementation.
NeaguGeorgiana23 Jul 7, 2026
e968609
fix linter
NeaguGeorgiana23 Jul 7, 2026
334ec2a
fix linter
NeaguGeorgiana23 Jul 7, 2026
f110e5c
Merge branch 'main' into define-hook-data-structures
NeaguGeorgiana23 Jul 7, 2026
5cc878b
Update BUILD file.
NeaguGeorgiana23 Jul 10, 2026
bd66430
Correct include guards.
NeaguGeorgiana23 Jul 10, 2026
5332610
feat: Add HookData class.
NeaguGeorgiana23 Jul 10, 2026
c8fc92d
fix linter
NeaguGeorgiana23 Jul 10, 2026
3f5f4de
fix linter
NeaguGeorgiana23 Jul 10, 2026
b0f3a15
fix linter
NeaguGeorgiana23 Jul 10, 2026
e9e8852
fix linter
NeaguGeorgiana23 Jul 10, 2026
e333df0
add HookContext structure.
NeaguGeorgiana23 Jul 13, 2026
c59de28
fix linter
NeaguGeorgiana23 Jul 13, 2026
45ca64a
fix linter
NeaguGeorgiana23 Jul 13, 2026
3b93d77
add Hooks class.
NeaguGeorgiana23 Jul 14, 2026
a4aa1c2
fix linter.
NeaguGeorgiana23 Jul 14, 2026
d7cd54a
fix linter.
NeaguGeorgiana23 Jul 14, 2026
d6ef2c6
fix linter.
NeaguGeorgiana23 Jul 14, 2026
a2f7fee
fix linter.
NeaguGeorgiana23 Jul 14, 2026
a91afca
appli agent suggestions.
NeaguGeorgiana23 Jul 14, 2026
c0482f7
Merge branch 'main' into hooks
NeaguGeorgiana23 Jul 14, 2026
a0ca155
Merge branch 'main' into hooks
NeaguGeorgiana23 Jul 14, 2026
06bd51c
Add EvaluationOpton struct.
NeaguGeorgiana23 Jul 15, 2026
b362223
fix linter.
NeaguGeorgiana23 Jul 15, 2026
6942c4e
update Provider class to allow getting hooks.
NeaguGeorgiana23 Jul 15, 2026
49bdc17
update all classes that inharit from FeatureProvider.
NeaguGeorgiana23 Jul 15, 2026
dab62a0
update BUILD files and imports.
NeaguGeorgiana23 Jul 15, 2026
a283a19
Merge branch 'main' into update_provider
NeaguGeorgiana23 Aug 10, 2026
a3f7c58
update PR with new GeneralHook class
NeaguGeorgiana23 Aug 10, 2026
adeab9a
Merge branch 'main' into update_provider
NeaguGeorgiana23 Aug 10, 2026
bcb7b0e
Add default empty return for FeatureProvider::GetHooks such that not …
NeaguGeorgiana23 Aug 10, 2026
db25480
Merge branch 'update_provider' of https://github.com/open-feature/cpp…
NeaguGeorgiana23 Aug 10, 2026
7ec24bb
Add missing standard includes.
NeaguGeorgiana23 Aug 10, 2026
d82aeeb
Delete Evaluation_Options_Test.
NeaguGeorgiana23 Aug 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openfeature/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ cc_library(
hdrs = ["noop_provider.h"],
include_prefix = "openfeature",
deps = [
":general_hook",
":evaluation_context",
":metadata",
":provider",
Expand Down Expand Up @@ -282,6 +283,7 @@ cc_library(
deps = [
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/status:statusor",
":general_hook",
":evaluation_context",
":metadata",
":resolution_details",
Expand Down
1 change: 1 addition & 0 deletions openfeature/memory_provider/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cc_library(
hdrs = ["in_memory_provider.h"],
include_prefix = "openfeature",
deps = [
"//openfeature:general_hook",
"//openfeature:error_code",
"//openfeature:evaluation_context",
":flag",
Expand Down
5 changes: 5 additions & 0 deletions openfeature/memory_provider/in_memory_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "absl/status/statusor.h"
#include "openfeature/error_code.h"
#include "openfeature/general_hook.h"
#include "openfeature/memory_provider/flag.h"
#include "openfeature/reason.h"

Expand All @@ -21,6 +22,10 @@ Metadata InMemoryProvider::GetMetadata() const {
return Metadata{std::string(kName)};
}

std::vector<std::shared_ptr<GeneralHook>> InMemoryProvider::GetHooks() const {
return {};
}

absl::Status InMemoryProvider::Init(const EvaluationContext& ctx) {
{
std::unique_lock lock(mutex_);
Expand Down
3 changes: 3 additions & 0 deletions openfeature/memory_provider/in_memory_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "openfeature/evaluation_context.h"
#include "openfeature/general_hook.h"
#include "openfeature/metadata.h"
#include "openfeature/provider.h"
#include "openfeature/provider_status.h"
Expand Down Expand Up @@ -44,6 +45,8 @@ class InMemoryProvider : public FeatureProvider {
// will be added to the configuration.
void UpdateFlag(std::string key, std::any new_flag);

std::vector<std::shared_ptr<GeneralHook>> GetHooks() const override;

absl::StatusOr<std::unique_ptr<BoolResolutionDetails>> GetBooleanEvaluation(
std::string_view key, bool default_value,
const EvaluationContext& ctx) override;
Expand Down
4 changes: 4 additions & 0 deletions openfeature/noop_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ namespace openfeature {

Metadata NoopProvider::GetMetadata() const { return Metadata{name_}; }

std::vector<std::shared_ptr<GeneralHook>> NoopProvider::GetHooks() const {
return {};
}

absl::StatusOr<std::unique_ptr<BoolResolutionDetails>>
NoopProvider::GetBooleanEvaluation(std::string_view flag, bool default_value,
const EvaluationContext& ctx) {
Expand Down
4 changes: 4 additions & 0 deletions openfeature/noop_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "absl/status/statusor.h"
#include "openfeature/evaluation_context.h"
#include "openfeature/general_hook.h"
#include "openfeature/metadata.h"
#include "openfeature/provider.h"
#include "openfeature/resolution_details.h"
Expand All @@ -23,6 +24,9 @@ class NoopProvider : public FeatureProvider {
// Metadata returns the metadata of the provider.
Metadata GetMetadata() const override;

// GetHooks returns an empty vector of hooks.
std::vector<std::shared_ptr<GeneralHook>> GetHooks() const override;

Comment thread
coderabbitai[bot] marked this conversation as resolved.
// BooleanEvaluation returns a boolean flag.
absl::StatusOr<std::unique_ptr<BoolResolutionDetails>> GetBooleanEvaluation(
std::string_view flag, bool default_value,
Expand Down
5 changes: 5 additions & 0 deletions openfeature/provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

#include <memory>
#include <string_view>
#include <vector>

#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "openfeature/evaluation_context.h"
#include "openfeature/general_hook.h"
Comment thread
NeaguGeorgiana23 marked this conversation as resolved.
#include "openfeature/metadata.h"
#include "openfeature/resolution_details.h"
#include "openfeature/value.h"
Expand All @@ -24,6 +26,9 @@ class FeatureProvider {
public:
virtual ~FeatureProvider() = default;
virtual Metadata GetMetadata() const = 0;
virtual std::vector<std::shared_ptr<GeneralHook>> GetHooks() const {
return {};
};
virtual absl::StatusOr<std::unique_ptr<BoolResolutionDetails>>
GetBooleanEvaluation(std::string_view flag, bool default_value,
const EvaluationContext& ctx) = 0;
Expand Down
1 change: 1 addition & 0 deletions test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cc_library(
name = "mock_feature_provider",
hdrs = ["mocks/mock_feature_provider.h"],
deps = [
"//openfeature:general_hook",
"//openfeature:provider",
"@googletest//:gtest",
],
Expand Down
7 changes: 7 additions & 0 deletions test/mocks/mock_feature_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

#include <gmock/gmock.h>

#include <memory>
#include <string_view>
#include <vector>

#include "openfeature/general_hook.h"
#include "openfeature/provider.h"

namespace openfeature {
Expand All @@ -11,6 +16,8 @@ namespace openfeature {
class MockFeatureProvider : public FeatureProvider {
public:
MOCK_METHOD(Metadata, GetMetadata, (), (const, override));
MOCK_METHOD(std::vector<std::shared_ptr<GeneralHook>>, GetHooks, (),
(const, override));
Comment thread
NeaguGeorgiana23 marked this conversation as resolved.
MOCK_METHOD(absl::StatusOr<std::unique_ptr<BoolResolutionDetails>>,
GetBooleanEvaluation,
(std::string_view flag, bool default_value,
Expand Down