WPILib 2012
WPILibRoboticsLibraryforFRC
|
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 __ENTRY_H__ 00008 #define __ENTRY_H__ 00009 00010 #include "ErrorBase.h" 00011 #include "NetworkTables/Data.h" 00012 #include "NetworkTables/InterfaceConstants.h" 00013 #include <vxWorks.h> 00014 00015 class NetworkTable; 00016 00017 namespace NetworkTables 00018 { 00019 00020 class Buffer; 00021 class Connection; 00022 class Key; 00023 00024 class Entry : public Data, public ErrorBase 00025 { 00026 public: 00027 void SetKey(Key *key) {m_key = key;} 00028 Key *GetKey() {return m_key;} 00029 UINT32 GetId(); 00030 void SetSource(Connection *source) {m_source = source;} 00031 Connection *GetSource() {return m_source;} 00032 00033 virtual void Encode(Buffer *buffer); 00034 virtual bool IsEntry() {return true;} 00035 00036 virtual NetworkTables_Types GetType() = 0; 00037 virtual int GetInt(); 00038 virtual double GetDouble(); 00039 virtual bool GetBoolean(); 00040 virtual int GetString(char *str, int len); 00041 virtual std::string GetString(); 00042 virtual NetworkTable *GetTable(); 00043 00044 private: 00045 00046 Key *m_key; 00047 Connection *m_source; 00048 }; 00049 00050 } // namespace 00051 00052 #endif