CORBASource.h
Go to the documentation of this file.00001 /* ======================================================================== 00002 * Copyright (C) 2006 Graz University of Technology 00003 * 00004 * This framework is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This framework 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 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this framework; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * For further information please contact 00019 * Dieter Schmalstieg 00020 * <schmalstieg@icg.tu-graz.ac.at> 00021 * Graz University of Technology, 00022 * Institut for Computer Graphics and Vision, 00023 * Inffeldgasse 16a, 8010 Graz, Austria. 00024 * ======================================================================== 00025 * PROJECT: OpenTracker 00026 * ======================================================================== */ 00033 /* ======================================================================= */ 00034 00061 #ifndef _CORBASOURCE_H 00062 #define _CORBASOURCE_H 00063 00064 #include "../dllinclude.h" 00065 00066 #include "../core/Node.h" 00067 #include <OT_CORBA.hh> 00068 #include <ace/Thread_Mutex.h> 00069 #include <stdio.h> 00070 #include <iostream> 00078 namespace ot { 00079 00080 class OPENTRACKER_API CORBASource : public Node 00081 { 00082 // Members 00083 public: 00085 Event event; 00086 00087 // Methods 00088 protected: 00091 CORBASource( ) : Node(), modified(false) 00092 { 00093 mu = new ACE_Thread_Mutex("corbasource"); 00094 } 00095 00096 public: 00097 virtual ~CORBASource( ) { 00098 delete mu; 00099 } 00100 00104 int isEventGenerator() 00105 { 00106 return 1; 00107 } 00108 00113 void push(); 00114 00115 void setEvent(const OT_CORBA::Event& new_event); 00116 00117 friend class CORBAModule; 00118 00119 private: 00120 ACE_Thread_Mutex* mu; 00121 bool modified; 00122 00123 public: 00124 void lock() { mu->acquire(); }; 00125 void unlock() { mu->release(); }; 00126 bool isModified() {return modified;}; 00127 00128 }; 00129 00130 } // namespace ot 00131 00132 #endif