Poco::OSP

class Service

File Information

Library: OSP
Package: Service
Header: Poco/OSP/Service.h

Description

This is the base class for all services registered with the ServiceRegistry.

All subclasses of Service must override the type() and isA() member functions.

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Known Derived Classes: IoT::S7PLC::IS7PLCClient, IoT::Settings::SettingsServiceRemoteObject, IoT::MQTT::IMQTTClient, IoT::S7PLC::S7PLCClientRemoteObject, IoT::XBee::XBeeNodeRemoteObject, IoT::DeviceStatus::IDeviceStatusService, IoT::Mailer::MailerServiceRemoteObject, IoT::SMS::ShortMessageServiceRemoteObject, IoT::Settings::ISettingsService, IoT::XBee::IXBeeNode, IoT::Modbus::IModbusMaster, IoT::WebEvent::IWebEventNotifier, IoT::BtLE::PeripheralBrowserRemoteObject, IoT::CANopen::Node, IoT::MQTT::MQTTClientRemoteObject, IoT::Modbus::ModbusMasterRemoteObject, IoT::OPC::OPCClientRemoteObject, IoT::BtLE::IPeripheral, IoT::OPC::IOPCClient, IoT::UDP::IUDPEndpoint, IoT::Mailer::IMailerService, IoT::NetworkEnvironment::INetworkEnvironmentService, IoT::NetworkEnvironment::NetworkEnvironmentServiceRemoteObject, IoT::SMS::IShortMessageService, IoT::BtLE::IPeripheralBrowser, IoT::BtLE::IPeripheralManager, IoT::BtLE::PeripheralRemoteObject, IoT::CAN::CANEndpointRemoteObject, IoT::MobileConnection::IMobileConnectionService, Poco::OSP::WebEvent::WebEventService, Poco::OSP::Auth::TwoFactor::TwoFactorService, Poco::OSP::Mail::MailDeliveryService, Poco::OSP::Auth::Data::AuthAdminServiceImpl, Poco::OSP::Auth::AuthAdminService, Poco::OSP::WebEvent::WebEventServiceImpl, Poco::OSP::Auth::AbstractLDAPAuthAdminService, Poco::OSP::Web::WebSessionStore, BundleInstallerService, Poco::OSP::Auth::TwoFactor::TwoFactorServiceImpl, Poco::OSP::Mail::MailDeliveryServiceImpl, Poco::OSP::Web::WebServerDispatcher, Poco::OSP::Auth::AuthService, IoT::BtLE::PeripheralFactory, IoT::BtLE::PeripheralManagerRemoteObject, IoT::CAN::ICANEndpoint, IoT::DeviceStatus::DeviceStatusServiceRemoteObject, Poco::OSP::Web::MediaTypeMapper, Poco::OSP::Web::TokenValidator, Poco::OSP::Web::WebServerService, Poco::OSP::Web::WebSessionService, PreferencesService, ExtensionPointService, ServiceFactory, IoT::CANopen::NodeImpl, IoT::UDP::UDPEndpointRemoteObject, IoT::MobileConnection::MobileConnectionServiceRemoteObject, IoT::WebEvent::WebEventNotifierRemoteObject, IoT::Devices::CounterRemoteObject, IoT::Devices::CompositeRemoteObject, IoT::Devices::IFlagsDatapoint, IoT::Devices::IDeviceTree, IoT::Devices::ILED, IoT::Devices::SensorRemoteObject, IoT::Devices::BarcodeReaderRemoteObject, IoT::Devices::BooleanDatapointRemoteObject, IoT::Devices::BooleanSensorRemoteObject, IoT::Devices::DeviceTreeRemoteObject, IoT::Devices::FlagsDatapointRemoteObject, IoT::Devices::ICounterDatapoint, IoT::Devices::IGyroscope, IoT::Devices::ISerialDevice, IoT::Devices::IRotaryEncoder, IoT::Devices::LEDRemoteObject, IoT::Devices::VectorDatapointRemoteObject, IoT::Devices::IBooleanDatapoint, IoT::Devices::IDatapoint, IoT::Devices::IORemoteObject, IoT::Devices::MagnetometerRemoteObject, IoT::Devices::RotaryEncoderRemoteObject, IoT::Devices::SerialDeviceRemoteObject, IoT::Devices::TriggerRemoteObject, IoT::Devices::DeviceRemoteObject, IoT::Devices::ISwitch, IoT::Devices::ISensor, IoT::Devices::EnumDatapointRemoteObject, IoT::Devices::IIO, IoT::Devices::ScalarDatapointRemoteObject, Poco::OSP::Auth::PooledAuthAdminService, IoT::Devices::CameraRemoteObject, IoT::Devices::CounterDatapointRemoteObject, IoT::Devices::DatapointRemoteObject, IoT::Devices::GNSSSensorRemoteObject, IoT::Devices::IBarcodeReader, IoT::Devices::IComposite, IoT::Devices::ICounter, IoT::Devices::IVectorDatapoint, IoT::Devices::IGNSSSensor, IoT::Devices::IScalarDatapoint, IoT::Devices::IStringDatapoint, IoT::Devices::SwitchRemoteObject, IoT::Datapoints::DatapointFactoryRemoteObject, IoT::Datapoints::IDatapointFactory, IoT::Devices::AccelerometerRemoteObject, IoT::Devices::GyroscopeRemoteObject, IoT::Devices::IAccelerometer, IoT::Devices::IBooleanSensor, IoT::Devices::ICamera, IoT::Devices::IDevice, IoT::Devices::IEnumDatapoint, IoT::Devices::IMagnetometer, IoT::Devices::ITrigger, IoT::Devices::StringDatapointRemoteObject

Member Summary

Member Functions: isA, type

Inherited Functions: duplicate, referenceCount, release

Types Aliases

ConstPtr

using ConstPtr = const Ptr;

Ptr

using Ptr = Poco::AutoPtr < Service >;

Constructors

Service protected

Service();

Creates the Service.

Destructor

~Service protected virtual

~Service();

Destroys the Service.

Member Functions

isA virtual

virtual bool isA(
    const std::type_info & otherType
) const;

Returns true if the class is a subclass of the class given by type. Comparison must always be done by type name, not by simply comparing std::type_info object references.

Subclasses must override this member function.

The implementation of isA() is always as follows:

bool MyService::isA(const std::type_info& otherType) const
{
    std::string name(typeid(MyService).name());
    return name == otherType.name() || MyBaseClass::isA(otherType);
}

type virtual

virtual const std::type_info & type() const;

Returns the type information for the object's class.

Subclasses must override this member function.

The implementation of isA() is usually as follows:

const std::type_info& MyService::type() const
{
    return typeid(MyService);
}

If a service class implements a service interface, the type information for the interface class should be returned instead:

const std::type_info& MyServiceImpl::type() const
{
    return typeid(MyService);
}
Securely control IoT edge devices from anywhere   Connect a Device