UPnP::Device Class Reference

Represents any kind of device, including a root device. More...

#include <Device.h>

Inheritance diagram for UPnP::Device:
Collaboration diagram for UPnP::Device:

Public Types

enum class  Field { XX , customStart = domain , MAX }
 
using List = ObjectList< Device >
 
using OwnedList = OwnedObjectList< Device >
 
- Public Types inherited from UPnP::Object
using Version = ObjectClass::Version
 

Public Member Functions

 Device (Device &parent)
 
 Device (Device *parent=nullptr)
 
String caption () const
 
virtual String getUrl (const String &path) const
 Get fully qualified URL. More...
 
virtual String getUrlBasePath () const
 Get the base URL path. More...
 
String resolvePath (const String &path) const
 Resolve a path (relative or absolute) into an absolute path. More...
 
Deviceroot ()
 
const Deviceroot () const
 
bool isRoot () const
 
template<class S , typename T >
S * getService (const T &serviceType)
 
template<typename T >
ServicegetService (const T &serviceType)
 
template<class D , typename T >
D * getDevice (const T &deviceType)
 
template<typename T >
DevicegetDevice (const T &deviceType)
 
void search (const SearchFilter &filter) override
 Called during SSDP search operation. More...
 
bool formatMessage (Message &msg, MessageSpec &ms) override
 Standard fields have been completed. More...
 
virtual String getField (Field desc) const
 
Urn objectType () const override
 
String friendlyName () const
 
bool onHttpRequest (HttpServerConnection &connection) override
 Called by framework to handle an incoming HTTP request. More...
 
void addDevice (Device *device)
 
void addService (Service *service)
 
XML::NodegetDescription (XML::Document &doc, DescType descType) const override
 
IDataSourceStreamcreateDescription () override
 Called by framework to construct a device description response stream. More...
 
ItemEnumeratorgetList (unsigned index, String &name) override
 
void sendXml (HttpResponse &response, IDataSourceStream *content)
 
Deviceparent ()
 
Service::OwnedListservices ()
 
OwnedListdevices ()
 
- Public Member Functions inherited from UPnP::ObjectTemplate< Device, Object >
DevicegetNext () const
 
Iterator begin () const
 
Iterator end () const
 
- Public Member Functions inherited from UPnP::Object
virtual const ObjectClassgetClass () const =0
 
ObjectgetNext () const
 
bool typeIs (const Urn &objectType) const
 
bool typeIs (const String &objectType) const
 
bool typeIs (const ObjectClass &objectClass) const
 
virtual Version version () const
 
- Public Member Functions inherited from UPnP::BaseObject
virtual void sendMessage (Message &msg, MessageSpec &ms)
 Called by framework to construct then send a message. More...
 
- Public Member Functions inherited from UPnP::LinkedItem
Itemnext () const override
 
LinkedItemgetNext () const
 
- Public Member Functions inherited from UPnP::Item
virtual ~Item ()
 
bool operator== (const Item &other) const
 

Detailed Description

Represents any kind of device, including a root device.

Member Typedef Documentation

◆ List

◆ OwnedList

Member Enumeration Documentation

◆ Field

enum UPnP::Device::Field
strong
Enumerator
XX 
customStart 
MAX 

Constructor & Destructor Documentation

◆ Device() [1/2]

UPnP::Device::Device ( Device parent)
inline

◆ Device() [2/2]

UPnP::Device::Device ( Device parent = nullptr)
inline

Member Function Documentation

◆ addDevice()

void UPnP::Device::addDevice ( Device device)
inline

◆ addService()

void UPnP::Device::addService ( Service service)
inline

◆ caption()

String UPnP::Device::caption ( ) const
inline

◆ createDescription()

IDataSourceStream* UPnP::Device::createDescription ( )
overridevirtual

Called by framework to construct a device description response stream.

Return values
IDataSourceStream*The XML description content

By default, the framework generates a stream constructed from the device information fields, but this method may be overridden if, for example, a fixed description is stored in an .xml file.

Reimplemented from UPnP::Object.

◆ devices()

OwnedList& UPnP::Device::devices ( )
inline

◆ formatMessage()

bool UPnP::Device::formatMessage ( Message msg,
MessageSpec ms 
)
overridevirtual

Standard fields have been completed.

Note
Fields can be modified typically by adding any custom fields before sending response.
Parameters
msgThe message being constructed
msTemplate spec. for message
Return values
boolReturn true to send message, false to cancel

Implements UPnP::BaseObject.

◆ friendlyName()

String UPnP::Device::friendlyName ( ) const
inline

◆ getDescription()

XML::Node* UPnP::Device::getDescription ( XML::Document doc,
DescType  descType 
) const
overridevirtual

Reimplemented from UPnP::Item.

◆ getDevice() [1/2]

template<class D , typename T >
D* UPnP::Device::getDevice ( const T &  deviceType)
inline

◆ getDevice() [2/2]

template<typename T >
Device* UPnP::Device::getDevice ( const T &  deviceType)
inline

◆ getField()

virtual String UPnP::Device::getField ( Field  desc) const
virtual

Reimplemented in UPnP::DeviceControl.

◆ getList()

ItemEnumerator* UPnP::Device::getList ( unsigned  index,
String name 
)
overridevirtual

Reimplemented from UPnP::Item.

◆ getService() [1/2]

template<class S , typename T >
S* UPnP::Device::getService ( const T &  serviceType)
inline

◆ getService() [2/2]

template<typename T >
Service* UPnP::Device::getService ( const T &  serviceType)
inline

◆ getUrl()

virtual String UPnP::Device::getUrl ( const String path) const
virtual

Get fully qualified URL.

Reimplemented in UPnP::DeviceControl.

◆ getUrlBasePath()

virtual String UPnP::Device::getUrlBasePath ( ) const
virtual

Get the base URL path.

Reimplemented in UPnP::DeviceControl.

◆ isRoot()

bool UPnP::Device::isRoot ( ) const
inline

◆ objectType()

Urn UPnP::Device::objectType ( ) const
inlineoverridevirtual

Reimplemented from UPnP::Object.

◆ onHttpRequest()

bool UPnP::Device::onHttpRequest ( HttpServerConnection connection)
overridevirtual

Called by framework to handle an incoming HTTP request.

Parameters
connection
request
response
Return values
booltrue if request was handled

Reimplemented from UPnP::Object.

◆ parent()

Device& UPnP::Device::parent ( )
inline

◆ resolvePath()

String UPnP::Device::resolvePath ( const String path) const

Resolve a path (relative or absolute) into an absolute path.

◆ root() [1/2]

Device& UPnP::Device::root ( )

◆ root() [2/2]

const Device& UPnP::Device::root ( ) const
inline

◆ search()

void UPnP::Device::search ( const SearchFilter filter)
overridevirtual

Called during SSDP search operation.

Implements UPnP::Object.

◆ sendXml()

void UPnP::Device::sendXml ( HttpResponse response,
IDataSourceStream content 
)

◆ services()

Service::OwnedList& UPnP::Device::services ( )
inline

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