|
Friendly LWM2M client
|
#include <ResourceContainer.h>
Inheritance diagram for wpp::ResourceContainer:
Collaboration diagram for wpp::ResourceContainer:Public Member Functions | |
| ResourceContainer ()=default | |
| virtual | ~ResourceContainer ()=default |
| bool | isSingle (ID_T resId) |
| Check if the resource is SINGLE. More... | |
| bool | isMultiple (ID_T resId) |
| Check if the resource is MULTIPLE. More... | |
| bool | isExist (ID_T resId) |
| Check if the instance ID is exist. More... | |
| bool | isExist (ID_T resId, ID_T resInstId) |
| Check if the instance ID is exist. More... | |
| size_t | instCount (ID_T resId) |
| Get the number of resource instances. More... | |
| std::vector< ID_T > | instIds (ID_T resId) |
| Returns vector with available ids of resource instances. More... | |
| ID_T | newInstId (ID_T resId) |
| Find first available instance ID that is not used. More... | |
| template<typename T > | |
| bool | set (ID_T resId, const T &value) |
| Set data value by copy for the resource. More... | |
| template<typename T > | |
| bool | set (ID_T resId, ID_T resInstId, const T &value) |
| Set data value by copy for the resource instance. More... | |
| template<typename T > | |
| bool | set (ID_T resId, T &&value) |
| Set data value by move for the resource. More... | |
| template<typename T > | |
| bool | set (ID_T resId, ID_T resInstId, T &&value) |
| Set data value by move for the resource instance. More... | |
| template<typename T > | |
| const T & | get (ID_T resId, ID_T resInstId=SINGLE_INSTANCE_ID) |
| template<typename T > | |
| bool | add (ID_T resId, const T &value) |
| Add new instance with data value by copy for the MULTIPLE resource. More... | |
| template<typename T > | |
| bool | add (ID_T resId, T &&value) |
| Add new instance with data value by move for the MULTIPLE resource. More... | |
| bool | removeRes (ID_T resId, ID_T resInstId) |
| Remove resource instance if resource is MULTIPLE and instance exists, if the resource is SINGLE remove is not possible. More... | |
| bool | clearRes (ID_T resId) |
| Remove all instances. More... | |
Protected Member Functions | |
| void | setupResources (const std::vector< Resource > &resources) |
| This methods setup resources list. More... | |
| void | setupResources (std::vector< Resource > &&resources) |
| Resource * | resource (ID_T resId) |
| This method return resource ptr if it exists. If resources does not exist then return NULL. More... | |
| std::vector< Resource > & | resources () |
| This method return list with all resources that has been defined. More... | |
| virtual void | resourceOperationNotifier (ItemOp::TYPE type, ID_T resId, ID_T resInstId)=0 |
| This method must be implemented by the derived class, and handle information about resource operation (WRITE, DELETE). Called by ResourceContainer after resource operation performed. More... | |
Definition at line 13 of file ResourceContainer.h.
|
default |
|
virtualdefault |
| bool wpp::ResourceContainer::add | ( | ID_T | resId, |
| const T & | value | ||
| ) |
Add new instance with data value by copy for the MULTIPLE resource.
| value | The data value to add |
| resId | The resource ID |
Definition at line 269 of file ResourceContainer.h.
Here is the call graph for this function:| bool wpp::ResourceContainer::add | ( | ID_T | resId, |
| T && | value | ||
| ) |
Add new instance with data value by move for the MULTIPLE resource.
| value | The data value to add |
| resId | The resource ID |
Definition at line 294 of file ResourceContainer.h.
Here is the call graph for this function:| bool wpp::ResourceContainer::clearRes | ( | ID_T | resId | ) |
Remove all instances.
Definition at line 74 of file ResourceContainer.cpp.
Here is the call graph for this function:| const T & wpp::ResourceContainer::get | ( | ID_T | resId, |
| ID_T | resInstId = SINGLE_INSTANCE_ID |
||
| ) |
| size_t wpp::ResourceContainer::instCount | ( | ID_T | resId | ) |
Get the number of resource instances.
| resId | The resource ID |
Definition at line 36 of file ResourceContainer.cpp.
Here is the call graph for this function:Returns vector with available ids of resource instances.
| resId | The resource ID |
Definition at line 45 of file ResourceContainer.cpp.
Here is the call graph for this function:| bool wpp::ResourceContainer::isExist | ( | ID_T | resId | ) |
Check if the instance ID is exist.
| resId | The resource ID |
Definition at line 23 of file ResourceContainer.cpp.
Here is the call graph for this function:Check if the instance ID is exist.
| resId | The resource ID |
| resInstId | The instance ID to check |
Definition at line 27 of file ResourceContainer.cpp.
Here is the call graph for this function:| bool wpp::ResourceContainer::isMultiple | ( | ID_T | resId | ) |
Check if the resource is MULTIPLE.
| resId | The resource ID |
Definition at line 14 of file ResourceContainer.cpp.
Here is the call graph for this function:| bool wpp::ResourceContainer::isSingle | ( | ID_T | resId | ) |
Check if the resource is SINGLE.
| resId | The resource ID |
Definition at line 5 of file ResourceContainer.cpp.
Here is the call graph for this function:Find first available instance ID that is not used.
| resId | The resource ID |
Definition at line 54 of file ResourceContainer.cpp.
Here is the call graph for this function:Remove resource instance if resource is MULTIPLE and instance exists, if the resource is SINGLE remove is not possible.
| resId | The resource ID |
| resInstId | The instance ID to remove |
Definition at line 63 of file ResourceContainer.cpp.
Here is the call graph for this function:This method return resource ptr if it exists. If resources does not exist then return NULL.
| resId | - Resource ID. |
Definition at line 93 of file ResourceContainer.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
protectedpure virtual |
This method must be implemented by the derived class, and handle information about resource operation (WRITE, DELETE). Called by ResourceContainer after resource operation performed.
Implemented in wpp::Instance.
Here is the caller graph for this function:
|
protected |
This method return list with all resources that has been defined.
Definition at line 99 of file ResourceContainer.cpp.
Here is the caller graph for this function:| bool wpp::ResourceContainer::set | ( | ID_T | resId, |
| const T & | value | ||
| ) |
Set data value by copy for the resource.
| value | The data value to set |
| resId | The resource ID |
Definition at line 215 of file ResourceContainer.h.
Here is the caller graph for this function:| bool wpp::ResourceContainer::set | ( | ID_T | resId, |
| ID_T | resInstId, | ||
| const T & | value | ||
| ) |
Set data value by copy for the resource instance.
| value | The data value to set |
| resId | The resource ID |
| resInstId | The instance ID to set the value, used only for MULTIPLE resources |
| resInstId. |
Definition at line 220 of file ResourceContainer.h.
Here is the call graph for this function:Set data value by move for the resource instance.
| value | The data value to set |
| resId | The resource ID |
| resInstId | The instance ID to set the value, used only for MULTIPLE resources |
| resInstId. |
Definition at line 240 of file ResourceContainer.h.
Here is the call graph for this function:| bool wpp::ResourceContainer::set | ( | ID_T | resId, |
| T && | value | ||
| ) |
Set data value by move for the resource.
| value | The data value to set |
| resId | The resource ID |
Definition at line 235 of file ResourceContainer.h.
Here is the call graph for this function:
|
protected |
This methods setup resources list.
Definition at line 85 of file ResourceContainer.cpp.
Here is the call graph for this function:
|
protected |