00001 /***************** <Tweek heading BEGIN do not edit this line> **************** 00002 * Tweek 00003 * 00004 * ----------------------------------------------------------------- 00005 * File: $RCSfile: SubjectImpl.h,v $ 00006 * Date modified: $Date: 2003/08/03 00:08:28 $ 00007 * Version: $Revision: 1.12 $ 00008 * ----------------------------------------------------------------- 00009 ***************** <Tweek heading END do not edit this line> *****************/ 00010 00011 /*************** <auto-copyright.pl BEGIN do not edit this line> ************** 00012 * 00013 * VR Juggler is (C) Copyright 1998-2003 by Iowa State University 00014 * 00015 * Original Authors: 00016 * Allen Bierbaum, Christopher Just, 00017 * Patrick Hartling, Kevin Meinert, 00018 * Carolina Cruz-Neira, Albert Baker 00019 * 00020 * This library is free software; you can redistribute it and/or 00021 * modify it under the terms of the GNU Library General Public 00022 * License as published by the Free Software Foundation; either 00023 * version 2 of the License, or (at your option) any later version. 00024 * 00025 * This library is distributed in the hope that it will be useful, 00026 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00027 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00028 * Library General Public License for more details. 00029 * 00030 * You should have received a copy of the GNU Library General Public 00031 * License along with this library; if not, write to the 00032 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00033 * Boston, MA 02111-1307, USA. 00034 * 00035 *************** <auto-copyright.pl END do not edit this line> ***************/ 00036 00037 #ifndef _TWEEK_CORBA_SUBJECT_IMPL_H_ 00038 #define _TWEEK_CORBA_SUBJECT_IMPL_H_ 00039 00040 #include <tweek/tweekConfig.h> 00041 00042 #include <vector> 00043 #include <vpr/Sync/Mutex.h> 00044 00045 #include <tweek/CORBA/Subject.h> 00046 #include <tweek/CORBA/Observer.h> 00047 00048 00049 namespace tweek 00050 { 00051 00057 class TWEEK_CLASS_API SubjectImpl : virtual public POA_tweek::Subject, 00058 public PortableServer::RefCountServantBase 00059 { 00060 public: 00061 SubjectImpl() 00062 { 00063 } 00064 00065 virtual ~SubjectImpl() 00066 { 00067 } 00068 00069 virtual void attach(Observer_ptr o); 00070 00071 virtual void detach(Observer_ptr o); 00072 00073 virtual void notify(); 00074 00075 protected: 00076 SubjectImpl(const SubjectImpl& s); 00077 00078 SubjectImpl& operator=(const SubjectImpl& subj) 00079 { 00080 return *this; 00081 } 00082 00083 private: 00084 typedef std::vector<Observer_var> observer_vec_t; 00085 observer_vec_t m_observers; 00086 vpr::Mutex m_observers_mutex; 00087 }; 00088 00089 } // End of tweek namespace 00090 00091 00092 #endif /* _TWEEK_CORBA_SUBJECT_IMPL_H_ */
1.2.14 written by Dimitri van Heesch,
© 1997-2002