Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
22f345f1
Commit
22f345f1
authored
Jan 13, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add aliases for common atom constant types
parent
ab1a7a92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
libcaf_core/caf/atom.hpp
libcaf_core/caf/atom.hpp
+24
-1
No files found.
libcaf_core/caf/atom.hpp
View file @
22f345f1
...
...
@@ -34,7 +34,6 @@ enum class atom_value : uint64_t {
/** @cond PRIVATE */
dirty_little_hack
=
31337
/** @endcond */
};
/**
...
...
@@ -47,9 +46,33 @@ constexpr atom_value atom(char const (&str)[Size]) {
return
static_cast
<
atom_value
>
(
detail
::
atom_val
(
str
,
0xF
));
}
/**
* Type alias for treating atom constants at compile-time
* (cf. "Int-ToType" idiom).
*/
template
<
atom_value
Value
>
using
atom_constant
=
std
::
integral_constant
<
atom_value
,
Value
>
;
/**
* Generic 'GET' atom for request operations.
*/
using
get_atom
=
atom_constant
<
atom
(
"GET"
)
>
;
/**
* Generic 'PUT' atom for request operations.
*/
using
put_atom
=
atom_constant
<
atom
(
"PUT"
)
>
;
/**
* Generic 'OK' atom for response messages.
*/
using
ok_atom
=
atom_constant
<
atom
(
"OK"
)
>
;
/**
* Generic 'ERROR' atom for response messages.
*/
using
error_atom
=
atom_constant
<
atom
(
"ERROR"
)
>
;
}
// namespace caf
#endif // CAF_ATOM_HPP
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment