diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/rgw/rgw_notify_event_type.h | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/rgw/rgw_notify_event_type.h')
-rw-r--r-- | src/rgw/rgw_notify_event_type.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/rgw/rgw_notify_event_type.h b/src/rgw/rgw_notify_event_type.h new file mode 100644 index 00000000..0d86bf3f --- /dev/null +++ b/src/rgw/rgw_notify_event_type.h @@ -0,0 +1,35 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#pragma once +#include <string> +#include <vector> + +namespace rgw::notify { + enum EventType { + ObjectCreated = 0xF, + ObjectCreatedPut = 0x1, + ObjectCreatedPost = 0x2, + ObjectCreatedCopy = 0x4, + ObjectCreatedCompleteMultipartUpload = 0x8, + ObjectRemoved = 0xF0, + ObjectRemovedDelete = 0x10, + ObjectRemovedDeleteMarkerCreated = 0x20, + UnknownEvent = 0x100 + }; + + using EventTypeList = std::vector<EventType>; + + // two event types are considered equal if their bits intersect + bool operator==(EventType lhs, EventType rhs); + + std::string to_string(EventType t); + + std::string to_ceph_string(EventType t); + + EventType from_string(const std::string& s); + + // create a vector of event types from comma separated list of event types + void from_string_list(const std::string& string_list, EventTypeList& event_list); +} + |