CCF
Loading...
Searching...
No Matches
src
ds
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
8
namespace
ccf
9
{
10
enum class
ActorsType
: uint8_t
11
{
12
members
= 0,
13
users
,
14
nodes
,
15
// not to be used
16
unknown
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
{
28
case
ActorsType::members
:
29
{
30
return
"gov"
;
31
}
32
case
ActorsType::users
:
33
{
34
return
"app"
;
35
}
36
case
ActorsType::nodes
:
37
{
38
return
"node"
;
39
}
40
default
:
41
{
42
return
""
;
43
}
44
}
45
}
46
}
ccf
Definition
app_interface.h:14
ccf::get_actor_prefix
constexpr auto get_actor_prefix(ActorsType at)
Definition
actors.h:24
ccf::is_valid_actor
bool is_valid_actor(const std::string &actor)
Definition
actors.h:19
ccf::ActorsType
ActorsType
Definition
actors.h:11
ccf::ActorsType::users
@ users
ccf::ActorsType::unknown
@ unknown
ccf::ActorsType::nodes
@ nodes
ccf::ActorsType::members
@ members
Generated by
1.9.8