File Information
Library: IoT/DeviceStatus
Package: Generated
Header: IoT/DeviceStatus/DeviceStatusServiceRemoteObject.h
Description
The DeviceStatusService keeps track of the current operational status of a device.
Inheritance
Direct Base Classes: IDeviceStatusService, Poco::RemotingNG::RemoteObject
All Base Classes: IDeviceStatusService, Poco::OSP::Service, Poco::RefCountedObject, Poco::RemotingNG::Identifiable, Poco::RemotingNG::RemoteObject
Member Summary
Member Functions: acknowledge, acknowledgeUpTo, clearStatus, clearStatusOfSource, event__statusChanged, event__statusUpdated, messages, postStatus, postStatusAsync, remoting__enableEvents, remoting__enableRemoteEvents, remoting__hasEvents, remoting__typeId, remove, reset, status, statusOfSource
Inherited Functions: acknowledge, acknowledgeUpTo, clearStatus, clearStatusOfSource, duplicate, isA, messages, mutex, postStatus, postStatusAsync, referenceCount, release, remoting__enableEvents, remoting__enableRemoteEvents, remoting__getURI, remoting__hasEvents, remoting__objectId, remoting__setURI, remoting__typeId, remove, reset, status, statusOfSource, type
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < DeviceStatusServiceRemoteObject >;
Constructors
DeviceStatusServiceRemoteObject
DeviceStatusServiceRemoteObject(
const Poco::RemotingNG::Identifiable::ObjectId & oid,
Poco::SharedPtr < IoT::DeviceStatus::DeviceStatusService > pServiceObject
);
Creates a DeviceStatusServiceRemoteObject.
Destructor
~DeviceStatusServiceRemoteObject
virtual ~DeviceStatusServiceRemoteObject();
Destroys the DeviceStatusServiceRemoteObject.
Member Functions
acknowledge
IoT::DeviceStatus::DeviceStatus acknowledge(
Poco::Int64 id
);
Marks the message with the given ID as acknowledged, if it is acknowledgeable.
Returns the new device status.
acknowledgeUpTo
IoT::DeviceStatus::DeviceStatus acknowledgeUpTo(
Poco::Int64 id
);
Marks all acknowledgeable messages up to (and including) the given ID as acknowledged.
Returns the new device status.
clearStatus
IoT::DeviceStatus::DeviceStatus clearStatus(
const std::string & messageClass
);
Clears the status update with the given messageClass and removes it from the message history.
Returns the new device status.
clearStatusOfSource
IoT::DeviceStatus::DeviceStatus clearStatusOfSource(
const std::string & source
);
Clears all status updates with the given source and removes them from the message history.
Returns the new device status.
messages
std::vector < IoT::DeviceStatus::StatusMessage > messages(
int maxMessages = int (0)
) const;
Retrieves stored status messages. If maxMessages is > 0, will at most return maxMessages messages.
postStatus
IoT::DeviceStatus::DeviceStatusChange postStatus(
const IoT::DeviceStatus::StatusUpdate & statusUpdate
);
Updates the device status.
Returns a DeviceStatusChange structure.
postStatusAsync
virtual void postStatusAsync(
const IoT::DeviceStatus::StatusUpdate & statusUpdate
);
Updates the device status asynchronously.
The actual status update in the database will be done asynchronously in a separate thread.
remoting__enableEvents
virtual std::string remoting__enableEvents(
Poco::RemotingNG::Listener::Ptr pListener,
bool enable = bool (true)
);
remoting__enableRemoteEvents
virtual void remoting__enableRemoteEvents(
const std::string & protocol
);
remoting__hasEvents
virtual bool remoting__hasEvents() const;
remoting__typeId
virtual const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId() const;
remove
IoT::DeviceStatus::DeviceStatus remove(
Poco::Int64 id
);
Removes the message with the given ID from the message history.
Returns the new device status.
reset
virtual void reset();
Resets the device status to DEVICE_STATUS_OK and removes all messages.
status
IoT::DeviceStatus::DeviceStatus status() const;
Returns the current global device status.
Only unacknowledged status updates are considered in determining the current status.
statusOfSource
IoT::DeviceStatus::DeviceStatus statusOfSource(
const std::string & source
) const;
Returns the current source-specific device status, considering only status updates with the given source.
Only unacknowledged status updates are considered in determining the current status.
event__statusChanged
void event__statusChanged(
const IoT::DeviceStatus::DeviceStatusChange & data
);
event__statusUpdated
void event__statusUpdated(
const IoT::DeviceStatus::DeviceStatusChange & data
);