Homepage Demos Overview Downloads Tutorials Reference
Credits

ViewerConnection.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_ViewerConnection_h_
00003 #define INCLUDED_ViewerConnection_h_
00004 
00005 #include <string>
00006 
00007 #include "Shared/ProjectInterface.h"
00008 #include "Wireless/Wireless.h"
00009 
00010 namespace DualCoding {
00011 
00012 static const unsigned int DIALOG_BUFFER_SIZE=20000;  // was 200000 from RawCamBehavior, but malloc sometimes failed
00013 static const unsigned int RLE_BUFFER_SIZE=80000;  // was 200000 from RawCamBehavior, but malloc sometimes failed
00014                                // Raised to 80000 for sketch<usint>
00015 
00016 static const unsigned int CAM_LAYER=ProjectInterface::fullLayer; //!< the full resolution layer in the filter bank
00017 static const unsigned int CAM_CHANNEL=0;  //!< corresponds to appropriate thresholding listed in tekkotsu.cfg
00018 static const unsigned int WORLD_WIDTH=225;
00019 static const unsigned int WORLD_HEIGHT=225;
00020 
00021 static const unsigned short CAM_DIALOG_PORT   = 5800;
00022 static const unsigned short CAM_RLE_PORT      = 5801;
00023 static const unsigned short LOCAL_DIALOG_PORT = 5802;
00024 static const unsigned short LOCAL_RLE_PORT    = 5803;
00025 static const unsigned short WORLD_DIALOG_PORT = 5804;
00026 static const unsigned short WORLD_RLE_PORT    = 5805;
00027 
00028 #define CAM_WIDTH ProjectInterface::defSegmentedColorGenerator->getWidth(CAM_LAYER)
00029 #define CAM_HEIGHT ProjectInterface::defSegmentedColorGenerator->getHeight(CAM_LAYER)
00030 
00031 class ViewerConnection {
00032 
00033  private:
00034   Socket *dialogSock, *rleSock;
00035   int dialogPort, rlePort;
00036 
00037  public:
00038   ViewerConnection(void) : dialogSock(NULL), rleSock(NULL), dialogPort(0), rlePort(0) {}
00039 
00040   Socket *getDialogSocket() const { return dialogSock; }
00041   Socket *getRleSocket() const { return rleSock; }
00042 
00043   void setDialogSocket(Socket* sock, int const port) { dialogSock = sock; dialogPort = port; }
00044   void setRleSocket(Socket* sock, int const port) { rleSock = sock; rlePort = port; }
00045 
00046   void writeBigString(std::string const &msg);
00047 
00048  private:
00049   ViewerConnection(const ViewerConnection&); //!< never call this
00050   ViewerConnection& operator=(const ViewerConnection&); //!< never call this
00051 
00052 };
00053 
00054 } // namespace
00055 
00056 #endif

DualCoding 3.0beta
Generated Wed Oct 4 00:01:54 2006 by Doxygen 1.4.7