|
Friendly LWM2M client
|
The Object class implements manipulation with Instance interface class and its inheritors. More...
#include <Object.h>
Inheritance diagram for wpp::Object:
Collaboration diagram for wpp::Object:Public Member Functions | |
| Object (lwm2m_context_t &context) | |
| Object (lwm2m_context_t &context, const ObjectInfo &info) | |
| Constructs an Object instance. More... | |
| virtual | ~Object () |
| Destroys the Object instance. More... | |
| OBJ_ID | getObjectID () const |
| Gets the object ID. More... | |
| const ObjectInfo & | getObjectInfo () const |
| Gets the object information. More... | |
| lwm2m_object_t & | getLwm2mObject () |
| Gets the lwm2m_object_t object. More... | |
| lwm2m_context_t & | getContext () |
| Return context that can be used by derived class. More... | |
| WppClient & | getClient () |
| Helpfull methods to get client instances. More... | |
| WppRegistry & | getRegistry () |
| Helpfull methods to get registry instances. More... | |
| virtual Instance * | createInstance (ID_T instanceID=ID_T_MAX_VAL)=0 |
| Creates an instance of the object. More... | |
| bool | remove (ID_T instanceID) |
| Removes an instance of the object. More... | |
| void | clear () |
| Clears the object. More... | |
| Instance * | instance (ID_T instanceID=ID_T_MAX_VAL) |
| Gets an instance of the object. More... | |
| const std::vector< Instance * > & | instances () |
| Gets all instances of the object. More... | |
| size_t | instanceCnt () |
| Gets the number of instances of the object. More... | |
| bool | isExist (ID_T instanceID) |
| Checks if an instance exists. More... | |
Public Member Functions inherited from wpp::ObjSubject | |
| void | opSubscribe (ObjOpObserver *observer) |
| Subscribes an observer to receive notifications about object operations. More... | |
| void | opUnsubscribe (ObjOpObserver *observer) |
| Unsubscribes an observer from receiving notifications about object operations. More... | |
Protected Member Functions | |
| std::vector< Instance * >::iterator | getInstIter (ID_T instanceID) |
| Gets the iterator to the instance. More... | |
| ID_T | getFirstAvailableInstanceID () |
| Gets the first available instance ID. More... | |
Protected Member Functions inherited from wpp::ObjSubject | |
| void | operationNotify (Object &obj, ID_T instanceId, ItemOp::TYPE type) |
| Notifies observers about object operations. More... | |
Static Protected Member Functions | |
| static uint8_t | serverRead_clb (lwm2m_context_t *contextP, lwm2m_server_t *server, ID_T instanceId, int *numDataP, lwm2m_data_t **dataArrayP, lwm2m_object_t *objectP) |
| The read callback function for the Lwm2m core. More... | |
| static uint8_t | serverWrite_clb (lwm2m_context_t *contextP, lwm2m_server_t *server, ID_T instanceId, int numData, lwm2m_data_t *dataArray, lwm2m_object_t *objectP, lwm2m_write_type_t writeType) |
| The write callback function for the Lwm2m core. More... | |
| static uint8_t | serverExecute_clb (lwm2m_context_t *contextP, lwm2m_server_t *server, ID_T instanceId, ID_T resId, uint8_t *buffer, int length, lwm2m_object_t *objectP) |
| The execute callback function for the Lwm2m core. More... | |
| static uint8_t | serverDiscover_clb (lwm2m_context_t *contextP, lwm2m_server_t *server, ID_T instanceId, int *numDataP, lwm2m_data_t **dataArrayP, lwm2m_object_t *objectP) |
| The discover callback function for the Lwm2m core. More... | |
| static uint8_t | serverCreate_clb (lwm2m_context_t *contextP, lwm2m_server_t *server, ID_T instanceId, int numData, lwm2m_data_t *dataArray, lwm2m_object_t *objectP) |
| The create callback function for the Lwm2m core. More... | |
| static uint8_t | serverDelete_clb (lwm2m_context_t *contextP, lwm2m_server_t *server, ID_T instanceId, lwm2m_object_t *objectP) |
| The delete callback function for the Lwm2m core. More... | |
Protected Attributes | |
| std::vector< Instance * > | _instances |
| lwm2m_context_t & | _context |
| lwm2m_object_t | _lwm2m_object |
| ObjectInfo | _objInfo |
The Object class implements manipulation with Instance interface class and its inheritors.
The main target of this class is to encapsulate operations like instance create and delete, binding instance callbacks to the core interface, to avoid multiple definitions of this mechanism in instance implementation classes.
| wpp::Object::Object | ( | lwm2m_context_t & | context | ) |
Default constructor.
Definition at line 6 of file Object.cpp.
| wpp::Object::Object | ( | lwm2m_context_t & | context, |
| const ObjectInfo & | info | ||
| ) |
Constructs an Object instance.
| context | The lwm2m_context_t object. |
| info | The ObjectInfo object. |
Definition at line 8 of file Object.cpp.
Here is the call graph for this function:
|
virtual |
Destroys the Object instance.
Definition at line 32 of file Object.cpp.
Here is the call graph for this function:| void wpp::Object::clear | ( | ) |
Clears the object.
Definition at line 61 of file Object.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
pure virtual |
Creates an instance of the object.
| instanceID | The instance ID. |
Implemented in wpp::ObjectImpl< T >.
Here is the caller graph for this function:| WppClient & wpp::Object::getClient | ( | ) |
Helpfull methods to get client instances.
Definition at line 53 of file Object.cpp.
Here is the call graph for this function:| lwm2m_context_t & wpp::Object::getContext | ( | ) |
Return context that can be used by derived class.
Definition at line 49 of file Object.cpp.
Here is the caller graph for this function:
|
protected |
Gets the first available instance ID.
Definition at line 125 of file Object.cpp.
Here is the call graph for this function:Gets the iterator to the instance.
| instanceID | The instance ID. |
Definition at line 120 of file Object.cpp.
Here is the caller graph for this function:| lwm2m_object_t & wpp::Object::getLwm2mObject | ( | ) |
Gets the lwm2m_object_t object.
Definition at line 41 of file Object.cpp.
| OBJ_ID wpp::Object::getObjectID | ( | ) | const |
Gets the object ID.
Definition at line 37 of file Object.cpp.
Here is the caller graph for this function:| const ObjectInfo & wpp::Object::getObjectInfo | ( | ) | const |
Gets the object information.
Definition at line 45 of file Object.cpp.
| WppRegistry & wpp::Object::getRegistry | ( | ) |
Helpfull methods to get registry instances.
Definition at line 57 of file Object.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| Instance * wpp::Object::instance | ( | ID_T | instanceID = ID_T_MAX_VAL | ) |
Gets an instance of the object.
| instanceID | The instance ID. If not provided, the first available instance is returned. |
Definition at line 102 of file Object.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| size_t wpp::Object::instanceCnt | ( | ) |
Gets the number of instances of the object.
Definition at line 112 of file Object.cpp.
| const std::vector< Instance * > & wpp::Object::instances | ( | ) |
Gets all instances of the object.
Definition at line 108 of file Object.cpp.
| bool wpp::Object::isExist | ( | ID_T | instanceID | ) |
Checks if an instance exists.
| instanceID | The instance ID. |
Definition at line 116 of file Object.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| bool wpp::Object::remove | ( | ID_T | instanceID | ) |
Removes an instance of the object.
| instanceID | The instance ID. |
Definition at line 82 of file Object.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprotected |
The create callback function for the Lwm2m core.
| contextP | The lwm2m_context_t object. |
| server | Contains valid pointer when request retrieved from server or NULL if request initiated by core. |
| instanceId | The instance ID. |
| numData | The number of data. |
| dataArray | The data array. |
| objectP | The lwm2m_object_t object. |
Definition at line 163 of file Object.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprotected |
The delete callback function for the Lwm2m core.
| contextP | The lwm2m_context_t object. |
| server | Contains valid pointer when request retrieved from server or NULL if request initiated by core. |
| instanceId | The instance ID. |
| objectP | The lwm2m_object_t object. |
Definition at line 179 of file Object.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprotected |
The discover callback function for the Lwm2m core.
| contextP | The lwm2m_context_t object. |
| server | Contains valid pointer when request retrieved from server or NULL if request initiated by core. |
| instanceId | The instance ID. |
| numDataP | The number of data. |
| dataArrayP | The data array. |
| objectP | The lwm2m_object_t object. |
Definition at line 156 of file Object.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprotected |
The execute callback function for the Lwm2m core.
| contextP | The lwm2m_context_t object. |
| server | Contains valid pointer when request retrieved from server or NULL if request initiated by core. |
| instanceId | The instance ID. |
| resId | The resource ID. |
| buffer | The buffer. |
| length | The length. |
| objectP | The lwm2m_object_t object. |
Definition at line 149 of file Object.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprotected |
The read callback function for the Lwm2m core.
| contextP | The lwm2m_context_t object. |
| server | Contains valid pointer when request retrieved from server or NULL if request initiated by core. |
| instanceId | The instance ID. |
| numDataP | The number of data. |
| dataArrayP | The data array. |
| objectP | The lwm2m_object_t object. |
Definition at line 135 of file Object.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprotected |
The write callback function for the Lwm2m core.
| contextP | The lwm2m_context_t object. |
| server | Contains valid pointer when request retrieved from server or NULL if request initiated by core. |
| instanceId | The instance ID. |
| numData | The number of data. |
| dataArray | The data array. |
| objectP | The lwm2m_object_t object. |
| writeType | The write type. |
Definition at line 142 of file Object.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |