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 _PUSHCONS_H 00062 #define _PUSHCONS_H 00063 00064 #include <OpenTracker/dllinclude.h> 00065 #include <OpenTracker/core/Node.h> 00066 #include <OpenTracker/skeletons/OT_CORBA.hh> 00067 #include <ace/Thread_Mutex.h> 00068 #include <stdio.h> 00069 #include <iostream> 00077 namespace ot { 00078 00079 class OPENTRACKER_API PushCons : public Node 00080 { 00081 // Members 00082 public: 00084 Event event; 00085 00086 // Methods 00087 protected: 00090 PushCons( ) : Node(), modified(false) 00091 { 00092 mu = new ACE_Thread_Mutex("pushcons"); 00093 } 00094 00095 public: 00096 virtual ~PushCons( ) { 00097 delete mu; 00098 } 00099 00103 int isEventGenerator() 00104 { 00105 return 1; 00106 } 00107 00112 void push(); 00113 00114 void push(const CORBA::Any& data); 00115 00116 void setEvent(const OT_CORBA::Event& new_event); 00117 00118 friend class CORBAModule; 00119 00120 private: 00121 ACE_Thread_Mutex* mu; 00122 bool modified; 00123 00124 public: 00125 void lock() { mu->acquire(); }; 00126 void unlock() { mu->release(); }; 00127 bool isModified() {return modified;}; 00128 void disconnect_push_consumer (); 00129 }; 00130 00131 } // namespace ot 00132 00133 #endif
1.4.6