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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

application.h

00001 /*
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 #ifndef ORCAICE_APPLICATION_H
00012 #define ORCAICE_APPLICATION_H
00013 
00014 #include <Ice/Application.h>
00015 #include <IceUtil/Mutex.h>
00016 
00017 namespace orcaice
00018 {
00019 
00020 class Component;
00021 
00038 class Application : public Ice::Application
00039 {
00040 public:
00041 
00056     Application( orcaice::Component &component, Ice::SignalPolicy policy=Ice::HandleSignals );
00057 
00058     //
00059     // Reimplements one of the main functions from Ice::Application
00060     //
00061     virtual int orcaMain(int, char*[]);
00062 
00063     //
00064     // Implements the run function from Ice::Application
00065     // Not part of OrcaIce public API.
00066     //
00067     virtual int run(int, char*[]);
00068 
00069     //
00070     // Called by Ice::Application when a signal is received
00071     //
00072     virtual void interruptCallback( int signal );
00073 
00074 private:
00075 
00076     // By Orca convention there is exactly one adapter per component and, therefore, per application
00077     // Keep the pointer to it here, so it does not get destroyed too soon.
00078     Ice::ObjectAdapterPtr adapter_;
00079 
00080     // An application contains only one Component.
00081     orcaice::Component &component_;
00082 
00083     // Application may stop for 2 reasons: a) an interrupt signal or b) communicator destruction.
00084     // Those two events may happen in different threads. No matter which event happens we need to
00085     // to know whether we already stopped the component or not.
00086     void stopComponent();
00087     bool isComponentStopped_;
00088     IceUtil::Mutex mutex_;
00089 };
00090 
00091 } // namespace
00092 
00093 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5