00001 /* 00002 * Copyright (C) 2004 Andrew Sutton 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to: 00016 * 00017 * The Free Software Foundation, Inc. 00018 * 59 Temple Place, Suite 330 00019 * Boston, MA 02111-1307 USA 00020 * 00021 * Contact: 00022 * Andrew Sutton asutton@cs.kent.edu 00023 */ 00024 00025 #ifndef UML_ELEMENTRESIDENCE_HPP 00026 #define UML_ELEMENTRESIDENCE_HPP 00027 00028 #include <OMF/ModelObject.hpp> 00029 00030 #include <UML/UMLPackage.hpp> 00031 #include <UML/VisibilityKind.hpp> 00032 00033 namespace UML 00034 { 00035 // forward declarations 00036 class ElementResidence; 00037 class ElementResidenceImpl; 00038 class ModelElement; 00039 class Component; 00040 00041 class ElementResidence : virtual public OMF::ModelObject 00042 { 00043 public: 00044 typedef OMF::BasicClass<ElementResidenceImpl> Proxy; 00045 00046 ElementResidence(); 00047 virtual ~ElementResidence(); 00048 00049 const VisibilityKind &visibility() const; 00050 void setVisibility(const VisibilityKind &value); 00051 void clearVisibility(); 00052 00053 ModelElement *resident(); 00054 void setResident(ModelElement *value); 00055 void clearResident(); 00056 00057 Component *container(); 00058 void setContainer(Component *value); 00059 void clearContainer(); 00060 00061 private: 00062 VisibilityKind _visibility; 00063 ModelElement *_resident; 00064 Component *_container; 00065 }; 00066 00067 00068 struct ElementResidenceImpl : virtual public UML::ElementResidence 00069 { 00070 ElementResidenceImpl() : 00071 OMF::ModelObject( 00072 "UML.ElementResidence", 00073 &ElementResidence::Proxy::instance(), 00074 &UMLPackage::instance()), 00075 ElementResidence() 00076 {} 00077 00078 virtual ~ElementResidenceImpl() 00079 {} 00080 }; 00081 } 00082 00083 #endif