Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
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;
00013 
00014 #if defined(PLATFORM_APERIOS)
00015 static const unsigned int SKETCH_BUFFER_SIZE=70000; // Raised to 120,000 for sketch<usint> in world space; then lowered to 70000 due to memory shortage
00016 #elseif defined(TGT_HAS_KINECT)
00017 static const unsigned int SKETCH_BUFFER_SIZE=1.5*(1<<20); // Raised to 1.5MB for higher resolution (640x480) uint images
00018 #else
00019 static const unsigned int SKETCH_BUFFER_SIZE=500000; // compromise value to accomodate 32-bit machines that have limited buffer pools
00020 #endif
00021 
00022 static const unsigned int CAM_LAYER=ProjectInterface::fullLayer; //!< the full resolution layer in the filter bank
00023 static const unsigned int CAM_CHANNEL=0;  //!< corresponds to appropriate thresholding listed in tekkotsu.xml
00024 static const unsigned int WORLD_WIDTH=225;
00025 static const unsigned int WORLD_HEIGHT=225;
00026 
00027 static const unsigned short CAM_DIALOG_PORT   = 5800;
00028 static const unsigned short CAM_SKETCH_PORT      = 5801;
00029 static const unsigned short LOCAL_DIALOG_PORT = 5802;
00030 static const unsigned short LOCAL_SKETCH_PORT    = 5803;
00031 static const unsigned short WORLD_DIALOG_PORT = 5804;
00032 static const unsigned short WORLD_SKETCH_PORT    = 5805;
00033 
00034 class ViewerConnection {
00035 
00036  private:
00037   Socket *dialogSock, *sketchSock;
00038   int dialogPort, sketchPort;
00039 
00040  public:
00041   ViewerConnection(void) : dialogSock(NULL), sketchSock(NULL), dialogPort(0), sketchPort(0) {}
00042 
00043   Socket *getDialogSocket() const { return dialogSock; }
00044   Socket *getSketchSocket() const { return sketchSock; }
00045 
00046   void setDialogSocket(Socket* sock, int const port) { dialogSock = sock; dialogPort = port; }
00047   void setSketchSocket(Socket* sock, int const port) { sketchSock = sock; sketchPort = port; }
00048 
00049   void writeBigString(std::string const &msg);
00050 
00051  private:
00052   ViewerConnection(const ViewerConnection&); //!< never call this
00053   ViewerConnection& operator=(const ViewerConnection&); //!< never call this
00054 
00055 };
00056 
00057 } // namespace
00058 
00059 #endif

DualCoding 5.1CVS
Generated Fri Mar 16 05:23:48 2012 by Doxygen 1.6.3