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

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