CCF
Loading...
Searching...
No Matches
actors.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include <cstdint>
6#include <string>
7
8namespace ccf
9{
10 enum class ActorsType : uint8_t
11 {
12 members = 0,
13 users,
14 nodes,
15 // not to be used
17 };
18
19 inline bool is_valid_actor(const std::string& actor)
20 {
21 return actor == "gov" || actor == "app" || actor == "node";
22 }
23
24 constexpr auto get_actor_prefix(ActorsType at)
25 {
26 switch (at)
27 {
29 {
30 return "gov";
31 }
33 {
34 return "app";
35 }
37 {
38 return "node";
39 }
40 default:
41 {
42 return "";
43 }
44 }
45 }
46}
Definition app_interface.h:14
constexpr auto get_actor_prefix(ActorsType at)
Definition actors.h:24
bool is_valid_actor(const std::string &actor)
Definition actors.h:19
ActorsType
Definition actors.h:11