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

#include <torcoutputs.h>

Inheritance diagram for TorcOutputs:
[legend]

Public Slots

void SubscriberDeleted (QObject *Subscriber)
 
QVariantMap GetOutputList (void)
 Return a map of known outputs. More...
 
QStringList GetOutputTypes (void)
 

Signals

void OutputsChanged (void)
 

Public Member Functions

 TorcOutputs ()
 TorcOutputs contains the master record of known outputs. More...
 
void Graph (QByteArray *Data)
 
QString GetUIName (void) override
 
void Create (const QVariantMap &Details) override
 
void Destroy (void) override
 
void AddOutput (TorcOutput *Output)
 
void RemoveOutput (TorcOutput *Output)
 
- 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 outputList
 

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 torcoutputs.h.

Constructor & Destructor Documentation

TorcOutputs::TorcOutputs ( )

TorcOutputs contains the master record of known outputs.

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

Any subclass of TorcOutput will automatically register itself on creation. Any class creating outputs must DownRef AND call RemoveOutput when deleting them.

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

<torc>
<outputs>
<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>
</outputs>
</torc>
Note
This class is thread safe.

Definition at line 75 of file torcoutputs.cpp.

Member Function Documentation

void TorcOutputs::AddOutput ( TorcOutput Output)

Definition at line 137 of file torcoutputs.cpp.

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

Implements TorcDeviceHandler.

Definition at line 179 of file torcoutputs.cpp.

void TorcOutputs::Destroy ( void  )
overridevirtual

Implements TorcDeviceHandler.

Definition at line 256 of file torcoutputs.cpp.

QVariantMap TorcOutputs::GetOutputList ( void  )
slot

Return a map of known outputs.

Definition at line 113 of file torcoutputs.cpp.

QStringList TorcOutputs::GetOutputTypes ( void  )
slot

Definition at line 132 of file torcoutputs.cpp.

QString TorcOutputs::GetUIName ( void  )
overridevirtual

Reimplemented from TorcHTTPService.

Definition at line 85 of file torcoutputs.cpp.

void TorcOutputs::Graph ( QByteArray *  Data)

Definition at line 90 of file torcoutputs.cpp.

void TorcOutputs::OutputsChanged ( void  )
signal
void TorcOutputs::RemoveOutput ( TorcOutput Output)

Definition at line 158 of file torcoutputs.cpp.

void TorcOutputs::SubscriberDeleted ( QObject *  Subscriber)
slot

Definition at line 106 of file torcoutputs.cpp.

Property Documentation

QVariantMap TorcOutputs::outputList
read

Definition at line 18 of file torcoutputs.h.


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