|
a/libupnpp/device.hxx |
|
b/libupnpp/device.hxx |
|
... |
|
... |
35 |
const std::unordered_map<std::string, std::string>& xmlfiles);
|
35 |
const std::unordered_map<std::string, std::string>& xmlfiles);
|
36 |
|
36 |
|
37 |
void addService(UpnpService *, const std::string& serviceId);
|
37 |
void addService(UpnpService *, const std::string& serviceId);
|
38 |
|
38 |
|
39 |
/**
|
39 |
/**
|
40 |
* Add mapping from action-name to handler function.
|
40 |
* Add mapping from service+action-name to handler function.
|
41 |
*/
|
41 |
*/
|
42 |
void addActionMapping(const std::string& actName, soapfun fun);
|
42 |
void addActionMapping(const UpnpService*,
|
|
|
43 |
const std::string& actName, soapfun);
|
43 |
|
44 |
|
44 |
/**
|
45 |
/**
|
45 |
* Generate event.
|
46 |
* Generate event.
|
46 |
*
|
47 |
*
|
47 |
* To be called by the device layer when data changes and an
|
48 |
* To be called by the device layer when data changes and an
|
|
... |
|
... |
102 |
* services will need full access to the device state anyway.
|
103 |
* services will need full access to the device state anyway.
|
103 |
*/
|
104 |
*/
|
104 |
class UpnpService {
|
105 |
class UpnpService {
|
105 |
public:
|
106 |
public:
|
106 |
UpnpService(const std::string& stp,const std::string& sid, UpnpDevice *dev)
|
107 |
UpnpService(const std::string& stp,const std::string& sid, UpnpDevice *dev)
|
107 |
: m_serviceType(stp)
|
108 |
: m_serviceType(stp), m_serviceId(sid)
|
108 |
{
|
109 |
{
|
109 |
dev->addService(this, sid);
|
110 |
dev->addService(this, sid);
|
110 |
}
|
111 |
}
|
111 |
virtual ~UpnpService() {}
|
112 |
virtual ~UpnpService() {}
|
112 |
|
113 |
|
|
... |
|
... |
126 |
|
127 |
|
127 |
virtual const std::string& getServiceType() const
|
128 |
virtual const std::string& getServiceType() const
|
128 |
{
|
129 |
{
|
129 |
return m_serviceType;
|
130 |
return m_serviceType;
|
130 |
}
|
131 |
}
|
|
|
132 |
virtual const std::string& getServiceId() const
|
|
|
133 |
{
|
|
|
134 |
return m_serviceId;
|
|
|
135 |
}
|
131 |
|
136 |
|
132 |
protected:
|
137 |
protected:
|
133 |
const std::string m_serviceType;
|
138 |
const std::string m_serviceType;
|
|
|
139 |
const std::string m_serviceId;
|
134 |
};
|
140 |
};
|
135 |
|
141 |
|
136 |
#endif /* _DEVICE_H_X_INCLUDED_ */
|
142 |
#endif /* _DEVICE_H_X_INCLUDED_ */
|