Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

phNodeControllerClient.h

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------
00002     Phission : 
00003         Realtime Vision Processing System
00004 
00005     Copyright (C) 2003 Philip D.S. Thoren (pthoren@cs.uml.edu)
00006     University of Massachusetts at Lowell,
00007     Laboratory for Artificial Intelligence and Robotics
00008 
00009     This file is part of Phission.
00010 
00011     Phission is free software; you can redistribute it and/or modify
00012     it under the terms of the GNU General Public License as published by
00013     the Free Software Foundation; either version 2 of the License, or
00014     (at your option) any later version.
00015 
00016     Phission is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019     GNU General Public License for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with Phission; if not, write to the Free Software
00023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024 
00025  ---------------------------------------------------------------------------*/
00026 #ifndef PHNODECONTROLLERCLIENT_H
00027 #define PHNODECONTROLLERCLIENT_H
00028 
00029 #include <phission.h>
00030 #include <phMessage.h>
00031 
00032 /* -------------------------------------------------------------------------- */
00033 #ifndef phID_INVALID
00034 #define phID_INVALID UINT_MAX
00035 #endif
00036 class phNodeControllerClient : protected phSocket
00037 {
00038 private:
00039     phMessage       m_message;
00040     uint32_t        m_controller_id;
00041     uint32_t        m_client_id;
00042 
00043     int initialize( );
00044     int deinitialize( );
00045     /* setClient/ControllerId is done by initialize and shouldn't
00046      * be allowed by a user. Only the port and host are set by 
00047      * user code. Initialization retreives the information that
00048      * is needed */
00049     int setClientId(uint32_t client_id);
00050     int setControllerId(uint32_t controller_id);
00051     
00052     int receive_message(); 
00053     int send_message( uint32_t message, uint32_t mutex_id = phID_INVALID );
00054 
00055 public:
00056     phNodeControllerClient( char *host = NULL, int port = 0 );
00057     ~phNodeControllerClient();
00058 
00059     int connect( char *host = NULL, int port = 0);
00060     void disconnect();
00061     bool isConnected();
00062 
00063     uint32_t getControllerId();
00064     uint32_t getClientId();
00065 
00066     int request(uint32_t mutex_id);
00067     int release(uint32_t mutex_id);
00068 };
00069 
00070 #endif /* PHNODECONTROLLERCLIENT_H */




Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:05 2007 for phission by  doxygen 1.4.4