WPILib 2012
WPILibRoboticsLibraryforFRC
NetworkTables/Reader.h
00001 /*----------------------------------------------------------------------------*/
00002 /* Copyright (c) FIRST 2011. All Rights Reserved.                             */
00003 /* Open Source Software - may be modified and shared by FRC teams. The code   */
00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib.  */
00005 /*----------------------------------------------------------------------------*/
00006 
00007 #ifndef __READER_H__
00008 #define __READER_H__
00009 
00010 #include "NetworkTables/Entry.h"
00011 #include <memory>
00012 #include <string>
00013 
00014 namespace NetworkTables
00015 {
00016 class Connection;
00017 
00018 class Reader
00019 {
00020 public:
00021     Reader(Connection *connection, int inputStreamFd);
00022     int Read();
00023     std::string ReadString();
00024     int ReadId(bool useLastValue);
00025     int ReadTableId(bool useLastValue);
00026     int ReadInt();
00027     double ReadDouble();
00028     int ReadConfirmations(bool useLastValue);
00029     int ReadDenials(bool useLastValue);
00030     std::auto_ptr<Entry> ReadEntry(bool useLastValue);
00031 private:
00032     int Check(bool useLastValue);
00033     int ReadVariableSize(bool useLastValue, int tag);
00034 
00036     Connection *m_connection;
00038     int m_inputStreamFd;
00040     int m_lastByte;
00041 
00042 };
00043 
00044 } // namespace
00045 
00046 #endif
 All Classes Functions Variables