Timothy Beight / Mbed 2 deprecated 6_songs-from-the-cloud

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Fork of 6_songs-from-the-cloud by MakingMusicWorkshop

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers m2mobservationhandler.h Source File

m2mobservationhandler.h

00001 /*
00002  * Copyright (c) 2015 ARM Limited. All rights reserved.
00003  * SPDX-License-Identifier: Apache-2.0
00004  * Licensed under the Apache License, Version 2.0 (the License); you may
00005  * not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
00012  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #ifndef M2M_OBSERVATION_HANDLER_H
00017 #define M2M_OBSERVATION_HANDLER_H
00018 
00019 
00020 //FORWARD DECLARATION
00021 class M2MBase;
00022 class M2MResourceInstance;
00023 
00024 /**
00025  * @brief M2MObservationHandler
00026  * An interface for handling observation
00027  * callbacks from different objects.
00028  *
00029  */
00030 class M2MObservationHandler
00031 {
00032   public:
00033 
00034     /**
00035      * @brief Observation callback to be sent to the
00036      * server due to a change in a parameter under observation.
00037      * @param object, Observed object whose information
00038      * needs to be sent.
00039      */
00040     virtual void observation_to_be_sent(M2MBase *object) = 0;
00041 
00042     /**
00043      * @brief Callback for deleting an NSDL resource.
00044      * @param resource_name, Name of the observed object whose information
00045      * needs to be deleted.
00046      */
00047     virtual void resource_to_be_deleted(const String &resource_name) = 0;
00048 
00049     /**
00050      * @brief Callback indicating that the value of the resource object is updated by server.
00051      * @param base, Object whose value is updated.
00052      * @param object_name, Name of the resource which is updated, default is empty.
00053      */
00054     virtual void value_updated(M2MBase *base, const String &object_name = "") = 0;
00055 
00056     /**
00057      * @brief Callback for removing an object from the list.
00058      * @param object, M2MObject to be removed.
00059      */
00060     virtual void remove_object(M2MBase *object) = 0;
00061 
00062 };
00063 
00064 
00065 #endif // M2M_OBSERVATION_HANDLER_H