Go to the documentation of this file.00001 #ifndef acsexmplDoorImpl_h
00002 #define acsexmplDoorImpl_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef __cplusplus
00038 #error This is a C++ include file and cannot be used from plain C
00039 #endif
00040
00042 #include <baciCharacteristicComponentImpl.h>
00043
00045 #include <acsexmplBuildingS.h>
00046
00048 #include <baciROdouble.h>
00049 #include <baciRWdouble.h>
00050 #include <baciROlong.h>
00051 #include <baciROstring.h>
00052
00054 #include <baciSmartPropertyPointer.h>
00055
00057 #include <acsThread.h>
00058
00062 class Door;
00063
00064
00065
00066
00067 class DoorThread : public ACS::Thread
00068 {
00069 public:
00070
00071 DoorThread(const ACE_CString &name, Door * door_ptr,
00072 const ACS::TimeInterval& responseTime=ThreadBase::defaultResponseTime,
00073 const ACS::TimeInterval& sleepTime=ThreadBase::defaultSleepTime) :
00074 ACS::Thread(name)
00075 {
00076 door_p = door_ptr;
00077 }
00078
00079 ~DoorThread()
00080 {
00081 ACS_TRACE("DoorThread::~DoorThread");
00082 }
00083
00084 virtual void onStart();
00085
00086 virtual void runLoop();
00087
00088 virtual void onStop();
00089
00090 private:
00091 Door * door_p;
00092 };
00093
00102
00157 class Door: public baci::CharacteristicComponentImpl,
00158 public virtual POA_acsexmplBuilding::Door,
00159 public baci::ActionImplementator
00160 {
00161 friend void DoorThread::runLoop();
00162
00163 public:
00169 Door(
00170 const ACE_CString& name,
00171 maci::ContainerServices * containerServices);
00172
00176 virtual ~Door();
00177
00178
00202 virtual baci::ActionRequest
00203 invokeAction (int function,
00204 baci::BACIComponent *component_p,
00205 const int &callbackID,
00206 const CBDescIn &descIn,
00207 baci::BACIValue *value_p,
00208 Completion &completion,
00209 CBDescOut &descOut);
00210
00233 virtual baci::ActionRequest
00234 openAction (baci::BACIComponent *component_p,
00235 const int &callbackID,
00236 const CBDescIn &descIn,
00237 baci::BACIValue *value_p,
00238 Completion &completion,
00239 CBDescOut &descOut);
00240
00263 virtual baci::ActionRequest
00264 closeAction (baci::BACIComponent *component_p,
00265 const int &callbackID,
00266 const CBDescIn &descIn,
00267 baci::BACIValue *value_p,
00268 Completion &completion,
00269 CBDescOut &descOut);
00270
00271
00272
00287 virtual void
00288 open (ACS::CBvoid_ptr cb,
00289 const ACS::CBDescIn &desc);
00290
00305 virtual void
00306 close (ACS::CBvoid_ptr cb,
00307 const ACS::CBDescIn &desc);
00308
00320 virtual void
00321 move (CORBA::Double pos);
00322
00331 virtual ACS::ROdouble_ptr
00332 position ();
00333
00342 virtual ACS::RWdouble_ptr
00343 ref_position ();
00344
00353 virtual ACS::ROlong_ptr
00354 substate ();
00355
00364 virtual ACS::ROstring_ptr
00365 version ();
00366
00367
00381 virtual void execute();
00382
00383 private:
00395 virtual void
00396 checkSubstate(CompletionImpl *&error_p);
00397
00401 baci::SmartPropertyPointer<baci::RWdouble> m_ref_position_sp;
00402
00406 baci::SmartPropertyPointer<baci::ROdouble> m_position_sp;
00407
00412 baci::SmartPropertyPointer<baci::ROlong> m_substate_sp;
00413
00417 baci::SmartPropertyPointer<baci::ROstring> m_version_sp;
00418
00419
00420
00421
00422 DoorThread * m_doorThread_p;
00423
00427 void operator=(const Door&);
00428 };
00429
00430
00431
00432 #endif
00433
00434
00435