import marshalling service with deployer object

Hi,

trying to write a typekit test in which to check whether loading /
writing all typekit properties works, I want to load the marshalling
service in my component, but my Deployer component doesn't know the
marshalling service. Further investigation revealed that only the OCL
services (os print Lua) are imported and not the RTT services
(scripting marshalling).
the code basically does:

OCL::DeploymentComponent depl;
ASSERT_TRUE(depl.import("ocl"));
RTT::OperationCaller<bool(std::string)> m_write=
depl.provides("marshalling")->getOperation("writeProperties");

which fails with

0.105 [ Warning][Service::getOperation] No such operation in service
'marshalling': writeProperties

How can I use the marshalling service in this way?

regards,

Steven

import marshalling service with deployer object

On Monday 17 January 2011 11:02:13 Steven Bellens wrote:
> Hi,
>
> trying to write a typekit test in which to check whether loading /
> writing all typekit properties works, I want to load the marshalling
> service in my component, but my Deployer component doesn't know the
> marshalling service. Further investigation revealed that only the OCL
> services (os print Lua) are imported and not the RTT services
> (scripting marshalling).
> the code basically does:
>
> OCL::DeploymentComponent depl;
> ASSERT_TRUE(depl.import("ocl"));
> RTT::OperationCaller<bool(std::string)> m_write=
> depl.provides("marshalling")->getOperation("writeProperties");
>
> which fails with
>
> 0.105 [ Warning][Service::getOperation] No such operation in service
> 'marshalling': writeProperties
>
> How can I use the marshalling service in this way?

Did you use ORO_main()? RTT types/service plugins are only loaded when the
__os_init(argc, argv) function is called.

I also don't know if you can assume that marshalling is loaded into the
deployment component. You'll need to write

Marshalling marsh = depl.getProvider<Marshalling>("marshalling");
// check marsh.ready()

To be sure it's available.

Peter

import marshalling service with deployer object

2011/1/17 Peter Soetens <peter [..] ...>:
> On Monday 17 January 2011 11:02:13 Steven Bellens wrote:
>> Hi,
>>
>> trying to write a typekit test in which to check whether loading /
>> writing all typekit properties works, I want to load the marshalling
>> service in my component, but my Deployer component doesn't know the
>> marshalling service. Further investigation revealed that only the OCL
>> services (os print Lua) are imported and not the RTT services
>> (scripting marshalling).
>> the code basically does:
>>
>> OCL::DeploymentComponent depl;
>> ASSERT_TRUE(depl.import("ocl"));
>> RTT::OperationCaller<bool(std::string)> m_write=
>> depl.provides("marshalling")->getOperation("writeProperties");
>>
>> which fails with
>>
>> 0.105 [ Warning][Service::getOperation] No such operation in service
>> 'marshalling': writeProperties
>>
>> How can I use the marshalling service in this way?
>
> Did you use ORO_main()? RTT types/service plugins are only loaded when the
> __os_init(argc, argv) function is called.

I didn't, and this fixed the issue - now the scripting and marshalling
services are known and I can import them with
depl.loadService("Deployer","marshalling")

>
> I also don't know if you can assume that marshalling is loaded into the
> deployment component. You'll need to write
>
> Marshalling marsh = depl.getProvider<Marshalling>("marshalling");
> // check marsh.ready()

This actually doesn't compile (after adding RTT:: for the namespace):
typekit_test.cpp:93:78: error: conversion from
‘boost::shared_ptr<RTT::Marshalling>’ to non-scalar type
‘RTT::Marshalling’ requested

Steven

>
> To be sure it's available.
>
> Peter
>

import marshalling service with deployer object

On Monday 17 January 2011 11:48:19 Steven Bellens wrote:
> 2011/1/17 Peter Soetens <peter [..] ...>:
> > On Monday 17 January 2011 11:02:13 Steven Bellens wrote:
> >> Hi,
> >>
> >> trying to write a typekit test in which to check whether loading /
> >> writing all typekit properties works, I want to load the marshalling
> >> service in my component, but my Deployer component doesn't know the
> >> marshalling service. Further investigation revealed that only the OCL
> >> services (os print Lua) are imported and not the RTT services
> >> (scripting marshalling).
> >> the code basically does:
> >>
> >> OCL::DeploymentComponent depl;
> >> ASSERT_TRUE(depl.import("ocl"));
> >> RTT::OperationCaller<bool(std::string)> m_write=
> >> depl.provides("marshalling")->getOperation("writeProperties");
> >>
> >> which fails with
> >>
> >> 0.105 [ Warning][Service::getOperation] No such operation in service
> >> 'marshalling': writeProperties
> >>
> >> How can I use the marshalling service in this way?
> >
> > Did you use ORO_main()? RTT types/service plugins are only loaded when
> > the __os_init(argc, argv) function is called.
>
> I didn't, and this fixed the issue - now the scripting and marshalling
> services are known and I can import them with
> depl.loadService("Deployer","marshalling")
>
> > I also don't know if you can assume that marshalling is loaded into the
> > deployment component. You'll need to write
> >
> > Marshalling marsh = depl.getProvider<Marshalling>("marshalling");
> > // check marsh.ready()
>
> This actually doesn't compile (after adding RTT:: for the namespace):
> typekit_test.cpp:93:78: error: conversion from
> ‘boost::shared_ptr<RTT::Marshalling>’ to non-scalar type
> ‘RTT::Marshalling’ requested

Oh yeah, it should have been:

boost::shared_ptr<Marshalling> marsh =
depl.getProvider<Marshalling>("marshalling");
// check marsh.ready()

Peter