Information
We are currently investigating an issue with the editor of some pages. Please save your work and avoid to create new pages until this banner is gone.
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#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::CBuLong_ptr cb, const ACS::CBDescIn& desc); }; #endif |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#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::CBuLong_ptr cb, const ACS::CBDescIn& desc) { ACSErr::Completion completion; ACS::CBDescOut descOut; completion = ACSErrTypeOK::ACSErrOKCompletion(); cb->working(0, completion, descOut); sleep(delay); cb->done(delay, completion, descOut); } /* --------------- [ MACI DLL support functions ] -----------------*/ #include <maciACSComponentDefines.h> MACI_DLL_SUPPORT_FUNCTIONS(AsyncImpl) /* ----------------------------------------------------------------*/ |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<e Name="ASYNC" Code="asyncImplAsyncImpl" Type="IDL:alma/workshop/Async:1.0" Container="bilboContainer" ImplLang="cpp" KeepAliveTime="0" /> |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
import ACS import time from Acspy.Common.Callbacks import CBuLongCBuLongLong from Acspy.Clients.SimpleClient import PySimpleClient client = PySimpleClient() comp = client.getComponent('ASYNC') cb = CBuLongCBuLongLong() cbObj = client.activateOffShoot(cb) desc = ACS.CBDescIn(0, 0, 0) print(cb.status) comp.delayResult(8, cbObj, desc) print(cb.status) time.sleep(5) print(cb.status) time.sleep(5) print(cb.status) print(cb.values) client.releaseComponent(comp.name) client.disconnect() |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#Component IDL IDL_FILES_L = Async AsyncStubs_LIBS = acscomponentStubs acscommonStubs #C++ Component LIBRARIES_L = AsyncImpl AsyncImpl_OBJECTS = AsyncImpl AsyncImpl_LIBS = AsyncStubs acscomponent #C++ Client EXECUTABLES_L = AsyncExample AsyncExample_OBJECTS = AsyncClient AsyncExample_LIBS = maciClient AsyncStubs #Java Client JARFILES_L = AsyncJar AsyncJar_DIRS = workshop #Python Client PY_SCRIPTS_L = AsyncClient |
...