orca-robotics INTRODUCTION Overview Download and Install Quick Start Documentation Publications REPOSITORY Interfaces Components Libraries Utilities Software Map DEVELOPER Tutorials Examples Dev Guide Dashboard Wiki login/pass: orca/orca PEOPLE Contributors Users Project Download Mailing lists
|
iceapplication.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 // ********************************************************************** 00011 // 00012 // Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. 00013 // 00014 // This copy of Ice is licensed to you under the terms described in the 00015 // ICE_LICENSE file included in this distribution. 00016 // 00017 // ********************************************************************** 00018 00019 // 00020 // this file is a modified copy of ZeroC's Application.h v.3.1.0 00021 // 00022 00023 #ifndef ORCAICE_ICEAPPLICATION_H 00024 #define ORCAICE_ICEAPPLICATION_H 00025 00026 #include <Ice/Ice.h> 00027 00028 namespace orcaice 00029 { 00030 00031 // 00032 // This is Ice::Application, cut-and-pasted from the Ice source. 00033 // The only difference is that there's an extra flag passed to the constructor 00034 // that enables/disables setting up a Ctrl-C handler. 00035 // 00036 // orcaice::Application derives from this, and adds stuff specific to libOrcaIce 00037 // 00038 class IceApplication : private IceUtil::noncopyable 00039 { 00040 public: 00041 00042 IceApplication( bool installCtrlCHandler ); 00043 virtual ~IceApplication(); 00044 00045 // 00046 // This main() must be called by the global main(). main() 00047 // initializes the Communicator, calls run() as a template method, 00048 // and destroys the Communicator upon return from run(). It 00049 // thereby handles all exceptions properly, i.e., error messages 00050 // are printed if exceptions propagate to main(), and the 00051 // Communicator is always destroyed, regardless of exceptions. 00052 // 00053 // orca start 00054 virtual int main(int, char*[]); 00055 // orca end 00056 int main(int, char*[], const char*); 00057 int main(int, char*[], const Ice::InitializationData&); 00058 ICE_DEPRECATED_API int main(int, char*[], const char*, const Ice::LoggerPtr&); 00059 00060 virtual int run(int, char*[]) = 0; 00061 00062 // 00063 // Return the application name, i.e., argv[0]. 00064 // 00065 static const char* appName(); 00066 00067 // 00068 // One limitation of this class is that there can only be one 00069 // Application instance, with one global Communicator, accessible 00070 // with this communicator() operation. This limitation is due to 00071 // how the signal handling functions below operate. If you require 00072 // multiple Communicators, then you cannot use this Application 00073 // framework class. 00074 // 00075 static Ice::CommunicatorPtr communicator(); 00076 00077 // 00078 // These methods can be used to set a Ctrl+C Handler callback. 00079 // 00080 static void destroyOnInterrupt(); 00081 static void shutdownOnInterrupt(); 00082 static void ignoreInterrupt(); 00083 00084 // 00085 // These methods can be used to temporarily block a signal and 00086 // arrange for delivery of a pending signal later. Any signal that 00087 // is received after holdInterrupt() was called is remembered and 00088 // delivered when releaseInterupt() is called. That signal is then 00089 // handled according to the signal disposition established with 00090 // destroyOnInterrupt(), shutdownOnInterrupt() or 00091 // ignoreInterrupt(). 00092 // 00093 static void holdInterrupt(); 00094 static void releaseInterrupt(); 00095 00096 // 00097 // This method returns true if a signal handler was triggered, 00098 // false otherwise. This can be used once 00099 // Communicator::waitForShutdown() returns to test whether the 00100 // shutdown was due to an interrupt (interrupted() returns true in 00101 // that case) or because Communicator::shutdown() was called 00102 // (interrupted() returns false in that case). 00103 // 00104 static bool interrupted(); 00105 00106 00107 #if defined(__SUNPRO_CC) 00108 // 00109 // Sun C++ 5.x does not like classes with no data members 00110 // 00111 private: 00112 char _dummy; 00113 #endif 00114 00115 }; 00116 } 00117 00118 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)