00001 /* 00002 * The information in this file is 00003 * Copyright(c) 2007 Ball Aerospace & Technologies Corporation 00004 * and is subject to the terms and conditions of the 00005 * GNU Lesser General Public License Version 2.1 00006 * The license text is available from 00007 * http://www.gnu.org/licenses/lgpl.html 00008 */ 00009 00010 #ifndef SUBJECTADAPTER_H 00011 #define SUBJECTADAPTER_H 00012 00013 #include "Subject.h" 00014 #include "SubjectImp.h" 00015 00016 #include <string> 00017 00018 /** 00019 * Implementation of the interface for generalized registration of 00020 * objects intereseted in mutations of the subclasses of this interface. 00021 */ 00022 class SubjectAdapter : public Subject, public SubjectImp SUBJECTADAPTEREXTENSION_CLASSES 00023 { 00024 public: 00025 /** 00026 * Inherited obligation from TypeAwareObject. Allow observers to 00027 * determine the type of mutating object notifying them. 00028 * 00029 * @return The name of the subclass of this interface. 00030 */ 00031 virtual const std::string& getObjectType() const; 00032 00033 /** 00034 * Inherited obligation from TypeAwareObject. Allow observers to 00035 * determine the type of mutating object notifying them. 00036 * 00037 * @param name 00038 * Name of the class which is being inquired about. 00039 * 00040 * @return True if the subclass matches of this interface matches or 00041 * is a parent of the class identified in the argument. 00042 */ 00043 virtual bool isKindOf(const std::string& name) const; 00044 00045 SUBJECTADAPTER_METHODS(SubjectImp) 00046 }; 00047 00048 #endif