Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

LGmixin.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_LGmixin_h_
00003 #define INCLUDED_LGmixin_h_
00004 
00005 #include "Wireless/Wireless.h"
00006 
00007 namespace DualCoding {
00008   typedef unsigned char uchar;
00009   template <typename T> class Sketch;
00010 }
00011 
00012 //! Mix-in for the BehaviorBase or StateNode class to give access to Looking Glass variables.
00013 class LGmixin {
00014  protected:
00015   static unsigned int instanceCount; //!< count of LGmixin instances -- when this hits zero, close the socket
00016   static Socket *LGsock; //!< socket to talk to Looking Glass server
00017 
00018  public:
00019   //! Constructor
00020   LGmixin();
00021 
00022   //! Destructor
00023   virtual ~LGmixin();
00024 
00025   //! Upload a file from the AIBO to the Looking Glass client
00026   static void uploadFile(const std::string &filename, bool display=false, bool isImage=false);
00027 
00028   //! Display an HTML file on the Looking Glass
00029   static void displayHtmlFile(const std::string &remoteFilename);
00030 
00031   //! Display a single image file on the Looking Glass (creates a dummy HTML file)
00032   static void displayImageFile(const std::string &remoteFilename);
00033 
00034   //! Display HTML string on the Looking Glass (creates a dummy HTML file)
00035   static void displayHtmlText(const std::string &text);
00036 
00037   //! Upload current camera image to the Looking Glass client as a JPEG file
00038   static void uploadCameraImage(const std::string &remoteFileName);
00039 
00040   //! For debugging: send an arbitrary command string to the Looking Glass client
00041   static void sendCommand(const std::string &command);
00042 
00043   //! Upload a sketch as a PNG file to the Looking Glass client (not implemented yet) 
00044   static void uploadSketch(const DualCoding::Sketch<DualCoding::uchar> &sketch, const std::string &remoteFilename);
00045 
00046  private:
00047   //! used so static member functions can access non-static members
00048   static LGmixin* theOne;
00049 
00050   LGmixin (const LGmixin&);  //!< never call this
00051   LGmixin& operator=(const LGmixin&); //!< never call this
00052 
00053   static const unsigned int LGbufferSize = 80000; //!< maximum send buffer size
00054   static const unsigned int LGport = 10100; //!< port number to listen on
00055 
00056 };
00057 
00058 #endif

Tekkotsu v3.0
Generated Wed Oct 4 00:03:44 2006 by Doxygen 1.4.7