IQRF Gateway Daemon
Public Member Functions | List of all members
BaseService Class Reference

Provides basic message handling. More...

#include <BaseService.h>

Inheritance diagram for BaseService:
IService

Public Member Functions

 BaseService ()=delete
 
 BaseService (const std::string &name)
 parametric constructor More...
 
virtual ~BaseService ()
 
void setDaemon (IDaemon *daemon) override
 Set IDaemon instance reference. More...
 
virtual void setSerializer (ISerializer *serializer) override
 Set ISerializer instance reference. More...
 
virtual void setMessaging (IMessaging *messaging) override
 Set IMessaging instance reference. More...
 
const std::string & getName () const override
 Get name of the instance. More...
 
void update (const rapidjson::Value &cfg) override
 Update configuration. More...
 
void start () override
 Start IService instance. More...
 
void stop () override
 Stop IService instance. More...
 
- Public Member Functions inherited from IService
virtual ~IService ()
 

Detailed Description

Provides basic message handling.

Implements IService interface. It is basic implementation and works just as proxy between IQRF mesh and outside world. It uses IDaemon to communicate via DPA messages with IQRF mesh. It registers to IMessaging to communicate via general messages with outside world. It is possible to set more ISerializer instances for parsing or encoding messages received via IMessaging. It selects appropriate ISerializer instance according incoming messages types. It gets via IDaemon IScheduler to access scheduler methods.

Configurable via its update() method accepting JSON properties:

"Properties": {
"AsyncDpaMessage": true #process asynchronous DPA message
}

Constructor & Destructor Documentation

◆ BaseService() [1/2]

BaseService::BaseService ( )
delete

◆ BaseService() [2/2]

BaseService::BaseService ( const std::string &  name)

parametric constructor

Parameters
[in]nameunique name of this instance

Copyright 2016-2017 MICRORISC s.r.o.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

◆ ~BaseService()

BaseService::~BaseService ( )
virtual

Member Function Documentation

◆ getName()

const std::string& BaseService::getName ( ) const
inlineoverridevirtual

Get name of the instance.

Returns
The instance name

Returns unique name of the instance

Implements IService.

◆ setDaemon()

void BaseService::setDaemon ( IDaemon daemon)
overridevirtual

Set IDaemon instance reference.

Parameters
[in]daemonreferenced instance

Set IDaemon instance reference to access its interface

Implements IService.

◆ setMessaging()

void BaseService::setMessaging ( IMessaging messaging)
overridevirtual

Set IMessaging instance reference.

Parameters
[in]messagingreferenced instance

Set IMessaging instance reference to access its interface

Implements IService.

◆ setSerializer()

void BaseService::setSerializer ( ISerializer serializer)
overridevirtual

Set ISerializer instance reference.

Parameters
[in]serializerreferenced instance

Set ISerializer instance reference to access its interface

Implements IService.

◆ start()

void BaseService::start ( )
overridevirtual

Start IService instance.

IService implementation starts to process incoming messages

Implements IService.

◆ stop()

void BaseService::stop ( )
overridevirtual

Stop IService instance.

IService implementation stops processing incoming messages

Implements IService.

◆ update()

void BaseService::update ( const rapidjson::Value &  cfg)
overridevirtual

Update configuration.

Parameters
[in]cfgconfiguration data

Configuration data are taken from passed cfg and the instance is configured accordingly

Implements IService.


The documentation for this class was generated from the following files: