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