Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

acsexmplLampWheelImpl.h

Go to the documentation of this file.
00001 #ifndef acsexmplLampWheelImpl_h
00002 #define acsexmplLampWheelImpl_h
00003 /*******************************************************************************
00004 *    ALMA - Atacama Large Millimiter Array
00005 *    (c) European Southern Observatory, 2002
00006 *    Copyright by ESO (in the framework of the ALMA collaboration)
00007 *    and Cosylab 2002, All rights reserved
00008 *
00009 *    This library is free software; you can redistribute it and/or
00010 *    modify it under the terms of the GNU Lesser General Public
00011 *    License as published by the Free Software Foundation; either
00012 *    version 2.1 of the License, or (at your option) any later version.
00013 *
00014 *    This library is distributed in the hope that it will be useful,
00015 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 *    Lesser General Public License for more details.
00018 *
00019 *    You should have received a copy of the GNU Lesser General Public
00020 *    License along with this library; if not, write to the Free Software
00021 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00022 *
00023 * "@(#) $Id: acsexmplLampWheelImpl.h,v 1.12 2006/04/20 08:47:59 bjeram Exp $"
00024 *
00025 * who       when      what
00026 * --------  --------  ----------------------------------------------
00027 * acaproni 20041124   Created
00028 */
00029 
00030 #ifndef __cplusplus
00031 #error This is a C++ include file and cannot be used from plain C
00032 #endif
00033 
00034 #include <baciCharacteristicComponentImpl.h>
00035 #include <acsexmplExport.h>
00036 #include <acsexmplLampWheelS.h>
00037 
00038 #include <baciROdouble.h>
00039 #include <baciROlong.h>
00040 #include <baciROstring.h>
00041 
00043 #include <baciSmartPropertyPointer.h>
00044 
00045 #include <expat.h>
00046 #include <list>
00047 
00048 using namespace baci;
00049 
00051 typedef struct {
00052     unsigned int num; // The number of the slot
00053     char lampName[128]; // The name of the lamp in the slot
00054     unsigned int warmUpTime; // The warm-up time
00055     unsigned int watt; // The watt of the lamp 
00056     unsigned int pos; // The position in the lamp (step)
00057 } SlotDescriptor;
00058 
00113 class acsexmpl_EXPORT LampWheel: public CharacteristicComponentImpl,//Standard component superclass
00114             public virtual POA_acsexmplLampWheel::LampWheel,//CORBA servant stub
00115             public ActionImplementator //Asynchronous method helper class
00116 {
00117   public:
00124     LampWheel(
00125               const ACE_CString& name,
00126               maci::ContainerServices * containerServices);
00127     
00131     virtual ~LampWheel();
00132 
00133     /* --------------------- [ Life cycle methods ] -------------------- */
00134 
00160     virtual void initialize()
00161         throw (ACSErr::ACSbaseExImpl);
00162 
00185     virtual void execute()
00186         throw (ACSErr::ACSbaseExImpl);
00187 
00212     virtual void cleanUp();
00213 
00237     virtual void aboutToAbort();
00238    
00239     /* --------------- [ Action implementator interface ] -------------- */    
00263     virtual ActionRequest
00264     invokeAction (int function,
00265                   BACIComponent *cob_p, 
00266                   const int &callbackID,
00267                   const CBDescIn &descIn,
00268                   BACIValue *value_p,
00269                   Completion &completion,
00270                   CBDescOut &descOut);
00271 
00294     virtual ActionRequest 
00295     moveAction (BACIComponent *cob_p, 
00296                const int &callbackID,
00297                const CBDescIn &descIn, 
00298                BACIValue *value_p,
00299                Completion &completion, 
00300                CBDescOut &descOut);    
00301     /* --------------------- [ CORBA interface ] ----------------------*/
00302     
00317         virtual void move(CORBA::Short, ACS::CBvoid_ptr,
00318                 const ACS::CBDescIn&) throw (CORBA::SystemException);
00319 
00327     virtual ACS::ROdouble_ptr position ()
00328         throw (CORBA::SystemException); 
00329     
00337     virtual ACS::ROstring_ptr desc ()
00338         throw (CORBA::SystemException);
00339 
00347     virtual ACS::ROlong_ptr slots ()
00348         throw (CORBA::SystemException);
00349 
00350   private:
00351 
00352     // The name of the component with the alma/ prefix
00353     // We need the name to access the CDB
00354     ACE_CString m_fullName;
00355 
00356     
00360      SmartPropertyPointer<ROdouble> m_position_sp;
00361 
00365      SmartPropertyPointer<ROstring> m_desc_sp;
00366 
00371     SmartPropertyPointer<ROlong>m_slots_sp;
00372 
00378     std::list<SlotDescriptor> m_lampWheelConfiguration;
00379 
00383     void operator=(const LampWheel&);
00384 
00392     int retrieveConfigurationFromCDB(std::list<SlotDescriptor>& config);
00393 
00399     static void start_hndl(void *data, const XML_Char *el, const XML_Char **attr);
00400 
00406     static void end_hndl(void *data, const XML_Char *el);
00407     
00413     static void char_hndl(void *data, const XML_Char *s, int len);
00414 
00415 };
00416 
00417 #endif   /* acsexmplLampWheelImpl_h */
00418 
00419 
00420 

Generated on Sun Oct 29 02:26:25 2006 for ACS C++ API by doxygen 1.3.6