IQRF Gateway Daemon
IService.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016-2017 MICRORISC s.r.o.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include "JsonUtils.h"
20 #include <string>
21 #include <functional>
22 
24 class IDaemon;
25 class ISerializer;
26 class IMessaging;
27 
30 class IService
31 {
32 public:
36  virtual void start() = 0;
37 
41  virtual void stop() = 0;
42 
47  virtual void update(const rapidjson::Value& cfg) = 0;
48 
53  virtual const std::string& getName() const = 0;
54 
59  virtual void setDaemon(IDaemon* daemon) = 0;
60 
65  virtual void setSerializer(ISerializer* serializer) = 0;
66 
71  virtual void setMessaging(IMessaging* messaging) = 0;
72 
73  inline virtual ~IService() {};
74 };
virtual void setDaemon(IDaemon *daemon)=0
Set IDaemon instance reference.
virtual const std::string & getName() const =0
Get name of the instance.
ISerializer interface.
Definition: ISerializer.h:31
virtual void setSerializer(ISerializer *serializer)=0
Set ISerializer instance reference.
IDaemon interface.
Definition: IDaemon.h:31
virtual void stop()=0
Stop IService instance.
IService interface.
Definition: IService.h:30
IMessaging interface.
Definition: IMessaging.h:29
virtual void setMessaging(IMessaging *messaging)=0
Set IMessaging instance reference.
virtual void update(const rapidjson::Value &cfg)=0
Update configuration.
virtual ~IService()
Definition: IService.h:73
virtual void start()=0
Start IService instance.