Signals | Public Member Functions | Private Attributes

# ShObjectHelper Class Reference

Plug-in template class. More...

`#include <shobjecthelper.h>`

Inheritance diagram for ShObjectHelper:
[legend]
Collaboration diagram for ShObjectHelper:
[legend]

List of all members.

## Signals
void | newMessage (ShMessagePtr message)
## Public Member Functions
| ShObjectHelper (QObject *parent=0)
| Constructor of ShObjectHelper, the plug-in template class.
virtual int | objectId ()
virtual void | setObjectId (int id)
virtual bool | idApi ()
virtual void | setIdApi (bool idApi)
void | dispatchMessage (ShMessagePtr message)
| Fills in the sender and dispatches the message to ShBase for routing.
void | ackMessage (ShMessagePtr message)
| Convenient method for messages acknowledging.
void | errorMessage (ShMessagePtr message, QString reason)
| Convenient method for dispatching error messages.
void | outputUpdated (QString signal, QVariant value)
| Convenient method for dispatching messages informing about output update.
## Private Attributes
int | mId
bool | mIdApi

## Detailed Description

Plug-in template class.

Implements the most frequent used methods making the development of new plug-ins more convenient and faster.

Definition at line 33 of file shobjecthelper.h.

## Constructor & Destructor Documentation

ShObjectHelper::ShObjectHelper | ( | QObject * | parent = `0` | ) |

Constructor of ShObjectHelper, the plug-in template class.

Parameters:

  | parent | Pointer to the parent object

Definition at line 26 of file shobjecthelper.cpp.

References mId, and mIdApi.

## Member Function Documentation

void ShObjectHelper::ackMessage | ( | ShMessagePtr | message | ) |

Convenient method for messages acknowledging.

Parameters:

  | message | Shared pointer to the message to acknowledge

Definition at line 48 of file shobjecthelper.cpp.

References dispatchMessage(), and ShMessage::mtAck.

Referenced by ShX10::emitAck(), ShXbee::messageProcessed(), ShTimer::processMessage(), ShThermostat::processMessage(), and ShLogic::processMessage().

Here is the call graph for this function:

Here is the caller graph for this function:

void ShObjectHelper::dispatchMessage | ( | ShMessagePtr | message | ) |

Fills in the sender and dispatches the message to ShBase for routing.

Parameters:

  | message | Shared pointer to the message

Definition at line 37 of file shobjecthelper.cpp.

References mId, and newMessage().

Referenced by ackMessage(), errorMessage(), outputUpdated(), and ShTcpServer::processPacket().

Here is the call graph for this function:

Here is the caller graph for this function:

void ShObjectHelper::errorMessage | ( | ShMessagePtr | message,
|  | QString | reason |
| ) |  |  |

Convenient method for dispatching error messages.

Parameters:

  | message | Shared pointer to the message
  | reason | Error string

Definition at line 66 of file shobjecthelper.cpp.

References dispatchMessage(), and ShMessage::mtError.

Referenced by ShX10::emitErr(), ShXbee::messageError(), ShXbee::messageTimeout(), ShThermostat::processMessage(), and ShLogic::processMessage().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool ShObjectHelper::idApi | ( |  | ) | `[inline, virtual]`

Implements ShObject.

Definition at line 44 of file shobjecthelper.h.

References mIdApi.

void ShObjectHelper::newMessage | ( | ShMessagePtr | message | ) | `[signal]`

Referenced by dispatchMessage().

Here is the caller graph for this function:

virtual int ShObjectHelper::objectId | ( |  | ) | `[inline, virtual]`

Implements ShObject.

Definition at line 41 of file shobjecthelper.h.

References mId.

void ShObjectHelper::outputUpdated | ( | QString | signal,
|  | QVariant | value |
| ) |  |  |

Convenient method for dispatching messages informing about output update.

Parameters:

  | signal | Name of a signal that has been updated
  | value | New value of the signal

Definition at line 84 of file shobjecthelper.cpp.

References dispatchMessage(), and ShMessage::mtValue.

Referenced by ShTimer::onTimeout(), ShTimer::processMessage(), ShLogic::processMessage(), ShXbee::processPacket(), ShThermostat::updateOutput(), and ShLogic::updateOutput().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void ShObjectHelper::setIdApi | ( | bool | idApi | ) | `[inline, virtual]`

Implements ShObject.

Definition at line 45 of file shobjecthelper.h.

References mIdApi.

Referenced by ShTcpServer::init().

Here is the caller graph for this function:

virtual void ShObjectHelper::setObjectId | ( | int | id | ) | `[inline, virtual]`

Implements ShObject.

Definition at line 42 of file shobjecthelper.h.

References mId.

## Member Data Documentation

int ShObjectHelper::mId`[private]`

Definition at line 57 of file shobjecthelper.h.

Referenced by dispatchMessage(), objectId(), setObjectId(), and ShObjectHelper().

bool ShObjectHelper::mIdApi`[private]`

Definition at line 58 of file shobjecthelper.h.

Referenced by idApi(), setIdApi(), and ShObjectHelper().

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

- daemon/shobjecthelper.h
- daemon/shobjecthelper.cpp

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends