Poco::RemotingNG

class Skeleton

Library: RemotingNG
Package: ORB
Header: Poco/RemotingNG/Skeleton.h

Description

A Skeleton is responsible for demultiplexing incoming requests to the correct service object method, using MethodHandler objects.

Inheritance

Direct Base Classes: AttributedObject, Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject, AttributedObject

Known Derived Classes: IoT::Devices::BarcodeReaderSkeleton, IoT::Devices::GNSSSensorSkeleton, IoT::Devices::RotaryEncoderSkeleton, IoT::Devices::BooleanSensorSkeleton, IoT::Devices::AccelerometerSkeleton, IoT::Devices::CameraSkeleton, IoT::Devices::LEDSkeleton, IoT::Devices::SerialDeviceSkeleton, IoT::Devices::MagnetometerSkeleton, IoT::Devices::TriggerSkeleton, IoT::Devices::CounterSkeleton, IoT::Devices::IOSkeleton, IoT::Devices::DeviceSkeleton, IoT::Devices::SensorSkeleton, IoT::Devices::GyroscopeSkeleton, IoT::Devices::SwitchSkeleton, EventSubscriber, IoT::CAN::CANEndpointSkeleton, IoT::Modbus::ModbusMasterSkeleton, IoT::BtLE::PeripheralSkeleton, IoT::UDP::UDPEndpointSkeleton, IoT::BtLE::PeripheralBrowserSkeleton, IoT::MQTT::MQTTClientSkeleton, IoT::S7PLC::S7PLCClientSkeleton, IoT::DeviceStatus::DeviceStatusServiceSkeleton, IoT::OPC::OPCClientSkeleton, IoT::NetworkEnvironment::NetworkEnvironmentServiceSkeleton, IoT::WebEvent::WebEventNotifierSkeleton, IoT::XBee::XBeeNodeSkeleton, IoT::MobileConnection::MobileConnectionServiceSkeleton

Member Summary

Member Functions: addMethodHandler, invoke

Inherited Functions: clearAttributes, countAttributes, duplicate, enumerateAttributes, getAttribute, hasAttribute, operator =, referenceCount, release, removeAttribute, setAttribute

Types Aliases

MethodHandlers

using MethodHandlers = std::map < std::string, MethodHandler::Ptr >;

Ptr

using Ptr = Poco::AutoPtr < Skeleton >;

Constructors

Skeleton

Skeleton();

Creates a Skeleton.

Destructor

~Skeleton virtual

virtual ~Skeleton();

Destroys the Skeleton.

Member Functions

invoke

bool invoke(
    ServerTransport & transport,
    RemoteObject::Ptr pRemoteObject
);

Invoke a method on the RemoteObject.

First, obtains a Deserializer from the given ServerTransport by calling beginRequest(). Then, determines the method name from the request (by calling Deserializer::findMessage()), obtains the MethodHandler for the method and invokes the method using the MethodHandler.

If no MethodHandler is found, a MethodNotFoundException is sent back to the client. If the type of the received message is neither MESSAGE_REQUEST nor MESSAGE_EVENT, a UnexpectedMessageException will be thrown.

After processing the request, endRequest() is called on the ServerTransport.

Returns true if the method was found, false otherwise.

addMethodHandler protected

void addMethodHandler(
    const std::string & name,
    MethodHandler::Ptr pMethodHandler
);

Adds a MethodHandler for the service object's method with the given name to the Skeleton. Takes ownership of the MethodHandler.

Securely control IoT edge devices from anywhere   Connect a Device