ScrollGeneration.cpp (1433B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #include "ScrollGeneration.h" 6 7 #include <ostream> 8 9 namespace mozilla { 10 11 template <typename Tag> 12 ScrollGeneration<Tag>::ScrollGeneration() : mValue(0) {} 13 14 template <typename Tag> 15 ScrollGeneration<Tag>::ScrollGeneration(uint64_t aValue) : mValue(aValue) {} 16 17 template <typename Tag> 18 bool ScrollGeneration<Tag>::operator<( 19 const ScrollGeneration<Tag>& aOther) const { 20 return mValue < aOther.mValue; 21 } 22 23 template <typename Tag> 24 bool ScrollGeneration<Tag>::operator==( 25 const ScrollGeneration<Tag>& aOther) const { 26 return mValue == aOther.mValue; 27 } 28 29 template <typename Tag> 30 bool ScrollGeneration<Tag>::operator!=( 31 const ScrollGeneration<Tag>& aOther) const { 32 return !(*this == aOther); 33 } 34 35 template <typename Tag> 36 std::ostream& operator<<(std::ostream& aStream, 37 const ScrollGeneration<Tag>& aGen) { 38 return aStream << aGen.mValue; 39 } 40 41 template struct ScrollGeneration<APZTag>; 42 template struct ScrollGeneration<MainThreadTag>; 43 44 template std::ostream& operator<<(std::ostream&, 45 const ScrollGeneration<APZTag>&); 46 template std::ostream& operator<<(std::ostream&, 47 const ScrollGeneration<MainThreadTag>&); 48 49 } // namespace mozilla