Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

ArServerHandlerMapping.h

Go to the documentation of this file.
00001 /*
00002 MobileRobots Advanced Robotics Interface for Applications (ARIA)
00003 Copyright (C) 2004, 2005 ActivMedia Robotics LLC
00004 Copyright (C) 2006, 2007 MobileRobots Inc.
00005 
00006      This program is free software; you can redistribute it and/or modify
00007      it under the terms of the GNU General Public License as published by
00008      the Free Software Foundation; either version 2 of the License, or
00009      (at your option) any later version.
00010 
00011      This program is distributed in the hope that it will be useful,
00012      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014      GNU General Public License for more details.
00015 
00016      You should have received a copy of the GNU General Public License
00017      along with this program; if not, write to the Free Software
00018      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 If you wish to redistribute ARIA under different terms, contact 
00021 MobileRobots for information about a commercial version of ARIA at 
00022 robots@mobilerobots.com or 
00023 MobileRobots Inc, 19 Columbia Drive, Amherst, NH 03031; 800-639-9481
00024 */
00025 
00026 #ifndef ARSERVERHANDLERMAPPING_H
00027 #define ARSERVERHANDLERMAPPING_H
00028 
00029 #include "Aria.h"
00030 #include "ArServerBase.h"
00031 #include "ArServerHandlerCommands.h"
00032 
00034 class ArServerHandlerMapping
00035 {
00036 public:
00038   AREXPORT ArServerHandlerMapping(ArServerBase *server, ArRobot *robot,
00039                                   ArSick *sick, 
00040                                   const char *baseDirectory = "",
00041                                   const char *tempDirectory = "",
00042                                   bool useReflectorValues = false);
00044   AREXPORT virtual ~ArServerHandlerMapping();
00046   AREXPORT void serverMappingStart(ArServerClient *client, 
00047                                    ArNetPacket *packet);
00049   AREXPORT void serverMappingEnd(ArServerClient *client, 
00050                                  ArNetPacket *packet);
00052   AREXPORT void serverMappingStatus(ArServerClient *client, 
00053                                  ArNetPacket *packet);
00055   AREXPORT void addSimpleCommands(ArServerHandlerCommands *handlerCommands);
00057   AREXPORT void simpleLoopStart(ArArgumentBuilder *arg);
00059   AREXPORT void simpleLoopEnd(ArArgumentBuilder *arg);
00061   AREXPORT void addStringForStartOfLogs(
00062           const char *str, ArListPos::Pos position = ArListPos::LAST);
00064   AREXPORT void remStringForStartOfLogs(char *str);
00066   AREXPORT void addMappingStartCallback(
00067           ArFunctor *functor, ArListPos::Pos position = ArListPos::LAST);
00069   AREXPORT void remMappingStartCallback(ArFunctor *functor);
00071   AREXPORT void addMappingEndCallback(
00072           ArFunctor *functor, ArListPos::Pos position = ArListPos::LAST);
00074   AREXPORT void remMappingEndCallback(ArFunctor *functor);
00076   AREXPORT void addPreMoveCallback(
00077           ArFunctor *functor, ArListPos::Pos position = ArListPos::LAST);
00079   AREXPORT void remPreMoveCallback(ArFunctor *functor);
00081   AREXPORT void addPostMoveCallback(
00082           ArFunctor *functor, ArListPos::Pos position = ArListPos::LAST);
00084   AREXPORT void remPostMoveCallback(ArFunctor *functor);
00086   AREXPORT bool packetHandler(ArRobotPacket *packet);
00087 protected:
00088   ArServerBase *myServer;
00089   ArRobot *myRobot;
00090   ArSick *mySick;
00091   bool myUseReflectorValues;
00092   
00093 
00094   std::list<ArFunctor *> myMappingStartCallbacks;
00095   std::list<ArFunctor *> myMappingEndCallbacks;
00096   std::list<ArFunctor *> myPreMoveCallbacks;
00097   std::list<ArFunctor *> myPostMoveCallbacks;
00098   std::list<std::string> myStringsForStartOfLog;
00099   ArSickLogger *mySickLogger;
00100   std::string myMapName;
00101   std::string myFileName;
00102   std::string myBaseDirectory;
00103   std::string myTempDirectory;
00104   ArFunctor2C<ArServerHandlerMapping, ArServerClient *, ArNetPacket *> myMappingStartCB;
00105   ArFunctor2C<ArServerHandlerMapping, ArServerClient *, ArNetPacket *> myMappingEndCB;
00106   ArFunctor2C<ArServerHandlerMapping, ArServerClient *, ArNetPacket *> myMappingStatusCB;
00107   ArServerHandlerCommands *myHandlerCommands;
00108   ArRetFunctor1C<bool, ArServerHandlerMapping, ArRobotPacket *> myPacketHandlerCB;
00109   ArFunctor1C<ArServerHandlerMapping, ArArgumentBuilder *> myLoopStartCB;
00110   ArFunctor1C<ArServerHandlerMapping, ArArgumentBuilder *> myLoopEndCB;
00111 };
00112 
00113 
00114 
00115 #endif // ARSERVERHANDLERMAPPING_H

Generated on Tue Feb 20 10:51:50 2007 for ArNetworking by  doxygen 1.4.0