ALMA Computing Group

acsexmplCalendarImpl.cpp

Go to the documentation of this file.
00001 /******************************************************************************* 00002 * ALMA - Atacama Large Millimiter Array 00003 * (c) European Southern Observatory, 2002 00004 * Copyright by ESO (in the framework of the ALMA collaboration) 00005 * and Cosylab 2002, All rights reserved 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 * 00021 * 00022 * 00023 * "@(#) $Id: acsexmplCalendarImpl.cpp,v 1.100 2008/10/01 04:30:47 cparedes Exp $" 00024 * 00025 * who when what 00026 * -------- -------- ---------------------------------------------- 00027 * acaproni 2004-04-06 Use smart pointers for properties 00028 * msekoran 2002-07-05 created 00029 */ 00030 00031 #include <acsexmplCalendarImpl.h> 00032 00033 ACE_RCSID(acsxmpl, acsexmplCalendarImpl, "$Id: acsexmplCalendarImpl.cpp,v 1.100 2008/10/01 04:30:47 cparedes Exp $") 00034 00035 using namespace baci; 00036 00038 // Calendar 00040 Calendar::Calendar(const ACE_CString &name, 00041 maci::ContainerServices * containerServices) : 00042 CharacteristicComponentImpl(name,containerServices), 00043 m_yearAttributes_sp(new RWpattern(name+":yearAttributes", getComponent()),this), 00044 m_day_sp(new RWEnumImpl<ACS_ENUM_T(acsexmplCalendar::DaysEnum), POA_acsexmplCalendar::RWDaysEnum> (name+":day", getComponent()),this), 00045 m_month_sp(new RWEnumImpl<ACS_ENUM_T(acsexmplCalendar::MonthEnum), POA_acsexmplCalendar::RWMonthEnum> (name+":month", getComponent()),this), 00046 m_state_sp(new ROEnumImpl<ACS_ENUM_T(acsexmplCalendar::StateEnum), POA_acsexmplCalendar::ROStateEnum> (name+":state", getComponent()),this) 00047 { 00048 ACS_TRACE("::Calendar::Calendar"); 00049 00050 } 00051 00052 Calendar::~Calendar() 00053 { 00054 ACS_TRACE("::Calendar::~Calendar"); 00055 } 00056 00057 /* --------------------- [ CORBA interface ] ----------------------*/ 00058 ::acsexmplCalendar::RWDaysEnum_ptr 00059 Calendar::day () 00060 { 00061 if (m_day_sp == 0) 00062 { 00063 return ::acsexmplCalendar::RWDaysEnum::_nil(); 00064 } 00065 00066 ::acsexmplCalendar::RWDaysEnum_var prop = ::acsexmplCalendar::RWDaysEnum::_narrow(m_day_sp->getCORBAReference()); 00067 return prop._retn(); 00068 } 00069 00070 ::acsexmplCalendar::RWMonthEnum_ptr 00071 Calendar::month () 00072 { 00073 if (m_month_sp == 0) 00074 { 00075 return ::acsexmplCalendar::RWMonthEnum::_nil(); 00076 } 00077 00078 ::acsexmplCalendar::RWMonthEnum_var prop = ::acsexmplCalendar::RWMonthEnum::_narrow(m_month_sp->getCORBAReference()); 00079 return prop._retn(); 00080 }; 00081 00082 ::ACS::RWpattern_ptr 00083 Calendar::yearAttributes () 00084 { 00085 if (m_yearAttributes_sp == 0) 00086 { 00087 return ::ACS::RWpattern::_nil(); 00088 } 00089 00090 ::ACS::RWpattern_var prop = ::ACS::RWpattern::_narrow(m_yearAttributes_sp->getCORBAReference()); 00091 return prop._retn(); 00092 } 00093 00094 ::acsexmplCalendar::ROStateEnum_ptr 00095 Calendar::state () 00096 { 00097 if (m_state_sp == 0) 00098 { 00099 return ::acsexmplCalendar::ROStateEnum::_nil(); 00100 } 00101 00102 ::acsexmplCalendar::ROStateEnum_var prop = ::acsexmplCalendar::ROStateEnum::_narrow(m_state_sp->getCORBAReference()); 00103 return prop._retn(); 00104 } 00105 00107 // MACI DLL support functions 00109 #include <maciACSComponentDefines.h> 00110 MACI_DLL_SUPPORT_FUNCTIONS(Calendar) 00111