Friendly LWM2M client
wpp::ItemOp Struct Reference

The ItemOp struct represents the operations that can be performed on a instance/resource. More...

#include <ItemOp.h>

+ Collaboration diagram for wpp::ItemOp:

Public Types

enum  TYPE : uint8_t {
  NONE = 0 , READ = 1 , WRITE = 2 , EXECUTE = 4 ,
  DISCOVER = 8 , CREATE = 16 , DELETE = 32
}
 Enum representing the different types of operations. More...
 

Public Member Functions

 ItemOp (uint8_t flags=TYPE::NONE)
 Constructs a ItemOp object with the specified flags. More...
 
bool isSupported (TYPE type) const
 Checks if a specific operation is supported. More...
 
bool isCompatible (const ItemOp &operation) const
 Checks if the ItemOp object is compatible with another ItemOp object. More...
 
bool isRead () const
 Checks if the ItemOp object represents a read operation. More...
 
bool isWrite () const
 Checks if the ItemOp object represents a write operation. More...
 
bool isExecute () const
 Checks if the ItemOp object represents an execute operation. More...
 
bool isDiscover () const
 Checks if the ItemOp object represents a discover operation. More...
 
bool isCreate () const
 Checks if the operation is of type CREATE. More...
 
bool isDelete () const
 Checks if the operation is of type DELETE. More...
 
uint8_t getFlags () const
 Retrieves the flags representing the operations. More...
 
std::vector< TYPEasVector () const
 Converts the flags into a vector of operation types. More...
 

Detailed Description

The ItemOp struct represents the operations that can be performed on a instance/resource.

This struct defines a set of operations that can be performed on a instance/resource. Each operation is represented by a flag value, which can be combined using bitwise OR to represent multiple operations.

The ItemOp struct provides methods to check if a specific operation is supported, check compatibility with another ItemOp object, and retrieve the flags representing the operations.

The ItemOp struct also provides methods to check if an operation is of a specific type, such as read, write, execute, discover, delete or create.

Additionally, the ItemOp struct provides a method to convert the flags into a vector of operation types.

Definition at line 24 of file ItemOp.h.

Member Enumeration Documentation

◆ TYPE

enum wpp::ItemOp::TYPE : uint8_t

Enum representing the different types of operations.

Enumerator
NONE 

No operation

READ 

Read operation

WRITE 

Write update/replace operation

EXECUTE 

Execute operation

DISCOVER 

Discover operation

CREATE 

Create operation

DELETE 

Delete operation

Definition at line 29 of file ItemOp.h.

Constructor & Destructor Documentation

◆ ItemOp()

wpp::ItemOp::ItemOp ( uint8_t  flags = TYPE::NONE)
inline

Constructs a ItemOp object with the specified flags.

Parameters
flagsThe flags representing the operations.

Definition at line 45 of file ItemOp.h.

Member Function Documentation

◆ asVector()

std::vector<TYPE> wpp::ItemOp::asVector ( ) const
inline

Converts the flags into a vector of operation types.

Returns
A vector containing the operation types represented by the flags.

Definition at line 119 of file ItemOp.h.

◆ getFlags()

uint8_t wpp::ItemOp::getFlags ( ) const
inline

Retrieves the flags representing the operations.

Returns
The flags representing the operations.

Definition at line 112 of file ItemOp.h.

◆ isCompatible()

bool wpp::ItemOp::isCompatible ( const ItemOp operation) const
inline

Checks if the ItemOp object is compatible with another ItemOp object.

Two ItemOp objects are compatible if their flags have the same operations.

Parameters
operationThe ItemOp object to check compatibility with.
Returns
true if the objects are compatible, false otherwise.

Definition at line 63 of file ItemOp.h.

+ Here is the caller graph for this function:

◆ isCreate()

bool wpp::ItemOp::isCreate ( ) const
inline

Checks if the operation is of type CREATE.

Returns
true if the operation is of type CREATE, false otherwise.

Definition at line 98 of file ItemOp.h.

+ Here is the caller graph for this function:

◆ isDelete()

bool wpp::ItemOp::isDelete ( ) const
inline

Checks if the operation is of type DELETE.

Returns
true if the operation is of type DELETE, false otherwise.

Definition at line 105 of file ItemOp.h.

+ Here is the caller graph for this function:

◆ isDiscover()

bool wpp::ItemOp::isDiscover ( ) const
inline

Checks if the ItemOp object represents a discover operation.

Returns
true if the object represents a discover operation, false otherwise.

Definition at line 91 of file ItemOp.h.

+ Here is the caller graph for this function:

◆ isExecute()

bool wpp::ItemOp::isExecute ( ) const
inline

Checks if the ItemOp object represents an execute operation.

Returns
true if the object represents an execute operation, false otherwise.

Definition at line 84 of file ItemOp.h.

+ Here is the caller graph for this function:

◆ isRead()

bool wpp::ItemOp::isRead ( ) const
inline

Checks if the ItemOp object represents a read operation.

Returns
true if the object represents a read operation, false otherwise.

Definition at line 70 of file ItemOp.h.

+ Here is the caller graph for this function:

◆ isSupported()

bool wpp::ItemOp::isSupported ( TYPE  type) const
inline

Checks if a specific operation is supported.

Parameters
typeThe operation type to check.
Returns
true if the operation is supported, false otherwise.

Definition at line 53 of file ItemOp.h.

◆ isWrite()

bool wpp::ItemOp::isWrite ( ) const
inline

Checks if the ItemOp object represents a write operation.

Returns
true if the object represents a write operation, false otherwise.

Definition at line 77 of file ItemOp.h.

+ Here is the caller graph for this function: