File Information
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: EventSubscriber, IoT::MobileConnection::MobileConnectionServiceSkeleton, IoT::BtLE::PeripheralManagerSkeleton, IoT::UDP::UDPEndpointSkeleton, IoT::XBee::XBeeNodeSkeleton, IoT::BtLE::PeripheralSkeleton, IoT::S7PLC::S7PLCClientSkeleton, IoT::OPC::OPCClientSkeleton, IoT::DeviceStatus::DeviceStatusServiceSkeleton, IoT::Settings::SettingsServiceSkeleton, IoT::WebEvent::WebEventNotifierSkeleton, IoT::BtLE::PeripheralBrowserSkeleton, IoT::CAN::CANEndpointSkeleton, IoT::Mailer::MailerServiceSkeleton, IoT::SMS::ShortMessageServiceSkeleton, IoT::MQTT::MQTTClientSkeleton, IoT::Modbus::ModbusMasterSkeleton, IoT::NetworkEnvironment::NetworkEnvironmentServiceSkeleton, IoT::Devices::RotaryEncoderSkeleton, IoT::Devices::DatapointSkeleton, IoT::Devices::DeviceTreeSkeleton, IoT::Devices::GNSSSensorSkeleton, IoT::Devices::IOSkeleton, IoT::Devices::LEDSkeleton, IoT::Devices::CameraSkeleton, IoT::Devices::CounterDatapointSkeleton, IoT::Devices::MagnetometerSkeleton, IoT::Devices::StringDatapointSkeleton, IoT::Devices::SwitchSkeleton, IoT::Devices::AccelerometerSkeleton, IoT::Devices::CompositeSkeleton, IoT::Devices::ScalarDatapointSkeleton, IoT::Datapoints::DatapointFactorySkeleton, IoT::Devices::BooleanDatapointSkeleton, IoT::Devices::SensorSkeleton, IoT::Devices::SerialDeviceSkeleton, IoT::Devices::TriggerSkeleton, IoT::Devices::VectorDatapointSkeleton, IoT::Devices::CounterSkeleton, IoT::Devices::DeviceSkeleton, IoT::Devices::EnumDatapointSkeleton, IoT::Devices::GyroscopeSkeleton, IoT::Devices::BarcodeReaderSkeleton, IoT::Devices::BooleanSensorSkeleton, IoT::Devices::FlagsDatapointSkeleton
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 ~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
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.