RDK Documentation (Open Sourced RDK Components)
rtabstractservice.h
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2018 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 #ifndef RTABSTRACT_SERVICE_H
20 #define RTABSTRACT_SERVICE_H
21 //#include "servicedelegate.h" /*XCAST-123 specific change*/
22 #include <rtRemote.h>
23 #include <rtObject.h>
24 class rtAbstractService : public rtObject
25 {
26 public:
27  rtDeclareObject(rtAbstractService, rtObject);
28  rtReadOnlyProperty(name, name, rtString);
29  rtReadOnlyProperty(version, version, uint32_t);
30  rtReadOnlyProperty(quirks, quirks, rtValue);
31  rtMethod2ArgAndNoReturn("on", addListener, rtString, rtFunctionRef);
32  rtMethod2ArgAndNoReturn("delListener", delListener, rtString, rtFunctionRef);
33  rtError name(rtString& v) const;
34  rtError version(uint32_t& v) const;
35  virtual rtError quirks(rtValue& v) const;
36  virtual rtError addListener(rtString eventName, const rtFunctionRef &f);
37  virtual rtError delListener(rtString eventName, const rtFunctionRef &f);
38 protected:
39  rtAbstractService(rtString serviceName);
40  void setName(rtString n);
41  void setApiVersion(uint32_t v);
42  rtError notify(const rtString& eventName, rtObjectRef e);
43 public:
44  virtual ~rtAbstractService();
45 private:
46  rtString mServiceName;
47  uint32_t mApiVersion;
48  rtEmitRef mEmit;
49 };
50 #endif //RTABSTRACT_SERVICE_H
rtAbstractService
Definition: rtabstractservice.h:24