-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
229 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef UNLEASH_VARIANTS_H | ||
#define UNLEASH_VARIANTS_H | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace unleash { | ||
|
||
class Context; | ||
|
||
struct Override { | ||
std::string contextName; | ||
std::vector<std::string> values; | ||
}; | ||
|
||
struct variant_t { | ||
std::string name; | ||
unsigned int weight; | ||
bool enabled; | ||
bool feature_enabled; | ||
std::string payload; | ||
}; | ||
|
||
class Variant { | ||
public: | ||
Variant(std::string name, unsigned int weight, std::string_view payload, std::string_view overrides); | ||
unsigned int getWeight() const { return m_weight; } | ||
const std::string &getName() const { return m_name; } | ||
const std::vector<Override> &getOverrides() const { return m_overrides; } | ||
const std::string &getPayload() const { return m_payload; } | ||
|
||
private: | ||
std::string m_name; | ||
unsigned int m_weight; | ||
std::string m_payload; | ||
std::vector<Override> m_overrides; | ||
}; | ||
} // namespace unleash | ||
|
||
|
||
#endif //UNLEASH_VARIANTS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.