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

ArServerData.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 ARSERVERDATA_H
00027 #define ARSERVERDATA_H
00028 
00030 
00035 #include "Aria.h"
00036 
00037 class ArServerClient;
00038 class ArNetPacket;
00039 
00040 
00041 class ArServerData
00042 {
00043 public:
00045   AREXPORT ArServerData(
00046           const char *name, const char *description, unsigned int command,
00047           ArFunctor2<ArServerClient *, ArNetPacket *> *functor,
00048           const char *argumentDescription, const char *returnDescription,
00049           const char *commandGroup = NULL, const char *dataFlags = NULL,
00050           ArRetFunctor1<long, unsigned int> *getFrequencyFunctor = NULL,
00051           ArFunctor2<long, unsigned int> *requestChangedFunctor = NULL, 
00052           ArFunctor2<ArServerClient *, ArNetPacket *> 
00053           *requestOnceFunctor = NULL);
00055   AREXPORT virtual ~ArServerData();
00056   const char *getName(void) { return myName.c_str(); }
00057   const char *getDescription(void) { return myDescription.c_str(); }
00058   unsigned int getCommand(void) { return myCommand; }
00059   ArFunctor2<ArServerClient *, ArNetPacket *> *getFunctor(void) 
00060     { return myFunctor; };
00061   const char *getArgumentDescription(void) 
00062     { return myArgumentDescription.c_str(); }
00063   const char *getReturnDescription(void) 
00064     { return myReturnDescription.c_str(); }
00065   const char *getCommandGroup(void) 
00066     { return myCommandGroup.c_str(); }
00067   ArFunctor2<ArServerClient *, ArNetPacket *> *getRequestOnceFunctor(void)
00068     { return myRequestOnceFunctor; }
00069   AREXPORT bool hasDataFlag(const char *dataFlag);
00070   AREXPORT bool addDataFlags(const char *dataFlags);
00071   AREXPORT bool remDataFlag(const char *dataFlag);
00072   const char *getDataFlagsString(void) 
00073     { return myDataFlagsBuilder.getFullString(); }
00074   AREXPORT void callRequestChangedFunctor(void);
00075 protected:
00076   std::string myName;
00077   std::string myDescription;
00078   std::string myArgumentDescription;
00079   std::string myReturnDescription;
00080   std::string myCommandGroup;
00081   std::string myRawDataFlags;
00082   ArMutex myDataMutex;
00083   ArArgumentBuilder myDataFlagsBuilder;
00084   unsigned int myCommand;
00085   ArFunctor2<ArServerClient *, ArNetPacket *> *myFunctor;
00086   ArRetFunctor1<long, unsigned int> *myGetFrequencyFunctor;
00087   ArFunctor2<long, unsigned int> *myRequestChangedFunctor;
00088   ArFunctor2<ArServerClient *, ArNetPacket *> *myRequestOnceFunctor;
00089 };
00090 
00091 #endif // ARSERVERDATA_H

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