1 #ifndef WPP_ITEM_OPERATION_H
2 #define WPP_ITEM_OPERATION_H
45 ItemOp(uint8_t flags = TYPE::NONE): _flags(flags) {}
63 inline bool isCompatible(
const ItemOp& operation)
const {
return (_flags & operation._flags) == _flags; };
120 uint32_t flags = _flags;
121 std::vector<TYPE> operations;
122 for (
size_t i = 1; i != 0x100; i <<= 1) {
123 if (flags & i) operations.push_back((
TYPE)i);
The WppConnection class represents a connection interface for the Wpp library.
The ItemOp struct represents the operations that can be performed on a instance/resource.
std::vector< TYPE > asVector() const
Converts the flags into a vector of operation types.
bool isSupported(TYPE type) const
Checks if a specific operation is supported.
bool isCreate() const
Checks if the operation is of type CREATE.
bool isExecute() const
Checks if the ItemOp object represents an execute operation.
bool isDiscover() const
Checks if the ItemOp object represents a discover operation.
bool isCompatible(const ItemOp &operation) const
Checks if the ItemOp object is compatible with another ItemOp object.
bool isWrite() const
Checks if the ItemOp object represents a write operation.
bool isRead() const
Checks if the ItemOp object represents a read operation.
ItemOp(uint8_t flags=TYPE::NONE)
Constructs a ItemOp object with the specified flags.
uint8_t getFlags() const
Retrieves the flags representing the operations.
bool isDelete() const
Checks if the operation is of type DELETE.
TYPE
Enum representing the different types of operations.