Now you can download a copy of these docs so you can use them offline! Download now
Denial.cpp
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 #include "NetworkTables/Denial.h" 00008 #include "NetworkTables/Buffer.h" 00009 #include "NetworkTables/InterfaceConstants.h" 00010 00011 namespace NetworkTables 00012 { 00013 00014 Denial::Denial(int count) : 00015 m_count(count) 00016 { 00017 } 00018 00019 void Denial::Encode(Buffer *buffer) 00020 { 00021 for (int i = m_count; i > 0; i -= kNetworkTables_DENIAL - 1) 00022 buffer->WriteByte(kNetworkTables_DENIAL | std::min(kNetworkTables_DENIAL - 1, i)); 00023 } 00024 00025 // Currently unused 00026 Denial *Denial::Combine(Denial *a, Denial *b) 00027 { 00028 a->m_count = a->m_count + b->m_count; 00029 delete b; 00030 return a; 00031 } 00032 00033 }
Generated on Thu Jan 12 2012 22:35:19 for WPILibC++ by
1.7.1