You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 5
Next »
Component IDL
#ifndef _ASYNC_IDL_
#define _ASYNC_IDL_
#pragma prefix "acs"
#include <acscommon.idl>
#include <acscomponent.idl>
module examples
{
interface MyCallback: ACS::OffShoot {
void update(in string text);
};
interface Async : ACS::ACSComponent {
oneway void delayResult(in ACS::uLong delay, in MyCallback cb);
};
};
#endif
Component Implementation
C++
#ifndef _ASYNC_IMPL_H
#define _ASYNC_IMPL_H
#include <acscomponentImpl.h>
#include <AsyncS.h>
class AsyncImpl : public virtual acscomponent::ACSComponentImpl, public virtual POA_workshop::Async
{
public:
AsyncImpl(const ACE_CString& name, maci::ContainerServices* containerServices);
virtual ~AsyncImpl();
void delayResult(ACS::uLong delay, acs::examples::MyCallback_ptr cb);
};
#endif
#include <AsyncImpl.h>
#include <ACSErrTypeOK.h>
AsyncImpl::AsyncImpl(const ACE_CString& name, maci::ContainerServices* containerServices) : acscomponent::ACSComponentImpl(name, containerServices) {
}
AsyncImpl::~AsyncImpl() {
}
void AsyncImpl::delayResult(ACS::uLong delay, acs::examples::MyCallback_ptr cb) {
cb->update("Working");
sleep(delay);
cb->update("Done");
}
/* --------------- [ MACI DLL support functions ] -----------------*/
#include <maciACSComponentDefines.h>
MACI_DLL_SUPPORT_FUNCTIONS(AsyncImpl)
/* ----------------------------------------------------------------*/
Configuration
<e Name="ASYNC"
Code="AsyncImpl"
Type="IDL:alma/workshop/Async:1.0"
Container="bilboContainer"
ImplLang="cpp"
KeepAliveTime="0"
/>
Standalone Client
Component Client