Torc  0.1
Public Slots | Signals | Public Member Functions | Properties | List of all members
TorcInputs Class Referencefinal

#include <torcinputs.h>

Inheritance diagram for TorcInputs:
[legend]

Public Slots

void SubscriberDeleted (QObject *Subscriber)
 
QVariantMap GetInputList (void)
 Return a map of known inputs. More...
 
QStringList GetInputTypes (void)
 

Signals

void InputsChanged (void)
 

Public Member Functions

 TorcInputs ()
 TorcInputs contains the master record of known inputs. More...
 
 ~TorcInputs ()=default
 
void Graph (QByteArray *Data)
 
QString GetUIName (void) override
 
void Create (const QVariantMap &Details) override
 
void Destroy (void) override
 
void AddInput (TorcInput *Input)
 
void RemoveInput (TorcInput *Input)
 
- Public Member Functions inherited from TorcHTTPService
 TorcHTTPService (QObject *Parent, const QString &Signature, const QString &Name, const QMetaObject &MetaObject, const QString &Blacklist=QStringLiteral(""))
 
virtual ~TorcHTTPService ()
 
void ProcessHTTPRequest (const QString &PeerAddress, int PeerPort, const QString &LocalAddress, int LocalPort, TorcHTTPRequest &Request) override
 
QVariantMap ProcessRequest (const QString &Method, const QVariant &Parameters, QObject *Connection, bool Authenticated) override
 
QString GetMethod (int Index)
 
QVariant GetProperty (int Index)
 Get the value of a given property. More...
 
QVariantMap GetServiceDetails (void)
 Return a QVariantMap describing the services methods and properties. More...
 
virtual QString GetPresentationURL (void)
 
- Public Member Functions inherited from TorcHTTPHandler
 TorcHTTPHandler (const QString &Signature, const QString &Name)
 
virtual ~TorcHTTPHandler ()
 
QString Signature (void) const
 
bool GetRecursive (void) const
 
QString Name (void) const
 
- Public Member Functions inherited from TorcDeviceHandler
 TorcDeviceHandler ()
 
virtual ~TorcDeviceHandler ()=default
 

Properties

QVariantMap inputList
 

Additional Inherited Members

- Static Public Member Functions inherited from TorcDeviceHandler
static void Start (const QVariantMap &Details)
 
static void Stop (void)
 
- Protected Member Functions inherited from TorcHTTPService
void HandleSubscriberDeleted (QObject *Subscriber)
 
- Protected Member Functions inherited from TorcDeviceHandler
TorcDeviceHandlerGetNextHandler (void)
 
- Static Protected Member Functions inherited from TorcHTTPHandler
static bool MethodIsAuthorised (TorcHTTPRequest &Request, int Allowed)
 Check the current request is authorised and set the authentication header if not. More...
 
static void HandleOptions (TorcHTTPRequest &Request, int Allowed)
 
static void HandleFile (TorcHTTPRequest &Request, const QString &Filename, int Cache)
 
- Static Protected Member Functions inherited from TorcDeviceHandler
static TorcDeviceHandlerGetDeviceHandler (void)
 
- Protected Attributes inherited from TorcHTTPService
QReadWriteLock m_httpServiceLock
 
- Protected Attributes inherited from TorcHTTPHandler
QString m_signature
 
bool m_recursive
 
QString m_name
 
- Protected Attributes inherited from TorcDeviceHandler
QReadWriteLock m_handlerLock
 

Detailed Description

Definition at line 13 of file torcinputs.h.

Constructor & Destructor Documentation

TorcInputs::TorcInputs ( )

TorcInputs contains the master record of known inputs.

A static global TorcInputs object is created (this could alternatively be created as a TorcAdminObject). This object will list these inputs as an HTTP service.

Any subclass of TorcInput will automatically register itself on creation. Any class creating inputs must DownRef AND call RemoveInput when deleting them.

It also creates and manages known network (i.e. user set) and constant inputs.

<torc>
<inputs>
<network>
<switch/pwm/temperature/ph/button>
<name></name>
<default></default>
<username></username>
<userdescription></userdescription>
</switch etc>
</network>
<constant>
<switch/pwm/temperature/ph> -- NO BUTTON
<name></name>
<default></default>
<username></username>
<userdescription></userdescription>
</switch etc>
</constant>
</inputs>
</torc>
Note
This class is thread safe.

Definition at line 77 of file torcinputs.cpp.

TorcInputs::~TorcInputs ( )
default

Member Function Documentation

void TorcInputs::AddInput ( TorcInput Input)

Definition at line 160 of file torcinputs.cpp.

void TorcInputs::Create ( const QVariantMap &  Details)
overridevirtual

Implements TorcDeviceHandler.

Definition at line 196 of file torcinputs.cpp.

void TorcInputs::Destroy ( void  )
overridevirtual

Implements TorcDeviceHandler.

Definition at line 271 of file torcinputs.cpp.

QVariantMap TorcInputs::GetInputList ( void  )
slot

Return a map of known inputs.

To simplify javascript on the webclient side, the map is presented as a list of input paths by type, allowing a client to quickly filter and subscribe to the individual services for further detail.

Definition at line 136 of file torcinputs.cpp.

QStringList TorcInputs::GetInputTypes ( void  )
slot

Definition at line 155 of file torcinputs.cpp.

QString TorcInputs::GetUIName ( void  )
overridevirtual

Reimplemented from TorcHTTPService.

Definition at line 87 of file torcinputs.cpp.

void TorcInputs::Graph ( QByteArray *  Data)

Definition at line 92 of file torcinputs.cpp.

void TorcInputs::InputsChanged ( void  )
signal
void TorcInputs::RemoveInput ( TorcInput Input)

Definition at line 178 of file torcinputs.cpp.

void TorcInputs::SubscriberDeleted ( QObject *  Subscriber)
slot

Definition at line 125 of file torcinputs.cpp.

Property Documentation

QVariantMap TorcInputs::inputList
read

Definition at line 18 of file torcinputs.h.


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