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
00059 using namespace baci;
00060
00064 class Door;
00065
00066
00067
00068
00069 class DoorThread : public ACS::Thread
00070 {
00071 public:
00072
00073 DoorThread(const ACE_CString &name, Door * door_ptr,
00074 const ACS::TimeInterval& responseTime=ThreadBase::defaultResponseTime,
00075 const ACS::TimeInterval& sleepTime=ThreadBase::defaultSleepTime) :
00076 ACS::Thread(name)
00077 {
00078 door_p = door_ptr;
00079 }
00080
00081 ~DoorThread()
00082 {
00083 ACS_TRACE("DoorThread::~DoorThread");
00084 }
00085
00086 virtual void onStart();
00087
00088 virtual void runLoop();
00089
00090 virtual void onStop();
00091
00092 private:
00093 Door * door_p;
00094 };
00095
00147 class Door: public CharacteristicComponentImpl,
00148 public virtual POA_acsexmplBuilding::Door,
00149 public ActionImplementator
00150 {
00151 friend void DoorThread::runLoop();
00152
00153 public:
00159 Door(
00160 const ACE_CString& name,
00161 maci::ContainerServices * containerServices);
00162
00166 virtual ~Door();
00167
00168
00192 virtual ActionRequest
00193 invokeAction (int function,
00194 BACIComponent *component_p,
00195 const int &callbackID,
00196 const CBDescIn &descIn,
00197 BACIValue *value_p,
00198 Completion &completion,
00199 CBDescOut &descOut);
00200
00223 virtual ActionRequest
00224 openAction (BACIComponent *component_p,
00225 const int &callbackID,
00226 const CBDescIn &descIn,
00227 BACIValue *value_p,
00228 Completion &completion,
00229 CBDescOut &descOut);
00230
00253 virtual ActionRequest
00254 closeAction (BACIComponent *component_p,
00255 const int &callbackID,
00256 const CBDescIn &descIn,
00257 BACIValue *value_p,
00258 Completion &completion,
00259 CBDescOut &descOut);
00260
00261
00262
00277 virtual void
00278 open (ACS::CBvoid_ptr cb,
00279 const ACS::CBDescIn &desc)
00280 throw (CORBA::SystemException);
00281
00296 virtual void
00297 close (ACS::CBvoid_ptr cb,
00298 const ACS::CBDescIn &desc)
00299 throw (CORBA::SystemException);
00300
00312 virtual void
00313 move (CORBA::Double pos)
00314 throw (CORBA::SystemException);
00315
00324 virtual ACS::ROdouble_ptr
00325 position ()
00326 throw (CORBA::SystemException);
00327
00336 virtual ACS::RWdouble_ptr
00337 ref_position ()
00338 throw (CORBA::SystemException);
00339
00348 virtual ACS::ROlong_ptr
00349 substate ()
00350 throw (CORBA::SystemException);
00351
00360 virtual ACS::ROstring_ptr
00361 version ()
00362 throw (CORBA::SystemException);
00363
00364
00377 virtual void execute()
00378 throw (ACSErr::ACSbaseExImpl);
00379
00380 private:
00392 virtual void
00393 checkSubstate(CompletionImpl *&error_p);
00394
00398 SmartPropertyPointer<RWdouble> m_ref_position_sp;
00399
00403 SmartPropertyPointer<ROdouble> m_position_sp;
00404
00409 SmartPropertyPointer<ROlong> m_substate_sp;
00410
00414 SmartPropertyPointer<ROstring> m_version_sp;
00415
00416
00417
00418
00419 DoorThread * m_doorThread_p;
00420
00424 void operator=(const Door&);
00425 };
00426
00427 #endif
00428
00429
00430